You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by Stanislav Kozlovski <st...@confluent.io> on 2020/08/27 08:18:03 UTC

Sequential Consistency Guarantees

Hello!

We were investigating an issue with consistent reads in ZK which made us
question our assumptions.
We believe that ZK offers sequential consistency such that if a client
creates a node with zxid 0x110000122a, it should be able to see (read) all
data changes at least up to that zxid.

Could I ask if this is a correct understanding? We seem to be seeing
evidence that's pointing towards the opposite direction.

Looking at the documentation
<https://zookeeper.apache.org/doc/r3.1.2/zookeeperProgrammers.html#ch_zkGuarantees>,
it does not seem to address this specific point. It says that "Updates from
a client will be applied in the order that they were sent" and talks about
"Consistent Cross-Client Views" but does not seem to address cross-client
update order, unless I'm missing something.

-- 
Best,
Stanislav

Re: Sequential Consistency Guarantees

Posted by tison <wa...@gmail.com>.
BTW, there is no permission on cross-client update order.

Best,
tison.


tison <wa...@gmail.com> 于2020年8月28日周五 上午1:50写道:

> Hi Stanislav,
>
> The question you raise is a user question so I forward to user mailing
> list. Please continue discussion here.
>
> The first thing I'd like to know in order to understand your question is
> that what is "data changes" in your mind?
>
> ZooKeeper uses watcher mechanism to reflect to data changes, which is
> designed possibly miss some changes.
>
> Best,
> tison.
>
>
> Stanislav Kozlovski <st...@confluent.io> 于2020年8月28日周五 上午1:26写道:
>
>> Hello!
>>
>> We were investigating an issue with consistent reads in ZK which made us
>> question our assumptions.
>> We believe that ZK offers sequential consistency such that if a client
>> creates a node with zxid 0x110000122a, it should be able to see (read) all
>> data changes at least up to that zxid.
>>
>> Could I ask if this is a correct understanding? We seem to be seeing
>> evidence that's pointing towards the opposite direction.
>>
>> Looking at the documentation
>> <
>> https://zookeeper.apache.org/doc/r3.1.2/zookeeperProgrammers.html#ch_zkGuarantees
>> >,
>> it does not seem to address this specific point. It says that "Updates
>> from
>> a client will be applied in the order that they were sent" and talks about
>> "Consistent Cross-Client Views" but does not seem to address cross-client
>> update order, unless I'm missing something.
>>
>> --
>> Best,
>> Stanislav
>>
>

Re: Sequential Consistency Guarantees

Posted by Michael Han <ha...@apache.org>.
Do you mind providing a concrete example of the "evidence that's pointing
towards the opposite direction" just to make sure we are on the same page
on the topic.

On a side note, the latest document describing consistency guarantees is
here:
https://github.com/apache/zookeeper/blob/master/zookeeper-docs/src/main/resources/markdown/zookeeperInternals.md#sc_consistency
.
Does this answer some of your questions?

On Thu, Aug 27, 2020 at 10:51 AM tison <wa...@gmail.com> wrote:

> Hi Stanislav,
>
> The question you raise is a user question so I forward to user mailing
> list. Please continue discussion here.
>
> The first thing I'd like to know in order to understand your question is
> that what is "data changes" in your mind?
>
> ZooKeeper uses watcher mechanism to reflect to data changes, which is
> designed possibly miss some changes.
>
> Best,
> tison.
>
>
> Stanislav Kozlovski <st...@confluent.io> 于2020年8月28日周五 上午1:26写道:
>
> > Hello!
> >
> > We were investigating an issue with consistent reads in ZK which made us
> > question our assumptions.
> > We believe that ZK offers sequential consistency such that if a client
> > creates a node with zxid 0x110000122a, it should be able to see (read)
> all
> > data changes at least up to that zxid.
> >
> > Could I ask if this is a correct understanding? We seem to be seeing
> > evidence that's pointing towards the opposite direction.
> >
> > Looking at the documentation
> > <
> >
> https://zookeeper.apache.org/doc/r3.1.2/zookeeperProgrammers.html#ch_zkGuarantees
> > >,
> > it does not seem to address this specific point. It says that "Updates
> from
> > a client will be applied in the order that they were sent" and talks
> about
> > "Consistent Cross-Client Views" but does not seem to address cross-client
> > update order, unless I'm missing something.
> >
> > --
> > Best,
> > Stanislav
> >
>

