[SERVER-77082] Data race while setting index build interceptor on empty coll optimization path Created: 12/May/23  Updated: 15/May/23  Resolved: 15/May/23

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

Type: Bug Priority: Major - P3
Reporter: Yujin Kang Park Assignee: Yujin Kang Park
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-65006 Write conflict on commitIndexBuild op... Closed
is related to SERVER-77062 Perform copy-on-write of index catalo... Closed
Operating System: ALL
Sprint: Execution Team 2023-05-29
Participants:

 Description   

The interceptor is set to null in an onCommit hook after the catalog write is finished, while holding the collection MODE_IX lock (implicit collection creation). This used to be fine before the PIT catalog lookups, as the collection catalog is updated as the last onCommit hook handler. 

After the PIT catalog project, once a collection is persisted in WT, a new catalog reader can create a Collection instance from WT and then take the shared state from a newer already existing collection (code).

SERVER-65006 added the onCommit hook to prevent the interceptor from being removed when the commit fails due to write conflict error, which would be retried without the interceptor.

Part of the issue is that index build code does not follow the usual pattern of acquiring locks and catalog inside the write conflict retry loop. In that case all state would be discarded on write conflict, including the interceptor being removed, and a fresh copy of the catalog taken to retry the operation.



 Comments   
Comment by Yujin Kang Park [ 15/May/23 ]

Closing as SERVER-77062 should fix the problem by taking a copy of the IndexCatalogEntry when modifying it.

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