[SERVER-35019] Correct interruptibility in MultiIndexBlock destructor Created: 16/May/18  Updated: 29/Oct/23  Resolved: 22/May/18

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: 3.7.9
Fix Version/s: 4.0.0-rc1, 4.1.1

Type: Bug Priority: Major - P3
Reporter: Louis Williams Assignee: Louis Williams
Resolution: Fixed Votes: 0
Labels: bkp
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Related
related to SERVER-38477 Index build lock acquisitions should ... Closed
is related to SERVER-34905 Move the UninterruptibleLockGuard in ... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.0
Sprint: Storage NYC 2018-06-04
Participants:
Linked BF Score: 64

 Description   

The MultiIndexBlock destructor should correctly instantiate an UninterruptibleLockGuard by assigning it to a variable name that stays in scope.

Original text:
Both renameCollection and compact commands use a MultiIndexBlock to rebuild indexes, which is not resilient to lock interrupts, but handles interruptibility through periodic calls to checkforInterrupt().

An UninterruptibleLockGuard should be used in both commands, similar to what is already done for the createIndexes command.

the jstestfuzz_interrupt_replication test suite has found that interrupting these commands can result in an fassert when cleaning up partially built indexes. For unknown reasons, the existing UninterruptibleLockGuard in the destructor does protect against this failure, and can just be removed.



 Comments   
Comment by Githook User [ 23/May/18 ]

Author:

{'username': 'louiswilliams', 'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com'}

Message: SERVER-35019 Correct interruptibility in MultiIndexBlock destructor

(cherry picked from commit a825912c936483216baa1dc5d9f34eaac4730647)
Branch: v4.0
https://github.com/mongodb/mongo/commit/ab839c54e8ebc40f0c9691964166e09b1f3a7503

Comment by Githook User [ 22/May/18 ]

Author:

{'username': 'louiswilliams', 'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com'}

Message: SERVER-35019 Correct interruptibility in MultiIndexBlock destructor
Branch: master
https://github.com/mongodb/mongo/commit/a825912c936483216baa1dc5d9f34eaac4730647

Comment by Louis Williams [ 21/May/18 ]

It turns out that the original bug for this fix incorrectly created an UninterruptibleLockGuard without assigning it a variable name. This syntax instantiates the object but immediately calls the destructor. The result is that all subsequent lock acquisitions are still interruptible.

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