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

appendOplogNote command needs to ensure it's still primary after taking locks

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Gone away
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Replication
    • Replication
    • ALL
    • Repl 2017-10-02, Repl 2017-10-23

    Description

      The append oplog note command relies on the command subsystem to prevent it from running when it's a secondary, but that check is inherently racy as it's not holding any db locks at that point.

      Also, the appendOplogNote command currently takes a global write lock, which is unnecessary heavy.

      The command should be changed to take the global lock in mode IX, check that it's still primary, and then proceed with calling onOpMessage to write the no-op oplog entry (which takes a write lock on the oplog internally).

      Attachments

        Activity

          People

            backlog-server-repl Backlog - Replication Team
            spencer@mongodb.com Spencer Brody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: