-
Type: Improvement
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Affects Version/s: 3.0.7
-
Component/s: Index Maintenance
-
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:
- A statement that it is going to build this index.
- 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:
- Write an additional statement at log level 0 indicating index build failure.
- Add an indication of build failure to the slowms log statement (addressed in 3.2.0-rc0).
- is duplicated by
-
SERVER-41945 Log CannotIndexParallelArrays failure at default log level
- Closed
- related to
-
SERVER-18971 Command log lines should include ok: 0 and errmsg:"..."
- Closed