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

Fix hashing batch bounds for extra index keys check

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Replication
    • Fully Compatible
    • ALL
    • Repl 2024-02-05, Repl 2024-02-19, Repl 2024-03-04, Repl 2024-03-18

      I noticed this bug out of a separate issue in BF-31124. In this patch, the batch sizes logged are all 4, when they should be 99. From code inspection I think the error is from herehttps://github.com/10gen/mongo/blob/37501b2150baea9d055f1ab8477e06352eb12a85/src/mongo/db/commands/dbcheck_command.cpp#L1161 when we update batchStats.firstIndexKey = firstKeyString. However if there are multiple snapshots within a batch we end up doing this for each snapshot, so the firstIndexKey ends up getting updated to be the first index key of the last snapshot in the batch. This is a problem because when we hash the keys we'll then only hash the last snapshot. We should fix this by updating the first of the batch vs the first of the snapshot separately.

      We should also change this log line to instead say "started extra index keys snapshot"

      To catch this bug we should add a complete coverage test similar to the one that exists for collection check here for extra index keys as well

            Assignee:
            xuerui.fa@mongodb.com Xuerui Fa
            Reporter:
            huayu.ouyang@mongodb.com Huayu Ouyang
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: