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

mongod --repair and db.repairDatabase() fail due to a single bad document

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Critical - P2 Critical - P2
    • None
    • Affects Version/s: 2.6.11, 3.0.7
    • Component/s: Storage
    • Storage Execution
    • Fully Compatible
    • ALL

      When attempting repair a db that is valid except a single document with a bad BSON size field of 0, both mogod --repair and db.repairDatabase() fail to recover any data:

      2015-11-30T14:51:41.998-0500 I -        [initandlisten] Assertion: 10334:BSONObj size: 0 (0x0) is invalid. Size must be between 0 and 16793600(16MB) First element: EOO
      2015-11-30T14:51:42.003-0500 I CONTROL  [initandlisten] 
       0xf5e979 0xf07861 0xeebb6f 0xeebc1c 0x810b9f 0x8f7542 0x8f47bb 0xd5aef2 0xbf12d4 0x7e40f6 0x7e8db9 0x7f45cbcd2ec5 0x7e1a39
      ----- BEGIN BACKTRACE -----
      {"backtrace":[{"b":"400000","o":"B5E979"},{"b":"400000","o":"B07861"},{"b":"400000","o":"AEBB6F"},{"b":"400000","o":"AEBC1C"},{"b":"400000","o":"410B9F"},{"b":"400000","o":"4F7542"},{"b":"400000","o":"4F47BB"},{"b":"400000","o":"95AEF2"},{"b":"400000","o":"7F12D4"},{"b":"400000","o":"3E40F6"},{"b":"400000","o":"3E8DB9"},{"b":"7F45CBCB1000","o":"21EC5"},{"b":"400000","o":"3E1A39"}],"processInfo":{ "mongodbVersion" : "3.0.7", "gitVersion" : "6ce7cbe8c6b899552dadd907604559806aa2e9bd", "uname" : { "sysname" : "Linux", "release" : "3.13.0-32-generic", "version" : "#57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014", "machine" : "x86_64" }, "somap" : [ { "elfType" : 2, "b" : "400000" }, { "b" : "7FFF7D591000", "elfType" : 3 }, { "b" : "7F45CCCA2000", "path" : "/lib/x86_64-linux-gnu/libpthread.so.0", "elfType" : 3 }, { "b" : "7F45CCA9A000", "path" : "/lib/x86_64-linux-gnu/librt.so.1", "elfType" : 3 }, { "b" : "7F45CC896000", "path" : "/lib/x86_64-linux-gnu/libdl.so.2", "elfType" : 3 }, { "b" : "7F45CC592000", "path" : "/usr/lib/x86_64-linux-gnu/libstdc++.so.6", "elfType" : 3 }, { "b" : "7F45CC28C000", "path" : "/lib/x86_64-linux-gnu/libm.so.6", "elfType" : 3 }, { "b" : "7F45CC076000", "path" : "/lib/x86_64-linux-gnu/libgcc_s.so.1", "elfType" : 3 }, { "b" : "7F45CBCB1000", "path" : "/lib/x86_64-linux-gnu/libc.so.6", "elfType" : 3 }, { "b" : "7F45CCEC0000", "path" : "/lib64/ld-linux-x86-64.so.2", "elfType" : 3 } ] }}
       mongod(_ZN5mongo15printStackTraceERSo+0x29) [0xf5e979]
       mongod(_ZN5mongo10logContextEPKc+0xE1) [0xf07861]
       mongod(_ZN5mongo11msgassertedEiPKc+0xAF) [0xeebb6f]
       mongod(+0xAEBC1C) [0xeebc1c]
       mongod(_ZNK5mongo7BSONObj14_assertInvalidEv+0x3DF) [0x810b9f]
       mongod(_ZN5mongo10RecordData13releaseToBsonEv+0x52) [0x8f7542]
       mongod(_ZNK5mongo10Collection6docForEPNS_16OperationContextERKNS_8RecordIdE+0x2B) [0x8f47bb]
       mongod(_ZN5mongo12MMAPV1Engine14repairDatabaseEPNS_16OperationContextERKSsbb+0xF22) [0xd5aef2]
       mongod(_ZN5mongo14repairDatabaseEPNS_16OperationContextEPNS_13StorageEngineERKSsbb+0xEB4) [0xbf12d4]
       mongod(_ZN5mongo13initAndListenEi+0x8A6) [0x7e40f6]
       mongod(main+0x139) [0x7e8db9]
       libc.so.6(__libc_start_main+0xF5) [0x7f45cbcd2ec5]
       mongod(+0x3E1A39) [0x7e1a39]
      -----  END BACKTRACE  -----
      2015-11-30T14:51:42.082-0500 I STORAGE  [initandlisten] cleaning up failed repair db: cws_stats path: /hdd1/CS-25621/s-ds059461-a0/_tmp_repairDatabase_0
      2015-11-30T14:51:42.154-0500 I STORAGE  [initandlisten] exception in initAndListen: 10334 BSONObj size: 0 (0x0) is invalid. Size must be between 0 and 16793600(16MB) First element: EOO, terminating
      2015-11-30T14:51:42.154-0500 I CONTROL  [initandlisten] now exiting
      2015-11-30T14:51:42.154-0500 I NETWORK  [initandlisten] shutdown: going to close listening sockets...
      

            Assignee:
            backlog-server-execution [DO NOT USE] Backlog - Storage Execution Team
            Reporter:
            bruce.lucas@mongodb.com Bruce Lucas (Inactive)
            Votes:
            2 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved: