zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marshall McMullen <marshall.mcmul...@gmail.com>
Subject Re: Transactional reads.
Date Wed, 13 May 2015 05:32:29 GMT
‚ÄčThe only way to do this safely without ZOOKEEPER-1407 would be to do all
the reads and get the version of each path as you're doing the reads. Put a
corresponding Check() operation into a multi for each path you've read.
After you've read everything commit the multi. The Check() operation
doesn't modify the database in any way but allows you to verify that a
given path exists with ‚Äčan exact version number. Since a multi is a
transactional operation you'll be guaranteed that you have the most recent
versions of all those paths that you read...

At least that's how I'd solve this problem.

On Tue, May 12, 2015 at 10:58 PM, Patrick Hunt <phunt@apache.org> wrote:

> Not that I know of. Perhaps by using an explicit zookeeper lock around the
> operations that you want to protect?
> Patrick
> On Mon, May 11, 2015 at 3:14 AM, Paolo Viotti <paolo.viotti@eurecom.fr>
> wrote:
> > Hi,
> >
> > I've noticed that read operations in Multi are not supported (although
> > they will be: https://issues.apache.org/jira/browse/ZOOKEEPER-1407 ), so
> > I was wondering: is there a suggested best practice / recipe for reading
> > atomically several znodes?
> >
> > Thanks,
> > Paolo
> >

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message