Operational Defect Database

BugZero found this defect 128 days ago.

MongoDB | 2544855

Fix hashing batch bounds for extra index keys check

Last update date:

3/13/2024

Affected products:

MongoDB Server

Affected releases:

No affected releases provided.

Fixed releases:

8.0.0-rc0

Description:

Info

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

Top User Comments

xgen-internal-githook commented on Tue, 12 Mar 2024 03:52:58 +0000: Author: {'name': 'XueruiFa', 'email': 'xuerui.fa@mongodb.com', 'username': 'XueruiFa'} Message: SERVER-85200: Fix hashing batch bounds for extra index keys check GitOrigin-RevId: 71b59d6fd8c4918931da5980de1ea5ea7264488a Branch: master https://github.com/mongodb/mongo/commit/4716ab6084a69acc7558360cafa806325471404e

Steps to Reproduce


Additional Resources / Links

Share:

BugZero® Risk Score

What's this?

Coming soon

Status

Closed

Learn More

Search:

...