Add a sizeStorer call to the onRollback handler for dataSize and numRecords changes

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 7.0.0-rc0, 6.0.6, 6.3.1, 5.0.22, 4.4.26
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • v5.0, v4.4
    • Execution Team 2023-03-06
    • 4
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      Finally got to the bottom of this issue. Henrik spotted it.

      There's a call to the sizeStorer to tell it that the collection is dirty and must be flushed. The new code doesn't call the flush in onRollback, resulting in exactly what we're seeing where the numRecords is 1 greater than the actual documents. The old code would run the sizeStorer call in the onRollback handler in a very fragile non-obvious manner, via a recursive call into the _increaseDataSize function with a opCtx==nullptr. Additionally, the old _changeNumRecords() function didn't call into the sizeStorer, so the code was entirely dependent on the order of calling first _changeNumRecords() immediately followed by _increaseDataSize().

            Assignee:
            Yujin Kang Park
            Reporter:
            Dianna Hohensee (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: