[DOCS-11866] Document Causal Consistency behavior for different read and write concerns Created: 09/Jul/18  Updated: 30/Oct/23  Resolved: 05/Sep/18

Status: Closed
Project: Documentation
Component/s: Server
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Improvement Priority: Major - P3
Reporter: Misha Tyulenev Assignee: Kay Kim (Inactive)
Resolution: Fixed Votes: 0
Labels: consistency
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

https://docs.mongodb.com/manual/core/read-isolation-consistency-recency/index.html#causal-consistency


Issue Links:
Depends
depends on SERVER-35316 Causal Consistency Violation for loca... Closed
Participants:
Days since reply: 5 years, 23 weeks ago
Story Points: 1

 Description   

----------------------------

Original Description

Causal Consistency behavior varies depending on the read and write concerns as described in SERVER-35316. The documentation needs an update to provide more details to the user and avoid confusion while using this feature.
----------------------------

Description

Copied from SERVER-35316:

When running a test against 2 replica set shards, with rc “local” and wc “w1” we get reads returning the base value of the document, nil, despite occurring after acknowledged writes in the session. Each single threaded client is writing to one key at a time, using one session, against a single mongos router, and does not have writes to secondaries enabled. The nemesis partitions the network into random halves for 10 seconds, with a 10 second wait in between (This failure has not appeared with partitions disabled.

The expected pattern of operations in this test is read nil/0, write 1, read 1, write 2, read 2. In the test histories I’ve attached below, the :position field is the op’s optime value, read from the session after acknowledgement. It’s :link field is the previous optime value the client has seen in that key’s session.

In the first set of results (rwr-initial-read-1), this occurs in 3 keys over a 40 second test. In each failing key (15 23 16), we see a read of 0 (representing the initial empty document’s read nil for the checker), and a successful write of 1. Then the read following write 2 returns an empty document.

The second result set (rwr-initial-read-2) provided is a longer test over 300 seconds, where we observe this anomaly 6 times. Keys 50, 51, 82, 125, and 143 appear to drop the value on write 2. However, key 116 is missing the value for write 1. Also of note is that in the history for key 116, (under independent/116) write 2 succeeds and appears in the final read for the key. See op `{:type :ok, :f :read, :value 2, :process 5, :time 205602064887, :position 6559250071353819138, :link 6559250071353819137, :index 1206}`

Scope of changes (files that need work and how much)

Impact to other docs outside of this product

MVP (work and date?)

Resources (e.g. Scope Docs, Invision)



 Comments   
Comment by Githook User [ 05/Sep/18 ]

Author:

{'name': 'kay', 'email': 'kay.kim@10gen.com', 'username': 'kay-kim'}

Message: DOCS-11866: add redirects
Branch: master
https://github.com/mongodb/docs/commit/19e15ad8ff4a9b28ec2644beaf116e7a9107fb71

Comment by Githook User [ 05/Sep/18 ]

Author:

{'name': 'kay', 'email': 'kay.kim@10gen.com', 'username': 'kay-kim'}

Message: DOCS-11866, DOCS-11882: updates to causally consistent sessions
Branch: v3.6
https://github.com/mongodb/docs/commit/9f63dd868be3a1c8b4d7668f7f84d8685adcd51b

Comment by Githook User [ 05/Sep/18 ]

Author:

{'name': 'kay', 'email': 'kay.kim@10gen.com', 'username': 'kay-kim'}

Message: DOCS-11866, DOCS-11882: updates to causally consistent sessions
Branch: master
https://github.com/mongodb/docs/commit/6fba10ec6d58ba39b713efbf7ee749b5929af947

Generated at Thu Feb 08 08:03:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.