Uploaded image for project: 'MongoDB ETL Tools'
  1. MongoDB ETL Tools
  2. TOOLS-122

mongorestore object check should print error

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Works as Designed
    • Affects Version/s: Legacy C++ Implementation
    • Fix Version/s: 3.0.0
    • Component/s: mongorestore
    • Labels:

      Description

      When mongorestore is run with object check (default in 2.4) it performs the check as follows:

       if ( _objcheck && ! o.valid() ) {

      The problem here is that o.valid() is implemented as follows and consumes the Status object returned by validateBSON

      bool BSONObj::valid() const {
          return validateBSON( objdata(), objsize() ).isOK();
      }

      mongorestore should instead call validateBSON directly and if Status.isOK() is false print Status.code() & Status.codeString() to help in pinpointing BSON corruption.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kyle.erf Kyle Erf
                Reporter:
                james.wahlin James Wahlin
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: