[SERVER-33377] MultiIndexBlock builder can incorrectly change an InterruptedAtShutdown error into a uassert Created: 16/Feb/18  Updated: 29/Oct/23  Resolved: 18/Apr/18

Status: Closed
Project: Core Server
Component/s: Index Maintenance, Storage
Affects Version/s: None
Fix Version/s: 3.7.6

Type: Bug Priority: Major - P3
Reporter: Daniel Gottlieb (Inactive) Assignee: Eric Milkie
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
related to SERVER-34616 second index build interrupt crashed ... Closed
related to SERVER-37498 remove slowBackgroundIndexBuild failp... Closed
Backwards Compatibility: Minor Change
Sprint: Storage NYC 2018-04-23
Participants:
Linked BF Score: 59

 Description   

The `IndexBuilder` class is used for secondaries to build indexes. A secondary receiving a message (oplog) to build an index implies the index must exist, thus if the index build has an error, there is logic to crash the node. Notably, the "interrupted" (for shutdown) error code is exempt from crashing.

Errors can come up while an index build is iterating through documents, including being interrupted for shutdown. However, the code indiscriminately turns all errors into a `uassert`.

This uassert is not treated by the former fassert as an interruption error, crashing the server instead of performing a graceful shutdown.

Note: I did confirm that the clean shutdown and the crashing cases both leave the index in an "unready" state and will be rebuilt when the node comes back up.



 Comments   
Comment by Eric Milkie [ 18/Apr/18 ]

With this code change, index builds can no longer return an error with code 28550, and instead may return errors with any of the Interrupted* codeNames (although I believe it was already possible for those errors to be returned). Code 28550 no longer exists in the codebase.

Comment by Githook User [ 18/Apr/18 ]

Author:

{'email': 'milkie@10gen.com', 'name': 'Eric Milkie', 'username': 'milkie'}

Message: SERVER-33377 do not disguise the reason for an index build's failure
Branch: master
https://github.com/mongodb/mongo/commit/2a1b247b29fdb037222d451d92568c79cbb341ae

Generated at Thu Feb 08 04:33:11 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.