Details
-
Bug
-
Resolution: Unresolved
-
Major - P3
-
None
-
7.0.6, 5.0.25, 4.4.29, 6.0.14
-
None
-
Storage Execution
-
ALL
-
Description
After 4.4 version, index creation is done in the background, and is Simultaneous Indexing. We can execute dropIndexes to terminate the index being created.
But there is such a scene:
In a terminal creates an index named of a_1 for collection mycoll ; and another one creates an index named of b_1 for collection mycoll;
That is, table mycoll has two indexes being created, with different buildUUIDs
and now ,i will get errores when terminate the indexes
cannot perform operation: a background operation is currently running for collection ycsb.mycoll |
I have to drop all the indexes on this table to drop the two indexes that were created, but that's not what I want.
The key point is that the logic of deleting indexes does not support this scenario. It only supports the scenario of creating multiple indexes with the same buildUUID.
/**
|
* Aborts all the index builders on the collection if the first element in 'indexesToAbort' is "*",
|
* otherwise this attempts to abort a single index builder building the given index names.
|
*/
|
std::vector<UUID> abortActiveIndexBuilders(OperationContext* opCtx,
|
const NamespaceString& collectionNs, |
CollectionUUID collectionUUID,
|
const std::vector<std::string>& indexNames) { |
if (indexNames.empty()) { |
return {}; |
} if (indexNames.front() == "*") { |
return IndexBuildsCoordinator::get(opCtx)->abortCollectionIndexBuilds( |
opCtx, collectionNs, collectionUUID, "dropIndexes command"); |
} return abortIndexBuildByIndexNames(opCtx, collectionUUID, indexNames); |
}
|
|
Maybe this is a bug and this scenario should be supported.