The documentation (http://docs.mongodb.org/manual/tutorial/manage-in-progress-indexing-operations/) currently describes cancellation of index creation very simply - use killOp(). However, if one has just created an index in the foreground on a large index, it could have taken down services. The panicked engineer is probably looking for a reliable way to cancel that operation. If there's a large list of ongoing operations, it may be difficult to quickly filter out the correct operation.
The documentation should provide a routine for filtering the current operations to help hone in on the index-creation operation.
I recently accomplished the filtering by looping over the docs and filtering on type != "query" and that returned a sufficiently small result that I was able to identify the relevant Op. I discovered later that the type of the index creation is a "insert", so it would have been even more precise to use that type, though in a system with a lot of inserts, even that wouldn't effectively downselect the currentOps.
I suggest developing a reliable recipe for identifying any index creation operation (or operations) and printing those and then to include that recipe in the aforementioned docs for managing indexes.
- is related to
-
DOCS-3884 Add a note to the index build page mentioning SERVER-14758
- Closed
- related to
-
SERVER-14758 killOp on foreground index build does not take effect until the end of the index build
- Closed