Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-57786

include collection UUID and redacted documents in validation report

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • Execution Team 2022-09-05
    • 127

      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" : {
      

            Assignee:
            yuhong.zhang@mongodb.com Yuhong Zhang
            Reporter:
            benety.goh@mongodb.com Benety Goh
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: