Calling numRecords while building an index on a secondary will attempt to change read source

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage Execution
    • Fully Compatible
    • ALL
    • Storage Execution 2026-04-27
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      While performing an index build, we perform a write acquisition on the collection we are building, but then also try to get the number of documents in that collection so that we can track our progress.

      Once the read path for the replicated fast count project is fully integrated, that means that calls like this will attempt to read from a replicated collection. When a simultaneous index build is running and building on a secondary, reading from a replicated collection will try to use kLastApplied to respect batch boundaries. However, the earlier write acquisition will have set the readSource of the recoveryUnit to use kNoTimestamp.

      As of SERVER-101416, we guard against this behavior (nested acquisition trying to read from kLastApplied while recovery unit already has kNoTimestamp set) with a tassert.

      However, because we are tracking index build progress here, it should be acceptable to continue reading from latest and get potentially mid-batch results. We can explicitly indicate that we are knowingly reading from latest on a replicated collection on a secondary and bypass the guard in these particular cases.

            Assignee:
            Damian Wasilewicz
            Reporter:
            Damian Wasilewicz
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: