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

Better error log explanation if server notices data file corruption

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Trivial - P5 Trivial - P5
    • None
    • Affects Version/s: None
    • Component/s: Storage
    • None
    • Storage Execution

      Mongod will print Assertion errors to the logs if it encounters invalid or corrupted data within the data files. These log messages should be enhanced so that they will clearly explain that the engine found corrupted data from the data files. Also, if possible, the engine should also tell the name of the data file where the corrupted data was found.

      Examples, current log entry:
      Tue Feb 12 06:57:53 [repl prefetch worker] Assertion: 10334:Invalid BSONObj size: -286331154 (0xEEEEEEEE) first element: _id:

      { date: new Date(1360648800000), appid: "181", ab: "12" }

      0xb07561 0xacd449 0xacd5cc 0x5721e8 0x719605 0x8c6e4b 0x8c7805 0x9aaf6a 0xadab5d 0xb4d3d9 0x2abbb6e1577d 0x2abbb7a98c1d
      /usr/bin/mongod(_ZN5mongo15printStackTraceERSo+0x21) [0xb07561]
      /usr/bin/mongod(_ZN5mongo11msgassertedEiPKc+0x99) [0xacd449]
      /usr/bin/mongod [0xacd5cc]
      /usr/bin/mongod(_ZNK5mongo7BSONObj14_assertInvalidEv+0x468) [0x5721e8]
      /usr/bin/mongod(ZN5mongo7Helpers8findByIdERNS_6ClientEPKcNS_7BSONObjERS5_PbS7+0xe05) [0x719605]
      /usr/bin/mongod(_ZN5mongo19prefetchRecordPagesEPKcRKNS_7BSONObjE+0x2fb) [0x8c6e4b]
      /usr/bin/mongod(_ZN5mongo28prefetchPagesForReplicatedOpERKNS_7BSONObjE+0x415) [0x8c7805]
      /usr/bin/mongod(_ZN5mongo7replset8SyncTail10prefetchOpERKNS_7BSONObjE+0x13a) [0x9aaf6a]
      /usr/bin/mongod(_ZN5mongo10threadpool6Worker4loopEv+0x26d) [0xadab5d]
      /usr/bin/mongod [0xb4d3d9]
      /lib64/libpthread.so.0 [0x2abbb6e1577d]
      /lib64/libc.so.6(clone+0x6d) [0x2abbb7a98c1d]

      Example what the message could look to give more information:
      Tue Feb 12 06:57:53 [repl prefetch worker] Assertion, engine found invalid data from data file 'dbname.06', related to collection 'mycollectionname'. Possible data file corruption: 10334:Invalid BSONObj size: -286331154 (0xEEEEEEEE) first element: _id:

      { date: new Date(1360648800000), appid: "181", ab: "12" }

            Assignee:
            backlog-server-execution [DO NOT USE] Backlog - Storage Execution Team
            Reporter:
            garo Juho Mäkinen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: