[SERVER-43315] extend abortIndexBuild oplog entry to include reason/cause Created: 13/Sep/19  Updated: 29/Oct/23  Resolved: 20/Sep/19

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

Type: Improvement Priority: Major - P3
Reporter: Benety Goh Assignee: Benety Goh
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-43692 enable two phase index builds by default Closed
Related
related to SERVER-44585 generated abortIndexBuild oplog entry... Closed
Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2019-09-23
Participants:
Linked BF Score: 11

 Description   

In a replica set, aborting an index build does not result in any oplog entries that would affect downstream secondary nodes because the createIndexes entry would not be written to the oplog.

With two phase index builds, an index build that failed on the primary would result in a pair of startIndexBuild and abortIndexBuild oplog entries being propagated to secondary nodes. The abortIndexBuild oplog entry contains similar information to the startIndexBuild but any information relating to why the index build was aborted can only be found in the logs on the primary. It would be useful for the reason/cause for aborting the index build to be relayed to secondary nodes for improved diagnostics. We might be able to log aborted index builds on a secondary as follows:

Aborting index build: 17e76e49-af0b-42bc-84e2-d1a71230e070, timestamp: Timestamp(1568352953, 4), reason: abortIndexBuild oplog entry encountered: IndexBuildAborted: Index build aborted: Index build interrupted: 17e76e49-af0b-42bc-84e2-d1a71230e070: Interrupted: operation was interrupted, collection UUID: 1a489dee-2a27-49cc-9a32-65acb6bdfb55
 
Aborting index build: 55b67e95-55dd-4072-920d-94ee4b08affa, timestamp: Timestamp(1568353029, 1005), reason: abortIndexBuild oplog entry encountered: DuplicateKey{ keyPattern: { i: 1.0 }, keyValue: { i: 0.0 } }: E11000 duplicate key error collection: test.hybrid_i_r0_p0 index: i_1 dup key: { i: 0.0 }, collection UUID: 4944e76e-0d12-419e-bbe9-5eaece0d1ef2



 Comments   
Comment by Githook User [ 14/Sep/19 ]

Author:

{'username': 'benety', 'email': 'benety@mongodb.com', 'name': 'Benety Goh'}

Message: SERVER-43315 extend index build abort reason on secondary with original error on primary
Branch: master
https://github.com/mongodb/mongo/commit/f319e7b00ab3a506c734c5e50e760278a6fc7db3

Comment by Githook User [ 13/Sep/19 ]

Author:

{'name': 'Benety Goh', 'username': 'benety', 'email': 'benety@mongodb.com'}

Message: SERVER-43315 add 'cause' field abortIndexBuild oplog entry for index build abort reason
Branch: master
https://github.com/mongodb/mongo/commit/d1a01bdc1836db390447224b2786fc63ce7dea85

Comment by Githook User [ 13/Sep/19 ]

Author:

{'name': 'Benety Goh', 'username': 'benety', 'email': 'benety@mongodb.com'}

Message: SERVER-43315 OpObserver::onAbortIndexBuild() accepts reason for aborting index as a Status
Branch: master
https://github.com/mongodb/mongo/commit/b5c38b96c50e13be68a5a6968b441a879c0a3c53

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