[SERVER-43711] ValidateAdaptor::validateIndexKeyCount should not compare in-memory and persisted checkpoint _id index entry counts Created: 30/Sep/19  Updated: 29/Oct/23  Resolved: 04/Oct/19

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 4.3.1

Type: Bug Priority: Major - P3
Reporter: Dianna Hohensee (Inactive) Assignee: Dianna Hohensee (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-42358 Add background collection validation ... Closed
Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2019-10-07
Participants:

 Description   

ValidateAdaptor::validateIndexKeyCount is called during collection validation here and we pass in the Collection's RecordStore's numRecords() return value that is an in-memory counter. This is then compared against validation's IndexConsistency's recorded number of traversed index entries (numTotalKeys) here. IndexConsistency builds this entry count from prior validation work in ValidateAdaptor::traverseIndex, where we iterate a cursor and maintain a count of entries in the IndexConsistency object.

For background validation, that cursor will be a checkpoint cursor, and then we will compare it against the in-memory Collection's count, which is wrong.



 Comments   
Comment by Githook User [ 04/Oct/19 ]

Author:

{'name': 'Dianna Hohensee', 'username': 'DiannaHohensee', 'email': 'dianna.hohensee@mongodb.com'}

Message: SERVER-43711 ValidateAdaptor::validateIndexKeyCount should not compare in-memory and PIT _id index entry counts
Branch: master
https://github.com/mongodb/mongo/commit/20a03a3b3c96f54c5ec94a0eac8dcef768e39f43

Comment by Dianna Hohensee (Inactive) [ 30/Sep/19 ]

Actually, we traverse the collection table in order to validate its contents, so I think we could save that value in the validation state to later use to compare against the index counts, instead of fetching the in-memory count that won't work for background:true. I'll try that solution, rather than skipping that validation step for background validation.

Generated at Thu Feb 08 05:03:54 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.