-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Fully Compatible
-
v6.0, v5.0
-
Sharding NYC 2022-05-30, Sharding NYC 2022-06-13
-
(copied to CRM)
-
42
-
3
Currently, the coordinateCommitReturnImmediatelyAfterPersistingDecision server parameter added in SERVER-37364 defaults to true, meaning a user may not get read-your-writes behavior even when using readPreference primary in the following cases:
- User does a 2PC transaction (with a write, and within a session)
- User tries to read the write it just did using a read
- (1) outside a session, or
- (2) in a different session, or
- (3) outside a transaction in the same session without causal consistency.
If (4) the user did the read in a new transaction in the same session (regardless of causal consistency), the read is guaranteed to return the write, because the new transaction would block until the earlier transaction had committed on the transaction participant.
If (5) the user did the read outside a transaction in the same session but with causal consistency, I think the read would return the write, because the read's afterClusterTime would be >= the operationTime returned for the earlier transaction's commitTransaction >= the transaction's commitTimestamp >= the prepareTimestamp on any transaction participant. I think the storage engine would not allow reading a document that's in prepare at a timestamp >= the document's prepareTimestamp.
Since we in general try to preserve read-your-writes behavior when using readPreference primary, we may want to make coordinateCommitReturnImmediatelyAfterPersistingDecision default to false. Preserving read-your-writes is also a sensible default in Serverless.
If we make this change, we may want to improve documentation for coordinateCommitReturnImmediatelyAfterPersistingDecision for users who want to set it to true.
CC judah.schvimer , tess.avitabile
Acceptance criteria:
- Change the server parameter value to false.
- Audit what test coverage we have for coordinateCommitReturnImmediatelyAfterPersistingDecision=true to ensure we aren't losing all of our test coverage for the commitTransaction optimization. We generally aim to test the server's default behavior but having one concurrency suite running with the commitTransaction optimization on would be worthwhile.
- is related to
-
SERVER-63815 Add section on probable-read-you-writes behavior to arch guide
- Backlog
-
SERVER-37364 Coordinator should return the decision to the client as soon as the decision is durable
- Closed
-
SERVER-47130 Reduce w:majority commits from 4 to 2 in 2 PC
- Backlog
- related to
-
SERVER-60947 concurrency_sharded_replication_multiversion_passthrough does not set coordinateCommitReturnImmediatelyAfterPersistingDecision to false for binaries in last version
- Closed
-
SERVER-64515 Remove claims of prepare behavior from linearizable reads
- Open