[SERVER-33318] WTKVEngine::_advanceOldestTimestamp is unaware the input timestamp is already oplog visibility protected Created: 14/Feb/18  Updated: 29/Oct/23  Resolved: 05/Mar/18

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 3.7.3

Type: Bug Priority: Major - P3
Reporter: Daniel Gottlieb (Inactive) Assignee: Eric Milkie
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Storage NYC 2018-03-12
Participants:
Linked BF Score: 0

 Description   

SERVER-33126 added logic to prevent the stable timestamp from being set ahead of oplog visibility. It is a required piece for SERVER-29213.
`_advanceOldestTimestamp` was already doing this. However, `_advanceOldestTimestamp` early-returns if oplog visibility is behind the current oldest timestamp.

This combination creates a bug where SERVER-33126 passes an already pinned value to `_advanceOldestTimestamp`. The second pin attempt is unsuccessful, so the guard never executes.

Specifically how to hit this is significantly more involved; if oplog visibility wants to pin a write to the oldest timestamp, how come oplog visibility pinning didn't take effect on the previous write? Briefly, despite setting the oplog visibility to last applied coming out of initial sync, that update can be lost to a stale value.

In more detail: applying batches during initial sync sets the oldest timestamp to the last applied. Coming out of initial sync force sets the oldest timestamp to the last applied. Due to a race between multiple writers of this value, the oplog visibility thread can lose the force-set from coming out of initial sync and set it to a value from a, now-stale, read.



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

Author:

{'email': 'milkie@10gen.com', 'name': 'Eric Milkie', 'username': 'milkie'}

Message: SERVER-33318 simplify oldest_timestamp setting
Branch: master
https://github.com/mongodb/mongo/commit/8257a817bfaf596e68204ad858f811e294d986b5

Comment by Githook User [ 27/Feb/18 ]

Author:

{'email': 'milkie@10gen.com', 'name': 'Eric Milkie', 'username': 'milkie'}

Message: SERVER-33318 add missing include
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/973399fc5c5fb09a84f5224a149e6d69832ebe01

Comment by Eric Milkie [ 14/Feb/18 ]

A fix for this may be to simply remove the previous-set-oldest-timestamp functionality, since it is about to be subsumed by Part 3 of the Local Snapshot Reads Support Mechanism project.

Generated at Thu Feb 08 04:33:01 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.