Fix concurrency bug in OplogStones

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 6.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Storage Execution
    • Fully Compatible
    • ALL
    • Execution Team 2023-02-06
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      If a truncate of the oplog occurs (
      WiredTigerRecordStore::OplogStones::clearStonesOnCommit), it first: * Sets the number of current records and bytes for the new OplogStone to 0

      • Acquires the modification mutex
      • Clears the stones list

      Modifying the first two variable outside of the lock could potentially lead to an invalid state since other OplogStones modifications first take the mutex then perform the other modifications.

      We should protect the first two variables under the mutex to avoid potential invalid states. The attached patch fixes this.

        1. diff.patch
          0.8 kB
          Jordi Olivares Provencio

            Assignee:
            Jordi Olivares Provencio
            Reporter:
            Jordi Olivares Provencio
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: