Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
happstack-state / acid-state and disk full
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Petter Bergman  
View profile  
 More options Jan 15 2012, 4:55 pm
From: Petter Bergman <jon.petter.berg...@gmail.com>
Date: Sun, 15 Jan 2012 22:55:01 +0100
Local: Sun, Jan 15 2012 4:55 pm
Subject: happstack-state / acid-state and disk full

Hi,

Today my processes running happstack-state stopped responding, upon
investigation I discovered that the "disk" on my virtual server had become
full.

Trying to (re)-start the 3 of my server processes(the processes connected
to customers) yielded the following error:

> handleEvent FAIL: too few bytes. Failed reading at byte position 72
> booking: too few bytes. Failed reading at byte position 72

2 other processes started fine, these probably never had any activity on
them.

I solved the error by reverting back to a backup.

What will happen if happstack-state can't write an event to disk because
the disk is full?

What will happen in the same situation with acid-state?

Regards

Petter Bergman


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Felipe Almeida Lessa  
View profile  
 More options Jan 15 2012, 5:10 pm
From: Felipe Almeida Lessa <felipe.le...@gmail.com>
Date: Sun, 15 Jan 2012 20:10:01 -0200
Local: Sun, Jan 15 2012 5:10 pm
Subject: Re: happstack-state / acid-state and disk full
On Sun, Jan 15, 2012 at 7:55 PM, Petter Bergman

<jon.petter.berg...@gmail.com> wrote:
> What will happen if happstack-state can't write an event to disk because the
> disk is full?

AFAIK, the log will become corrupted, just like you saw.

> What will happen in the same situation with acid-state?

Probably the same thing.

Cheers,

--
Felipe.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matthew Elder  
View profile  
 More options Jan 15 2012, 5:27 pm
From: Matthew Elder <m...@mattelder.org>
Date: Sun, 15 Jan 2012 14:27:21 -0800
Local: Sun, Jan 15 2012 5:27 pm
Subject: Re: happstack-state / acid-state and disk full

AFAIK you should be able to back up a little bit in the log to a clean spot
(i.e shave off some bytes).. recommend looking at last few bytes of file
(tail?) and try to find the boundary.

On Sun, Jan 15, 2012 at 2:10 PM, Felipe Almeida Lessa <


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeremy Shaw  
View profile  
 More options Jan 15 2012, 6:29 pm
From: Jeremy Shaw <jer...@n-heptane.com>
Date: Sun, 15 Jan 2012 17:29:01 -0600
Local: Sun, Jan 15 2012 6:29 pm
Subject: Re: happstack-state / acid-state and disk full

On Sun, Jan 15, 2012 at 3:55 PM, Petter Bergman <

jon.petter.berg...@gmail.com> wrote:
> What will happen if happstack-state can't write an event to disk because
> the disk is full?

Who knows. One of the reasons for a clean rewrite as acid-state is that
happstack-state had too many loose ends like that.

> What will happen in the same situation with acid-state?

One of the things Lemmih worked on in acid-state was ensuring that events
really got flushed to disk. That is the reason why it uses the low-level
posix API for writing files to disk.

The correct behavior when the disk is full is for update transactions to
fail. That is pretty much the only way to handle the 'durability' aspect of
ACID. If we can not successfully flush the event log to disk, then we can
not allow the transaction to complete.

Internally, acid-state uses 'write(2)' to write the transaction to disk (or
something similar on Win32). If the write fails, it will it raise an ERRNO
exception ENOSPC.

Still, it is not entirely obvious what the result of that will be. Looking
at the code,  I think it means that the 'update' call will never return
because the thread that writes the log will die and never write the mvar
that allows update to return. Obviously.. it might be nicer if the update
function itself raised an exception instead of just blocking? Though
blocking forever (or until happstack kills the request thread) does seem
ACID compliant..

Hopefully Lemmih can provide a better answer.

- jeremy


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lemmih  
View profile  
 More options Jan 15 2012, 6:38 pm
From: Lemmih <lem...@gmail.com>
Date: Mon, 16 Jan 2012 00:38:29 +0100
Local: Sun, Jan 15 2012 6:38 pm
Subject: Re: happstack-state / acid-state and disk full

It'll probably fail in some ugly way but it'll definitely be ACID
compliant. Making it fail more gracefully isn't high on my TODO list
since it isn't a torn in my side.

--
Cheers,
  Lemmih


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Petter Bergman  
View profile  
 More options Jan 16 2012, 2:32 am
From: Petter Bergman <jon.petter.berg...@gmail.com>
Date: Mon, 16 Jan 2012 08:32:33 +0100
Local: Mon, Jan 16 2012 2:32 am
Subject: Re: happstack-state / acid-state and disk full

Thanks for all answers, once I am done rewriting my app using acid-state I
will try to simulate this situation again and see what happens.

Ironically, in this case the cure was the cause of the problem. I had a
cron job taking backups on regular intervals, it was these backups that
saved me this time, but also the backups that filled up the disk in the
first place...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »