[SERVER-50088] Avoid reporting duplicate multikey errors when there are index inconsistencies Created: 03/Aug/20  Updated: 29/Oct/23  Resolved: 07/Aug/20

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

Type: Improvement Priority: Major - P3
Reporter: Shin Yee Tan Assignee: Fausto Leyva (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2020-08-10, Execution Team 2020-08-24
Participants:

 Description   

When there are multikey errors and index inconsistencies, traverseRecordStore is called in the second phase of validation which ends up calling validateRecord a second time. In validateRecord, multikey checks will perform again which duplicates work in the first phase of validation.

Side effect of this is that when validate is called without repair mode and there is an index with missing multikey documents, the same error appears twice.
ie. "errors":["Index non_mk_index is not multikey but has more than one key in document RecordId(1)","Index non_mk_index is not multikey but has more than one key in document RecordId(1)"]

This behavior is strange because in the second phase of validation when traverseRecordStore is called, it is passed a tempValidateResults and thus the error should not be appended to the final validateResults.



 Comments   
Comment by Githook User [ 07/Aug/20 ]

Author:

{'name': 'Faustoleyva54', 'email': 'fausto.leyva@mongodb.com', 'username': 'Faustoleyva54'}

Message: SERVER-50088 Avoid reporting duplicate multikey errors when there are index inconsistencies
Branch: master
https://github.com/mongodb/mongo/commit/84c91c713332bf8e9a2c4d8e402dd4a58340294c

Comment by Fausto Leyva (Inactive) [ 07/Aug/20 ]

https://mongodbcr.appspot.com/619580002/

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