|
milkie
So the question is also around the log. I do see your point and would expect to see all the currentOp() results waiting for the one to complete, but these logs make it appear that all the indexes are building, unless I am mistaken:
grep indexName mongod.log | grep 'createIndexes: "indexName"' | sort -k 6 | grep BEAGLE819 | grep 'name: "isSynced"'
|
2017-04-30T10:13:03.891+0000 I COMMAND [conn711892] command BEAGLE819_REPORTING.$cmd command: createIndexes { createIndexes: "indexName", indexes: [ { name: "isSynced", ns: "BEAGLE819_REPORTING.indexName", key: { isSynced: 1 } } ] } keyUpdates:0 writeConflicts:0 numYields:0 reslen:149 locks:{ Global: { acquireCount: { r: 1, w: 1 } }, Database: { acquireCount: { W: 1 } } } protocol:op_query 210ms
|
2017-04-30T10:11:09.731+0000 I COMMAND [conn710502] command BEAGLE819_REPORTING.$cmd command: createIndexes { createIndexes: "indexName", indexes: [ { name: "isSynced", ns: "BEAGLE819_REPORTING.indexName", key: { isSynced: 1 } } ] } keyUpdates:0 writeConflicts:0 numYields:0 reslen:149 locks:{ Global: { acquireCount: { r: 1, w: 1 } }, Database: { acquireCount: { W: 1 } } } protocol:op_query 39963ms
|
2017-04-30T10:13:03.517+0000 I COMMAND [conn711502] command BEAGLE819_REPORTING.$cmd command: createIndexes { createIndexes: "indexName", indexes: [ { name: "isSynced", ns: "BEAGLE819_REPORTING.indexName", key: { isSynced: 1 } } ] } keyUpdates:0 writeConflicts:0 numYields:0 reslen:149 locks:{ Global: { acquireCount: { r: 1, w: 1 } }, Database: { acquireCount: { W: 1 } } } protocol:op_query 43936ms
|
2017-04-30T10:11:16.559+0000 I COMMAND [conn710407] command BEAGLE819_REPORTING.$cmd command: createIndexes { createIndexes: "indexName", indexes: [ { name: "isSynced", ns: "BEAGLE819_REPORTING.indexName", key: { isSynced: 1 } } ] } keyUpdates:0 writeConflicts:0 numYields:0 reslen:149 locks:{ Global: { acquireCount: { r: 1, w: 1 } }, Database: { acquireCount: { W: 1 }, acquireWaitCount: { W: 1 }, timeAcquiringMicros: { W: 8947 } } } protocol:op_query 4210ms
|
|
|
A foreground index build exclusively locks the database for the duration of the build. If you issue other operations during that time, they will queue up but take no action until the foreground index build finishes and releases its lock. This is true for any operations in the database in question, including foreground index builds. All these operations will show up in currentOp() as "running", but they aren't doing anything except waiting for a database lock.
I would expect that after the foreground index build finishes, the other index builds would then complete immediately. If they do not complete immediately, that would be a bug. Is that what you are seeing here?
|