[SERVER-57786] include collection UUID and redacted documents in validation report Created: 17/Jun/21  Updated: 29/Oct/23  Resolved: 24/Aug/22

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

Type: Improvement Priority: Major - P3
Reporter: Benety Goh Assignee: Yuhong Zhang
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-57775 collection metadata for multikey not ... Closed
Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2022-09-05
Participants:
Linked BF Score: 127

 Description   

When the validate command fails, it reports the namespace of the affect collection and the record ID of documents that are inconsistent with the current observed state. It would be useful to include additional information in this report such as:

  • collection UUID
  • redacted BSON documents corresponding to RecordId's in the errors.
    • If a redacted document is not suitable for security reasons, having the _id field value would be a helpful alternative.

Here is a sample report for a failed validation:

assert: command failed: {
"ok" : 0,
"host" : "localhost:20000",
"validateRes" : {
"ok" : 0,
"failed_res" : [
{
"ns" : "test.foo",
"nInvalidDocuments" : 0,
"nrecords" : 3,
"nIndexes" : 2,
"keysPerIndex" : {
"_id_" : 3,
"-0.00" : 3
},
"indexDetails" : {
"_id_" : {
"valid" : true,
"warnings" : [
"Could not complete validation of table:index-336-2866975066552635536. This is a transient issue as the collection was actively in use by other operations."
]
},
"-0.00" : {
"valid" : false,
"warnings" : [
"Could not complete validation of table:index-337-2866975066552635536. This is a transient issue as the collection was actively in use by other operations."
],
"errors" : [
"Index -0.00 is not multikey but has more than one key in document RecordId(4)"
]
}
},
"valid" : false,
"repaired" : false,
"warnings" : [
"Could not complete validation of table:collection-335-2866975066552635536. This is a transient issue as the collection was actively in use by other operations.",
"Could not complete validation of table:index-336-2866975066552635536. This is a transient issue as the collection was actively in use by other operations.",
"Could not complete validation of table:index-337-2866975066552635536. This is a transient issue as the collection was actively in use by other operations."
],
"errors" : [
"Index -0.00 is not multikey but has more than one key in document RecordId(4)"
],
"extraIndexEntries" : [ ],
"missingIndexEntries" : [ ],
"corruptRecords" : [ ],
"advice" : "A corrupt namespace has been detected. See http://dochub.mongodb.org/core/data-recovery for recovery steps.",
"ok" : 1,
"$clusterTime" : {
"clusterTime" : Timestamp(1622859595, 1),
"signature" : {



 Comments   
Comment by Yuhong Zhang [ 24/Aug/22 ]

Author:

{'name': 'Yuhong Zhang', 'email': 'yuhong.zhang@mongodb.com', 'username': 'YuhongZhang98'}

Message: SERVER-57786 Include _id along with the recordId for multikey errors in validation report

Branch: master
https://github.com/mongodb/mongo/commit/65bef341dc5b3ea7dab8cbf4ff17b5d2e4d81ca1

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