[SERVER-28158] SnapshotThread should stop using LogicalClock to trigger snapshots Created: 01/Mar/17  Updated: 05/Apr/17  Resolved: 07/Mar/17

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: 3.5.3
Fix Version/s: 3.5.5

Type: Task Priority: Major - P3
Reporter: Randolph Tan Assignee: Randolph Tan
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-27749 Integrate LogicalTimeMetadata with me... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2017-03-06, Sharding 2017-03-27
Participants:

 Description   

Since it can advance without any writes.

Code in question:
https://github.com/mongodb/mongo/blob/r3.5.3/src/mongo/db/repl/oplog.cpp#L1196

Rationale:
getLastSetTimestamp gives you the last set logical time from the LogicalClock. With the implementation of the Lamport clock, the clock can advance even without any operations being applied. This will also avoid the following scenario:

0. Secondary is replicated till ts = T9.
1. Primary created new op with ts = T10.
2. Secondary got message from Primary and advanced clock to T10.
3. Secondary snapshot thread noticed time changed to T10 and started taking snapshot.
4. Secondary has only applied till T9, so it gets a snapshot of T9.
5. Secondary applies oplog entry with T10.
6. Secondary gets a read with readConcern majority and afterOpTime T10.
7. Read times out since the snapshot is in T9 and snapshot thread does not create new snapshot because it thinks the time time is already in T10.

Also note that the newTimestampNotifier will also need to change to trigger after the actual applied/generated opTime was changed (as opposed to the LogicalClock)



 Comments   
Comment by Githook User [ 07/Mar/17 ]

Author:

{u'username': u'renctan', u'name': u'Randolph Tan', u'email': u'randolph@10gen.com'}

Message: SERVER-28158 SnapshotThread should stop using LogicalClock to trigger snapshots

Note: This is a temporary band aid since the snapshot thread is slated for removal soon.
Branch: master
https://github.com/mongodb/mongo/commit/47365c5eecd58116088f5e07a75b9e051dc4e9eb

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