[SERVER-67403] Linearizable reads can occasionally read with wrong read source Created: 21/Jun/22  Updated: 06/Dec/22  Resolved: 21/Jun/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 5.0.9, 6.0.0-rc10, 6.1.0-rc0
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Matthew Russotto Assignee: Backlog - Replication Team
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-67402 Linearizable reads can occasionally r... Closed
Assigned Teams:
Replication
Operating System: ALL
Participants:

 Description   

Linearizable reads are supposed to happen only on a writable primary with a read source of kNoTimestamp. Because of a race, these reads may enter AutoGetCollectionForRead on a secondary or primary in catch-up mode. Before SERVER-55443, this would result in an fassert as they attempted to read at kNoTimestamp on the non-writable node. After SERVER-55443, there is no invariant, but they may read at kNoTimestamp on a node which is in the middle of applying oplog. Most of the time this will fail when the node attempt to do the no-op write when the read is finished, but if the node completes step-up before that happens, it may succeed. Because linearizable reads are supposed to be for single documents only, this should usually be OK (no inconsistency will be observable) but it is bad practice anyway.

Instead of either reading at kNoTimestamp on a secondary, or hitting an fassert, a linearizable read should uassert with NotWritablePrimary when it would otherwise open a snapshot.


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