[SERVER-46012] Aborting index builders through the IndexBuildsCoordinator does not always abort the index builders Created: 06/Feb/20  Updated: 06/Dec/22  Resolved: 03/Mar/20

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Gregory Wlodarek Assignee: Backlog - Storage Execution Team
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-44791 Abort index builds by interrupting th... Closed
Related
related to SERVER-46595 createIndexes command fails to abort ... Closed
is related to SERVER-45921 Index builder invariants on this chec... Closed
is related to SERVER-37726 Make dropIndexes abort in-progress in... Closed
is related to SERVER-44791 Abort index builds by interrupting th... Closed
Assigned Teams:
Storage Execution
Sprint: Execution Team 2020-04-06
Participants:

 Description   

It's possible that the abort signal gets sent to the index builder too late into the index build process, as in the index is about to commit. This makes the abort functionality in the IndexBuildsCoordinator misleading and confusing as to what actually happened to the index builder.

 

[ReplWriterWorker-6] createCollection: test.foo with provided UUID: 65abe577-c94b-40fa-94ed-db654957c40f and options: { uuid: UUID("65abe577-c94b-40fa-94ed-db654957c40f") }
[ReplWriterWorker-6] index build: done building index _id_ on ns test.foo
[IndexBuildsCoordinatorMongod-0] index build: starting on test.foo properties: { v: 2, key: { _fts: "text", _ftsx: 1 }, name: "x_index", default_language: "spanish", weights: { x: 1 }, language_override: "language", textIndexVersion: 3 } using method: Hybrid
[IndexBuildsCoordinatorMongod-0] build may temporarily use up to 500 megabytes of RAM
[IndexBuildsCoordinatorMongod-0] Index build initialized: 7507aa06-1830-4800-9ec7-b0300f82ff30: test.foo (65abe577-c94b-40fa-94ed-db654957c40f ): indexes: 1
[IndexBuildsCoordinatorMongod-0] index build: collection scan done. scanned 1 total records in 0 seconds
[IndexBuildsCoordinatorMongod-0] failed to create WiredTiger bulk cursor: Device or resource busy
[IndexBuildsCoordinatorMongod-0] falling back to non-bulk cursor for index table:index-3--4689809868312514907
[IndexBuildsCoordinatorMongod-0] index build: inserted 1 keys from external sorter into index in 0 seconds
[IndexBuildsCoordinatorMongod-0] index build: done building index x_index on ns test.foo
[ReplWriterWorker-13] CMD: dropIndexes test.foo: "x_index" [ReplWriterWorker-13] IndexBuildsCoordinator::abortIndexBuildByIndexNamesNoWait - active index builds: 1
[ReplWriterWorker-13] IndexBuildsCoordinator::abortIndexBuildByIndexNamesNoWait - 7507aa06-1830-4800-9ec7-b0300f82ff30: collection: 65abe577-c94b-40fa-94ed-db654957c40f; indexes: 1 [x_index]; method: single phase
[ReplWriterWorker-13] About to abort index builder: 7507aa06-1830-4800-9ec7-b0300f82ff30
[ReplWriterWorker-13] Waiting until index build with UUID 7507aa06-1830-4800-9ec7-b0300f82ff30 is finished
[IndexBuildsCoordinatorMongod-0] Index build completed successfully: 7507aa06-1830-4800-9ec7-b0300f82ff30: test.foo ( 65abe577-c94b-40fa-94ed-db654957c40f ). Index specs built: 1. Indexes in catalog before build: 1. Indexes in catalog after build: 2



 Comments   
Comment by Benety Goh [ 03/Mar/20 ]

This ticket describes similar underlying issues as SERVER-44791. Further discussion to be continued in SERVER-44791.

Comment by Benety Goh [ 07/Feb/20 ]

This is related to the work in SERVER-37726, where dropIndexes will be updated to abort an index build and return success (today, it will fail with a BackgroundOperationInProgress error). The expected oplog sequence after dropIndexes completes would be: startIndexBuild, abortIndexBuild.

dropIndexes will still be able provide the desired outcome In the case that the index build runs to completion because we would fall back on the old dropIndexes logic. The sequence of events in the oplog would be: startIndexBuild, commitIndexBuild, and dropIndexes.

The asynchronous nature of the index build abort interface will be addressed in SERVER-45921.

Generated at Thu Feb 08 05:10:16 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.