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

Rollback should take global write lock while truncating oplog

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

      In ReplicationRecoveryImpl::_truncateOplogTo we lock the oplog's database and collection; however, we have a general principle that we can read from the oplog with a global IS lock, write to it without locking the database and collection.

      For example the oplog cap maintainer thread only takes the global IX lock to truncate old entries in OplogCapMaintainerThread::_deleteExcessDocuments.

      Let's change ReplicationRecoveryImpl to take the global X or IX lock (I'm not sure which) instead of locking the oplog's db and collection.

            Assignee:
            backlog-server-repl [DO NOT USE] Backlog - Replication Team
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated: