Fix dataSize can be negative and incorrect on rollback

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 6.2.0-rc0, 6.0.5, 6.0.6, 5.0.22, 4.4.26
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • v6.3, v6.0, v5.0, v4.4
    • Execution Team 2022-11-14
    • 4
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      if (_sizeInfo->dataSize.fetchAndAdd(amount) < 0)
      _sizeInfo->dataSize.store(std::max(amount, int64_t(0))); 

      Value is checked before adding, and clamping is done only if the previous value was negative, so the value can still be negative.

      Additionally, similar to SERVER-63585 with fast count, data size can be incorrect after a rollback due to a race. We should allow dataSize to be negative internally and clamp only in the getter.

            Assignee:
            Yujin Kang Park
            Reporter:
            Yujin Kang Park
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: