Mongorestore --bypassDocumentValidation does not bypass document validation during oplog restore

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 100.15.0
    • Affects Version/s: None
    • Component/s: None
    • 3
    • Tools and Replicator
    • 1
    • Not Needed

      Problem Statement/Rationale

      Mongorestore has the CLI option --bypassDocumentValidation. This CLI option currently only applies to the bulkWriter, but applying oplogs can still fail with document validation error, which is shown as an UnknownError from applyOps:

      Failed: restore error: error applying oplog: applyOps: (UnknownError) applyOps had one or more errors applying ops
      

      Steps to Reproduce

      1. Set up a source collection with validator and insert "invalid" documents to that collection bypassing validation.
      2. Run mongodump to dump the oplogs.
      3. Run mongorestore with the CLI option to bypassDocumentValidation.

      Expected Results

      Mongorestore with bypassDocumentValidation should succeed restoring the oplogs.

      Actual Results

      Mongorestore fails with an UnknownError when applying the oplogs.

      Additional Notes

      Found by the passthrough test failure (link).

            Assignee:
            Jian Guan
            Reporter:
            Jian Guan
            Michael McClimon
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: