[SERVER-48565] Ghost timestamps on primaries can break causality in multi-document "snapshot" reads Created: 03/Jun/20  Updated: 29/Oct/23  Resolved: 05/Jun/20

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 4.4.0-rc7
Fix Version/s: 4.4.0-rc9, 4.7.0

Type: Bug Priority: Major - P3
Reporter: Louis Williams Assignee: Louis Williams
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4
Sprint: Execution Team 2020-06-15
Participants:
Linked BF Score: 11

 Description   

Due to behavior described in SERVER-48327, the WT "all_durable" snapshot can move backward from ghost timestamps on primaries. Multi-document transactions with readConcern "snapshot" use the kAllDurableSnapshot ReadSource, which reads at the WT all_durable* timestamp.

If a ghost timestamp is used by a concurrent operation, an operation may observe all_durable moving backward after waiting for it to advance from a call to waitForAllEarlierOplogWritesToBeVisible. This means that a transaction with a readConcern "afterClusterTime: T" may read at a timestamp less than T.

I believe we can fix this by making all readers of all_durable go through getAllDurableTimestamp, which tracks and only returns the highest seen timestamp, preventing callers from seeing all_durable move backward.

 

*: all_durable is calculated as the minimum of (highest committed timestamp, oldest active timestamped transaction - 1)



 Comments   
Comment by Githook User [ 05/Jun/20 ]

Author:

{'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com', 'username': 'louiswilliams'}

Message: SERVER-48565 All readers of WT 'all_durable' should go through KVEngine getAllDurableTimestamp

This ensures that no operations observe the all_durable timestamp moving
backward due to ghost timestamps

(cherry picked from commit 00b9d54bfc7f8fc442b55ca5a55625bddd59c8da)
Branch: v4.4
https://github.com/mongodb/mongo/commit/33ec18754acd283045e9adfc3adc3bb4db982dc0

Comment by Githook User [ 04/Jun/20 ]

Author:

{'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com', 'username': 'louiswilliams'}

Message: SERVER-48565 All readers of WT 'all_durable' should go through KVEngine getAllDurableTimestamp

This ensures that no operations observe the all_durable timestamp moving
backward due to ghost timestamps
Branch: master
https://github.com/mongodb/mongo/commit/00b9d54bfc7f8fc442b55ca5a55625bddd59c8da

Generated at Thu Feb 08 05:17:29 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.