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

Should log createIndexes failure at level 0

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.0.7
    • Component/s: Index Maintenance
    • Labels:
      None
    • Storage Execution

      Attempt to build a unique index for a collection with duplicated entries on the given field:

      replset:PRIMARY> db.test.createIndex({a: 1}, {unique: true, background: true});
      {
      	"createdCollectionAutomatically" : false,
      	"numIndexesBefore" : 1,
      	"errmsg" : "exception: E11000 duplicate key error index: test.test.$a_1 dup key: { : 0.0 }",
      	"code" : 11000,
      	"ok" : 0
      }
      

      The mongoD log will write at log level 0:

      1. A statement that it is going to build this index.
      2. A slowms statement if the slowms threshold is breached.

      Missing here is an indication that the index build failed:

      2015-10-15T12:39:07.515-0400 I INDEX    [conn13] build index on: test.test properties: { v: 1, unique: true, key: { a: 1.0 }, name: "a_1", ns: "test.test", background: true }
      2015-10-15T12:39:07.699-0400 I COMMAND  [conn13] command test.$cmd command: createIndexes { createIndexes: "test", indexes: [ { key: { a: 1.0 }, name: "a_1", unique: true, background: true } ] } keyUpdates:0 writeConflicts:0 numYields:390 reslen:193 locks:{ Global: { acquireCount: { r: 391, w: 391 } }, MMAPV1Journal: { acquireCount: { w: 50394 }, acquireWaitCount: { w: 2 }, timeAcquiringMicros: { w: 20990 } }, Database: { acquireCount: { w: 391, W: 2 } }, Collection: { acquireCount: { W: 391 } }, Metadata: { acquireCount: { W: 4 } } } 184ms
      

      We should:

      1. Write an additional statement at log level 0 indicating index build failure.
      2. Add an indication of build failure to the slowms log statement (addressed in 3.2.0-rc0).

            Assignee:
            backlog-server-execution [DO NOT USE] Backlog - Storage Execution Team
            Reporter:
            james.wahlin@mongodb.com James Wahlin
            Votes:
            0 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved: