Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-49777

Change _currentCommittedSnapshot to be a timestamp instead of an optime

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Replication
    • Replication

      Currently, the _currentCommittedSnapshot is stored as an optime, which requires us to construct a term for it in certain cases when we don't set it based on a real optime in the oplog. This makes the stable timestamp calculation more complex than necessary, since the stable timestamp doesn't require any term information. We should consider refactoring the currentCommittedSnapshot to be a Timestamp, so that we don't need to construct a "virtual" optime. This would likely require re-wiring certain aspects of how we do write concern waiting logic, and may require some changes to how we provide this value as the "config optime" to sharding.

      Fundamentally, a timestamp should include sufficient information for the purposes that the committed snapshot is used for i.e. majority readers only use a timestamp for reads, and when waiting for an operation to commit at a certain write concern, timestamps should be sufficient to totally order operations in a local node log, so inclusion of the term shouldn't be strictly necessary.

            Assignee:
            backlog-server-repl [DO NOT USE] Backlog - Replication Team
            Reporter:
            william.schultz@mongodb.com Will Schultz
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: