---> 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. You may have a misunderstanding on what sequential consistency guarantees. For your example: Suppose that you have following operations: create /mypath v0 (0x11000012207) setData /mypath v1 (0x11000012208) setData /mypath v2 (0x11000012209) Now at the time(t1), the client setDatas 0x110000122a(v3) successfully. Just after the time(t1), the client still has the potential possibility to read the value(v2), otherwise v3. (e.g.,: the client may connect to the minority server which may receive or write the transaction log slower than the majority due to network or disk latency, so the write is not exposed to that client in time)
Generally speaking, sequential consistency guarantees that we don't have the potential risk of read skew. However it doesn't guarantee that you can always read the latest value. What you want may be Linearizability. You may be interested in these posts which have more accurate definition on the consistency:https://aphyr.com/posts/313-strong-consistency-modelshttps://jepsen.io/consistency/models/sequentialhttps://jepsen.io/consistency/models/linearizable BTW, I am working on "ZOOKEEPER-3600:support the complete linearizable read and multiply read consistency level", and I wish it will be coming soon. ----- Original Message ----- From: Ted Dunning <[email protected]> To: [email protected] Subject: Re: Sequential Consistency Guarantees Date: 2020-08-28 02:06 Can you describe your evidence in more detail as you understand it? On Thu, Aug 27, 2020 at 10:26 AM Stanislav Kozlovski <[email protected]> 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 >
