[SERVER-20940] Should log createIndexes failure at level 0 Created: 15/Oct/15  Updated: 06/Dec/22  Resolved: 19/Feb/19

Status: Closed
Project: Core Server
Component/s: Index Maintenance
Affects Version/s: 3.0.7
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: James Wahlin Assignee: Backlog - Storage Execution Team
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-41945 Log CannotIndexParallelArrays failure... Closed
Related
related to SERVER-18971 Command log lines should include ok: ... Closed
Assigned Teams:
Storage Execution
Participants:

 Description   

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).


 Comments   
Comment by Eric Milkie [ 19/Feb/19 ]

The previously mentioned SERVER ticket to log success/failure messages as part of the slow-operation log lines should be sufficient here.

Comment by Eric Milkie [ 27/Oct/16 ]

I think SERVER-18971 should be sufficient to get what we need here – since index builds for collections with data frequently take longer than the slowms threshold anyway.

Generated at Thu Feb 08 03:55:45 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.