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

Validation on secondaries can set fast count to an incorrect value

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • RSS Sydney
    • ALL
    • SleighTheDay - 2024-12-24
    • 0
    • None
    • 0
    • None
    • None
    • None
    • None
    • None
    • None

      When we perform validation on a secondary node, we set its readTimestamp to be last applied. kLastApplied can lag behind for secondaries.

      Then, because we do not enforce fast count for secondaries, we always enter this block where we adjust the fast count to be the count of numRecords that we see at our read timestamp (which can have lagged).

      From this patch, we see an example of this in play:

      We have a collection with a single document. Then we delete that document , which sets our numRecords, and fastCount, to 0.

      However, when we go to perform validation we read at a stale timestamp and see the number of records to be 1. So we then we adjust the fast count to be 1.

      Then, when we resume performing operations on this collection, the fastCount is permanently one higher than it should be.

      The related BFs only caught this error in multiversion suites because on 8.0 binaries we do enforce fast count on secondaries, but on master we do not.

            Assignee:
            aaron.balsara@mongodb.com Aaron Balsara
            Reporter:
            damian.wasilewicz@mongodb.com Damian Wasilewicz
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: