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

Collections are not registered in UUIDCatalog when repairDatabase command fails with MMAPv1 storage engine

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: MMAPv1, Storage
    • None
    • Storage Execution
    • ALL
    • Hide
      python buildscripts/resmoke.py repro_server30930.js --storageEngine=mmapv1
      
      repro_server30930.js
      (function() {
          "use strict";
      
          assert.commandWorked(db.runCommand({dropDatabase: 1}));
          assert.writeOK(db.NaN.insert({_id: 3, a: []}));
      
          assert.commandWorked(db.adminCommand({setParameter: 1, failIndexKeyTooLong: false}));
          assert.writeOK(db.jstests_json_schema.insert({_id: "x".repeat(1012)}));
          assert.commandWorked(db.adminCommand({setParameter: 1, failIndexKeyTooLong: true}));
      
          // The "repairDatabase" command is expected to fail because the document in the
          // 'jstests_json_schema' collection generates an index key for the _id field that's 1024 bytes.
          assert.commandFailed(db.runCommand({repairDatabase: 1}));
      
          assert.commandWorked(db.runCommand({collMod: "NaN", usePowerOf2Sizes: true}));
      })();
      
      Show
      python buildscripts/resmoke.py repro_server30930.js --storageEngine=mmapv1 repro_server30930.js ( function () { "use strict" ; assert.commandWorked(db.runCommand({dropDatabase: 1})); assert.writeOK(db.NaN.insert({_id: 3, a: []})); assert.commandWorked(db.adminCommand({setParameter: 1, failIndexKeyTooLong: false })); assert.writeOK(db.jstests_json_schema.insert({_id: "x" .repeat(1012)})); assert.commandWorked(db.adminCommand({setParameter: 1, failIndexKeyTooLong: true })); // The "repairDatabase" command is expected to fail because the document in the // 'jstests_json_schema' collection generates an index key for the _id field that's 1024 bytes. assert.commandFailed(db.runCommand({repairDatabase: 1})); assert.commandWorked(db.runCommand({collMod: "NaN" , usePowerOf2Sizes: true })); })();
    • 23

      This issue does not affect the WiredTiger or InMemory storage engines.

      [MongoDFixture:job0] 2017-09-01T18:40:04.993-0400 I INDEX    [conn5] Btree::insert: key too large to index, failing test.jstests_json_schema.$_id_ 1025 { : "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..." }
      [MongoDFixture:job0] 2017-09-01T18:40:04.993-0400 D STORAGE  [conn5]    ***** NOT ROLLING BACK 0 disk writes
      [MongoDFixture:job0] 2017-09-01T18:40:04.993-0400 D STORAGE  [conn5]    ***** ROLLING BACK 0 custom changes
      [MongoDFixture:job0] 2017-09-01T18:40:04.993-0400 D STORAGE  [conn5] test.jstests_json_schema: clearing plan cache - collection info cache reset
      [MongoDFixture:job0] 2017-09-01T18:40:04.996-0400 I JOURNAL  [conn5] journalCleanup...
      [MongoDFixture:job0] 2017-09-01T18:40:04.996-0400 I JOURNAL  [conn5] removeJournalFiles
      [MongoDFixture:job0] 2017-09-01T18:40:04.996-0400 I JOURNAL  [conn5] old journal file will be removed: /data/db/job0/resmoke/journal/j._1
      [MongoDFixture:job0] 2017-09-01T18:40:04.996-0400 D STORAGE  [conn5] flushing directory /data/db/job0/resmoke/journal
      [MongoDFixture:job0] 2017-09-01T18:40:04.997-0400 D JOURNAL  [conn5] removeJournalFiles end
      [MongoDFixture:job0] 2017-09-01T18:40:04.997-0400 D STORAGE  [conn5] unregistering collection test.jstests_json_schema with UUID d5ce4ae9-f2a4-4a77-84f7-ccb3289971fa
      [MongoDFixture:job0] 2017-09-01T18:40:04.997-0400 D STORAGE  [conn5] unregistering collection test.NaN with UUID 25d7ed66-c5fd-4cdf-8714-98c3d23d96ab
      [MongoDFixture:job0] 2017-09-01T18:40:04.998-0400 D STORAGE  [conn5] NamespaceUUIDCache: evicted namespace test.jstests_json_schema
      [MongoDFixture:job0] 2017-09-01T18:40:04.998-0400 D STORAGE  [conn5] destructed collection test.jstests_json_schema with UUID d5ce4ae9-f2a4-4a77-84f7-ccb3289971fa
      [MongoDFixture:job0] 2017-09-01T18:40:04.998-0400 D STORAGE  [conn5] NamespaceUUIDCache: evicted namespace test.NaN
      [MongoDFixture:job0] 2017-09-01T18:40:04.998-0400 D STORAGE  [conn5] destructed collection test.NaN with UUID 25d7ed66-c5fd-4cdf-8714-98c3d23d96ab
      [MongoDFixture:job0] 2017-09-01T18:40:04.998-0400 I STORAGE  [conn5] cleaning up failed repair db: test path: /data/db/job0/resmoke/_tmp_repairDatabase_0
      [MongoDFixture:job0] 2017-09-01T18:40:04.999-0400 I JOURNAL  [conn5] journalCleanup...
      [MongoDFixture:job0] 2017-09-01T18:40:04.999-0400 I JOURNAL  [conn5] removeJournalFiles
      [MongoDFixture:job0] 2017-09-01T18:40:04.999-0400 D STORAGE  [conn5] flushing directory /data/db/job0/resmoke/journal
      [MongoDFixture:job0] 2017-09-01T18:40:04.999-0400 D JOURNAL  [conn5] removeJournalFiles end
      [MongoDFixture:job0] 2017-09-01T18:40:05.003-0400 I COMMAND  [conn5] command test.jstests_json_schema appName: "MongoDB Shell" command: repairDatabase { repairDatabase: 1.0, $db: "test" } numYields:0 reslen:314 locks:{ Global: { acquireCount: { r: 1, W: 1 } }, MMAPV1Journal: { acquireCount: { w: 20 }, acquireWaitCount: { w: 1 }, timeAcquiringMicros: { w: 7375 } }, Metadata: { acquireCount: { W: 7 } }, Mutex: { acquireCount: { r: 6, W: 6 } } } protocol:op_msg 108ms
      [MongoDFixture:job0] 2017-09-01T18:40:05.003-0400 D STORAGE  [conn5] NamespaceUUIDCache: registered namespace test.NaN with UUID 25d7ed66-c5fd-4cdf-8714-98c3d23d96ab
      [MongoDFixture:job0] 2017-09-01T18:40:05.004-0400 F -        [conn5] Invariant failure catalogColl && catalogColl->uuid() == uuid src/mongo/db/op_observer_impl.cpp 334
      [MongoDFixture:job0] 2017-09-01T18:40:05.004-0400 F -        [conn5]
      [MongoDFixture:job0]
      [MongoDFixture:job0] ***aborting after invariant() failure
      

            Assignee:
            backlog-server-execution [DO NOT USE] Backlog - Storage Execution Team
            Reporter:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: