-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Replication, Storage
-
Fully Compatible
-
v3.6, v3.4, v3.2
-
Repl 2018-03-26
-
50
Currently, for a node in PRIMARY state, lastApplied is set to each write's optime when each write commits, as long as the time being set moves forward. (It might not otherwise always move forward because writes can commit out of optime order.)
This method of setting lastApplied is problematic for consumers of this value, as it can be set ahead of writes that are still in-flight and have yet to commit. For one-voting-node replica sets, this can result in the majority point moving ahead of uncommitted, in-flight writes.
Instead, we can use WiredTiger's all_committed value to set lastApplied. After each write commits, we can query the current all_committed value and set lastApplied to that.
The all_committed value is the greatest (latest) timestamp value with no existing in-flight writes with lower (earlier) timestamps. This value has been used in the past to implement oplog visibility, preventing oplog readers from reading past "holes" in the oplog left by uncommitted, in-flight writes.
- depends on
-
WT-3961 The all_committed timestamp should be less than any in-flight transaction
- Closed
- is depended on by
-
SERVER-29213 Have KVWiredTigerEngine implement StorageEngine::recoverToStableTimestamp
- Closed
- related to
-
SERVER-34895 Stable timestamp can be set to timestamp not in oplog
- Closed