Re: Sequential Consistency Guarantees

Posted by tison <wa...@gmail.com>.
Hi Stanislav,

The question you raise is a user question so I forward to user mailing
list. Please continue discussion here.

The first thing I'd like to know in order to understand your question is
that what is "data changes" in your mind?

ZooKeeper uses watcher mechanism to reflect to data changes, which is
designed possibly miss some changes.

Best,
tison.


Stanislav Kozlovski <st...@confluent.io> 于2020年8月28日周五 上午1:26写道:

> Hello!
>
> We were investigating an issue with consistent reads in ZK which made us
> question our assumptions.
> We believe that ZK offers sequential consistency such that if a client
> creates a node with zxid 0x110000122a, it should be able to see (read) all
> data changes at least up to that zxid.
>
> Could I ask if this is a correct understanding? We seem to be seeing
> evidence that's pointing towards the opposite direction.
>
> Looking at the documentation
> <
> https://zookeeper.apache.org/doc/r3.1.2/zookeeperProgrammers.html#ch_zkGuarantees
> >,
> it does not seem to address this specific point. It says that "Updates from
> a client will be applied in the order that they were sent" and talks about
> "Consistent Cross-Client Views" but does not seem to address cross-client
> update order, unless I'm missing something.
>
> --
> Best,
> Stanislav
>

Re: Sequential Consistency Guarantees

Posted by Ted Dunning <te...@gmail.com>.
I think that the answer depends a bit on what you mean by "client". If you
mean client connection (as in the result of opening a connection to a
Zookeeper cluster), then you should see things in order so that reads
following a successful and acknowledged commit should see only states at or
after that commit. Even if there is a loss of connection with the cluster,
the client will take measures to make sure it does not regress when
connecting to a different ZK server.

If, on the other hand, by client you mean a program that is not a ZK
server, then that client could see inconsistent behavior if it has more
than one connection to the ZK cluster or if it closes and reopens the
connection to the cluster.



On Thu, Aug 27, 2020 at 10:26 AM Stanislav Kozlovski <st...@confluent.io>
wrote:

> Hello!
>
> We were investigating an issue with consistent reads in ZK which made us
> question our assumptions.
> We believe that ZK offers sequential consistency such that if a client
> creates a node with zxid 0x110000122a, it should be able to see (read) all
> data changes at least up to that zxid.
>
> Could I ask if this is a correct understanding? We seem to be seeing
> evidence that's pointing towards the opposite direction.
>
> Looking at the documentation
> <
> https://zookeeper.apache.org/doc/r3.1.2/zookeeperProgrammers.html#ch_zkGuarantees
> >,
> it does not seem to address this specific point. It says that "Updates from
> a client will be applied in the order that they were sent" and talks about
> "Consistent Cross-Client Views" but does not seem to address cross-client
> update order, unless I'm missing something.
>
> --
> Best,
> Stanislav
>

Re: Sequential Consistency Guarantees

Posted by Ted Dunning <te...@gmail.com>.
Can you describe your evidence in more detail as you understand it?



On Thu, Aug 27, 2020 at 10:26 AM Stanislav Kozlovski <st...@confluent.io>
wrote:

> Hello!
>
> We were investigating an issue with consistent reads in ZK which made us
> question our assumptions.
> We believe that ZK offers sequential consistency such that if a client
> creates a node with zxid 0x110000122a, it should be able to see (read) all
> data changes at least up to that zxid.
>
> Could I ask if this is a correct understanding? We seem to be seeing
> evidence that's pointing towards the opposite direction.
>
> Looking at the documentation
> <
> https://zookeeper.apache.org/doc/r3.1.2/zookeeperProgrammers.html#ch_zkGuarantees
> >,
> it does not seem to address this specific point. It says that "Updates from
> a client will be applied in the order that they were sent" and talks about
> "Consistent Cross-Client Views" but does not seem to address cross-client
> update order, unless I'm missing something.
>
> --
> Best,
> Stanislav
>