[SERVER-48293] remove inactive index builds from config.system.indexBuilds Created: 19/May/20  Updated: 29/Oct/23  Resolved: 16/Sep/20

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

Type: Bug Priority: Major - P3
Reporter: Benety Goh Assignee: Vishnu Kaushik
Resolution: Fixed Votes: 0
Labels: newgrad
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Related
is related to SERVER-46560 Make Abort index build logic determin... Closed
is related to SERVER-48290 update indexbg_killop_primary_after_i... Closed
is related to SERVER-47635 Remove index build entries for the fi... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4
Sprint: Execution Team 2020-09-21
Participants:
Linked BF Score: 30

 Description   

After an index build is completed (committed/aborted) the document representing the active index build state in config.system.indexBuilds is removed by the IndexBuildsCoordinator. This was done in SERVER-47635. In certain abort situations, if a secondary votes for commit readiness as the primary is in removing the document, we may end up with an orphaned document in this system collection. It would be desirable, for better resource management, to periodically clean up the replicated config.system.indexBuilds collection on the primary.



 Comments   
Comment by Githook User [ 09/Nov/21 ]

Author:

{'name': 'Vishnu Kaushik', 'email': 'vishnu.kaushik@mongodb.com', 'username': 'kauboy26'}

Message: SERVER-48293 change update to upsert to mitigate race condition leading to orphaned system.indexBuilds

(cherry picked from commit cc248c4286d45eee06e2d66cdd52cd7cbae5b593)
Branch: v4.4
https://github.com/mongodb/mongo/commit/576674e62c8daa7048686d0dfe5c567e02d9b1a0

Comment by Githook User [ 16/Sep/20 ]

Author:

{'name': 'Vishnu Kaushik', 'email': 'vishnu.kaushik@mongodb.com', 'username': 'kauboy26'}

Message: SERVER-48293 change update to upsert to mitigate race condition leading to orphaned system.indexBuilds
Branch: master
https://github.com/mongodb/mongo/commit/cc248c4286d45eee06e2d66cdd52cd7cbae5b593

Comment by Benety Goh [ 21/May/20 ]

Having additional checks in the voteCommitIndexBuild command would definitely help in addressing the underlying problem.

Comment by Dianna Hohensee (Inactive) [ 20/May/20 ]

Could we have the secondary vote not write to the collection if the index build on the primary is already done? Maybe a mutex – after taking the IX locks --for updating the collection documents? Might be easier than creating an asynchronous task.

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