Message from discussion
happstack-state / acid-state and disk full
Received: by 10.224.213.10 with SMTP id gu10mr19283523qab.6.1326670711231;
Sun, 15 Jan 2012 15:38:31 -0800 (PST)
X-BeenThere: happs@googlegroups.com
Received: by 10.229.166.138 with SMTP id m10ls11239783qcy.3.gmail; Sun, 15 Jan
2012 15:38:30 -0800 (PST)
Received: by 10.224.188.147 with SMTP id da19mr19283915qab.8.1326670710259;
Sun, 15 Jan 2012 15:38:30 -0800 (PST)
Received: by 10.224.188.147 with SMTP id da19mr19283913qab.8.1326670710249;
Sun, 15 Jan 2012 15:38:30 -0800 (PST)
Return-Path: <lem...@gmail.com>
Received: from mail-qy0-f181.google.com (mail-qy0-f181.google.com [209.85.216.181])
by gmr-mx.google.com with ESMTPS id jp9si2118535qcb.2.2012.01.15.15.38.30
(version=TLSv1/SSLv3 cipher=OTHER);
Sun, 15 Jan 2012 15:38:30 -0800 (PST)
Received-SPF: pass (google.com: domain of lem...@gmail.com designates 209.85.216.181 as permitted sender) client-ip=209.85.216.181;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of lem...@gmail.com designates 209.85.216.181 as permitted sender) smtp.mail=lem...@gmail.com; dkim=pass header...@gmail.com
Received: by qcqw6 with SMTP id w6so1392082qcq.40
for <happs@googlegroups.com>; Sun, 15 Jan 2012 15:38:30 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=gamma;
h=mime-version:in-reply-to:references:date:message-id:subject:from:to
:content-type:content-transfer-encoding;
bh=gFBLU1Jbp3oMMIFn3PurUKzvlAH19LS6W/u6IWAtFkA=;
b=aQjcx7kYYTcRgj2fopCdFzy7m90Ce404Z8R/39t8+UMxkf9cXPCpJ8BI7KH1bo5i2h
RWyWp8V5oGJya8FHwlT7aRNgrRE+l4muPz6z8dVHE1Wmrep2T1gUw6z0XVoZYr/djkc4
YfWr7wtGklsiJe0S9Kkp5rwfMcyCoUARDM0O8=
MIME-Version: 1.0
Received: by 10.229.135.77 with SMTP id m13mr3283808qct.119.1326670710112;
Sun, 15 Jan 2012 15:38:30 -0800 (PST)
Received: by 10.229.250.3 with HTTP; Sun, 15 Jan 2012 15:38:29 -0800 (PST)
In-Reply-To: <CAGE_JKasNaTY2hS+fo_CJkdbLiKoxnCXtCGbqQYEevyQWm6sXQ@mail.gmail.com>
References: <CADBeSAWUJVFBt8RMn+nyXNy0g073yE0auWrd4S=o1wV1u_7...@mail.gmail.com>
<CAGE_JKasNaTY2hS+fo_CJkdbLiKoxnCXtCGbqQYEevyQWm6...@mail.gmail.com>
Date: Mon, 16 Jan 2012 00:38:29 +0100
Message-ID: <CADf-Jb=2pbL=yveQwqVb0x9NVyfX0Z5jxdeM4-k3b1WSjuJ...@mail.gmail.com>
Subject: Re: happstack-state / acid-state and disk full
From: Lemmih <lem...@gmail.com>
To: happs@googlegroups.com
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
On Mon, Jan 16, 2012 at 12:29 AM, Jeremy Shaw <jer...@n-heptane.com> wrote:
> 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 ERRN=
O
> exception ENOSPC.
>
> Still, it is not entirely obvious what the result of that will be. Lookin=
g
> at the code, =C2=A0I think it means that the 'update' call will never ret=
urn
> 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.
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.
--=20
Cheers,
=C2=A0 Lemmih