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

Range deleter observers must register tasks after the oplog entry is committed

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 6.2.0-rc0
    • None
    • None
    • None
    • Fully Compatible
    • ALL
    • Sharding EMEA 2022-09-19

    Description

      The range deleter observer is currently registering tasks on insert and on update , slightly before the entry oplog entry is actually committed.

      This may lead to an improbable but still possible race condition:

      1. The observer registers the task with "whenToClean=now"
      2. The range deleter service executor picks the task and executes it right away
      3. No orphan gets deleted because the range deletion document is not visible yet, the task gets unscheduled
      4. The range deletion document gets committed

      Purpose of this ticket is to delay the registration after the commit actually happens (basically making sure 4 always happens first). This can be done by registering an onCommit event similarly to the way it's done for the critical section.

      Attachments

        Activity

          People

            silvia.surroca@mongodb.com Silvia Surroca
            pierlauro.sciarelli@mongodb.com Pierlauro Sciarelli
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: