[SERVER-78452] Implement missing index key check in dbCheck Created: 26/Jun/23  Updated: 01/Nov/23  Resolved: 21/Sep/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.2.0-rc0

Type: Task Priority: Major - P3
Reporter: Xuerui Fa Assignee: Xuerui Fa
Resolution: Fixed Votes: 0
Labels: pm-855-milestone-2
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-81117 Determine if missing key check should... Closed
Problem/Incident
Backwards Compatibility: Fully Compatible
Sprint: Repl 2023-07-24, Repl 2023-08-07, Repl 2023-08-21, Repl 2023-09-04, Repl 2023-09-18, Repl 2023-10-02
Participants:
Linked BF Score: 14

 Description   

The DbCheckHasher class today implements the hashing logic for the data consistency check in dbCheck. Since it already has access to each document by walking the _id index, we will implement the missing index keys check within the DbCheckHasher.

The algorithm for the missing index keys check will be:
*Primary iterates through record store at a given start point until it hits a batch boundary (total number of bytes/records limitation hit)
For each record traversed in batch and for each index that we are checking:

  • Fetch all index key entries corresponding to its index field values and record ID
  • Look up each of those index keys in the index table
  • If we do not find the index key entry, report the inconsistency to the health log
  • We will also verify that the document complies with index settings (for example, it does not have multiple index keys if the index is not multikey)
  • Add the size of the document and index keys to the total count of bytes. If we have exceeded a speed parameter, complete the batch and return

Secondaries will determine batch boundaries from an oplog entry that primary writes
This is currently already done by the DbCheckHasher



 Comments   
Comment by Githook User [ 21/Sep/23 ]

Author:

{'name': 'XueruiFa', 'email': 'xuerui.fa@mongodb.com', 'username': 'XueruiFa'}

Message: SERVER-78452: Implement missing key check in dbCheck
Branch: master
https://github.com/mongodb/mongo/commit/297c1abedbcec2ca416394244f09a8bfd8e4348c

Generated at Thu Feb 08 06:38:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.