From: Keir Fraser Subject: Re: /proc/xen/xenbus supports watch? Date: Wed, 21 Sep 2005 10:39:46 +0100 Message-ID: <61d8a8d77f6cbe2402b6a05810bd9447@cl.cam.ac.uk> References: <5d7aca9505090801025f3d5771@mail.gmail.com> <3d8eece205090803381b818f18@mail.gmail.com> <1126226609.25110.3.camel@localhost.localdomain> <3d8eece205091302422ac74f77@mail.gmail.com> <1126657264.7896.20.camel@localhost.localdomain> <1126689530.4415.10.camel@localhost.localdomain> <3d8eece205091405555a2871fc@mail.gmail.com> <1126748390.12119.33.camel@localhost.localdomain> <1126945564.29203.116.camel@localhost.localdomain> <1127088661.23870.47.camel@localhost.localdomain> <1127214064.2656.45.camel@localhost.localdomain> Mime-Version: 1.0 (Apple Message framework v622) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1127214064.2656.45.camel@localhost.localdomain> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Rusty Russell Cc: xen-devel List , Steven Hand , Christian Limpach List-Id: xen-devel@lists.xenproject.org On 20 Sep 2005, at 12:01, Rusty Russell wrote: > The only issue is that, in the case of migration, the new xenstored > won't know about any transaction currently in progress. We can either > migration transactions (easy for clients), or return EAGAIN for the > next > operation (easy for xenstored, sucks for clients). Well, you know we already disagree very strongly on this. Either we allow clients to lock down sections of the xenstore hierarchy for unbounded periods of time (unacceptable since we do not trust all clients) or we have to handle transaction failure in the clients. The only exception to this I can think of is read-only transactions, where you can take a read-only consistent snapshot of the store when the transaction begins and guarantee eventual success (even here we may want a timeout to avoid resource hogging). Apart from that, on failure the client *has* to execute its transactional code again -- the values it writes to the store may be dependent on values it reads as part of the same transaction. If the transaction is failed because some of those values it read are now stale (or might be stale, because a leased lock was revoked), the transaction replay has to include re-execution of the client code -- it cannot be hidden in the transactional API (e.g., just replaying the transactional writes from the previous failed attempt may be incorrect if those writes are based on stale reads from the previous failed attempt). This is the price for providing ACID guarantees (well, A, C and I at least, and without atomicity, consistency and isolation you are not implementing transactions as understood by every computer scientist). If we have to make failure visible to clients anyway (and I'm sure we do), it does at least greatly simplify things like xenstored restart and migration. Transactions are simply failed. -- Keir