[SERVER-43863] Validate cmd results have an indexDetails section that should not mark unverified indexes as valid:true in background validation Created: 07/Oct/19  Updated: 29/Oct/23  Resolved: 15/Oct/19

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

Type: Task Priority: Major - P3
Reporter: Dianna Hohensee (Inactive) Assignee: Gregory Wlodarek
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 2019-10-07, Execution Team 2019-10-21
Participants:

 Description   

This is what regular validate cmd looks like with background:false

[js_test:index_partial_create_drop] 2019-10-07T07:22:10.865-0400 [jsTest] ----
[js_test:index_partial_create_drop] 2019-10-07T07:22:10.866-0400 [jsTest] ~~~validate res: {
[js_test:index_partial_create_drop] 2019-10-07T07:22:10.866-0400 [jsTest] 	"nInvalidDocuments" : 0,
[js_test:index_partial_create_drop] 2019-10-07T07:22:10.866-0400 [jsTest] 	"nrecords" : 10,
[js_test:index_partial_create_drop] 2019-10-07T07:22:10.866-0400 [jsTest] 	"nIndexes" : 2,
[js_test:index_partial_create_drop] 2019-10-07T07:22:10.866-0400 [jsTest] 	"keysPerIndex" : {
[js_test:index_partial_create_drop] 2019-10-07T07:22:10.866-0400 [jsTest] 		"_id_" : 10,
[js_test:index_partial_create_drop] 2019-10-07T07:22:10.866-0400 [jsTest] 		"x_1" : 10
[js_test:index_partial_create_drop] 2019-10-07T07:22:10.866-0400 [jsTest] 	},
[js_test:index_partial_create_drop] 2019-10-07T07:22:10.866-0400 [jsTest] 	"indexDetails" : {
[js_test:index_partial_create_drop] 2019-10-07T07:22:10.866-0400 [jsTest] 		"_id_" : {
[js_test:index_partial_create_drop] 2019-10-07T07:22:10.867-0400 [jsTest] 			"valid" : true
[js_test:index_partial_create_drop] 2019-10-07T07:22:10.867-0400 [jsTest] 		},
[js_test:index_partial_create_drop] 2019-10-07T07:22:10.867-0400 [jsTest] 		"x_1" : {
[js_test:index_partial_create_drop] 2019-10-07T07:22:10.867-0400 [jsTest] 			"valid" : true
[js_test:index_partial_create_drop] 2019-10-07T07:22:10.867-0400 [jsTest] 		}
[js_test:index_partial_create_drop] 2019-10-07T07:22:10.867-0400 [jsTest] 	},
[js_test:index_partial_create_drop] 2019-10-07T07:22:10.867-0400 [jsTest] 	"ns" : "test.index_partial_create_drop",
[js_test:index_partial_create_drop] 2019-10-07T07:22:10.867-0400 [jsTest] 	"valid" : true,
[js_test:index_partial_create_drop] 2019-10-07T07:22:10.867-0400 [jsTest] 	"warnings" : [ ],
[js_test:index_partial_create_drop] 2019-10-07T07:22:10.867-0400 [jsTest] 	"errors" : [ ],
[js_test:index_partial_create_drop] 2019-10-07T07:22:10.867-0400 [jsTest] 	"extraIndexEntries" : [ ],
[js_test:index_partial_create_drop] 2019-10-07T07:22:10.868-0400 [jsTest] 	"missingIndexEntries" : [ ],
[js_test:index_partial_create_drop] 2019-10-07T07:22:10.868-0400 [jsTest] 	"ok" : 1
[js_test:index_partial_create_drop] 2019-10-07T07:22:10.868-0400 [jsTest] }
[js_test:index_partial_create_drop] 2019-10-07T07:22:10.868-0400 [jsTest] ----

Validate with background:true can look just the same except sometimes it'll skip indexes, so 'keysPerIndex' won't have an index, but then 'indexDetails' still has the index with valid:true in it.

We populate the 'indexDetails' section here based on a map of indexes that we instantiate in the latest time prior to looking at a checkpoint'ed data view.

Maybe eliminate the entry in the ValidateResultsMap during ValidateState's initializeCursors when the final set of indexes are chosen?



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

Author:

{'username': 'GWlodarek', 'email': 'gregory.wlodarek@mongodb.com', 'name': 'Gregory Wlodarek'}

Message: SERVER-43863 Validate cmd should use the validated indexes to populate the 'indexDetails' section
Branch: master
https://github.com/mongodb/mongo/commit/bb186295aa5331f69e197ec4068d7b1f6fcda12e

Comment by Gregory Wlodarek [ 07/Oct/19 ]

Note that this isn't possible today as indexDetails only gets appended to the output when {full: true} which is an incompatible mode with {background: true}. However, we'll still do the work to future-proof this.

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