[SERVER-49155] MultiIndexBlock::init() does not clear _indexes upon a WCE Created: 26/Jun/20  Updated: 29/Oct/23  Resolved: 14/Jul/20

Status: Closed
Project: Core Server
Component/s: Index Maintenance
Affects Version/s: 4.5.1, 4.4.0-rc11
Fix Version/s: 4.4.0-rc14, 4.7.0

Type: Bug Priority: Major - P3
Reporter: Gregory Wlodarek Assignee: Gregory Wlodarek
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Related
related to SERVER-59738 remove unused header index_catalog_no... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4
Sprint: Execution Team 2020-07-27
Participants:
Linked BF Score: 30

 Description   

There was a build failure where this invariant failed.

This happened because the IndexBuildsManager::setUpIndexBuild() function will retry calling MultiIndexBlock::init() in a write conflict retry loop.
But because the MultiIndexBlock::init() function does not clean up its state on a WCE, the second attempt will invariant. Adding a onRollback() hook to clear _indexes should do the trick.



 Comments   
Comment by Githook User [ 17/Jul/20 ]

Author:

{'name': 'Gregory Wlodarek', 'email': 'gregory.wlodarek@mongodb.com', 'username': 'GWlodarek'}

Message: SERVER-49155 Remove mock objects from MultiIndexBlockTest and test the onRollback() commit handler for MultiIndexBlock::init()

(cherry picked from commit aaeb549ed1e6804e229c1db09fc60260bfd82a62)
Branch: v4.4
https://github.com/mongodb/mongo/commit/f55c432ba68ef32a430ba3a92cd1f564c0105c20

Comment by Githook User [ 17/Jul/20 ]

Author:

{'name': 'Gregory Wlodarek', 'email': 'gregory.wlodarek@mongodb.com', 'username': 'GWlodarek'}

Message: SERVER-49155 MultiIndexBlock::init() should clear _indexes on a WriteConflictException

(cherry picked from commit 5878325f0d8d49fdc7b9a41f5e24617e3f5febf9)
Branch: v4.4
https://github.com/mongodb/mongo/commit/b29c1758d425a73daddda6256d677add47683c59

Comment by Githook User [ 14/Jul/20 ]

Author:

{'name': 'Gregory Wlodarek', 'email': 'gregory.wlodarek@mongodb.com', 'username': 'GWlodarek'}

Message: SERVER-49155 Remove mock objects from MultiIndexBlockTest and test the onRollback() commit handler for MultiIndexBlock::init()
Branch: master
https://github.com/mongodb/mongo/commit/aaeb549ed1e6804e229c1db09fc60260bfd82a62

Comment by Githook User [ 14/Jul/20 ]

Author:

{'name': 'Gregory Wlodarek', 'email': 'gregory.wlodarek@mongodb.com', 'username': 'GWlodarek'}

Message: SERVER-49155 Fix typo in MultiIndexBlock::init()
Branch: master
https://github.com/mongodb/mongo/commit/5d787e11adfab43295fc7e4b72449cc1bec81594

Comment by Githook User [ 14/Jul/20 ]

Author:

{'name': 'Gregory Wlodarek', 'email': 'gregory.wlodarek@mongodb.com', 'username': 'GWlodarek'}

Message: SERVER-49155 MultiIndexBlock::init() should clear _indexes on a WriteConflictException
Branch: master
https://github.com/mongodb/mongo/commit/5878325f0d8d49fdc7b9a41f5e24617e3f5febf9

Comment by Gregory Wlodarek [ 26/Jun/20 ]

It looks like v4.2 is not affected, as the onRollback() hook cleared _indexes.

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