[SERVER-42869] IndexBuildInterceptor rollback handler access _sideWritesCounter field after interceptor is destroyed Created: 19/Aug/19  Updated: 29/Oct/23  Resolved: 22/Aug/19

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 4.2.1, 4.3.1

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

Issue Links:
Backports
Related
is related to SERVER-42621 3 way deadlock can happen between hyb... Closed
is related to SERVER-42824 do not lock RSTL for index build cleanup Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.2
Sprint: Execution Team 2019-08-26
Participants:

 Description   

Aborting a transaction that began while an index build is in progress may invoke registered changes in the RecoveryUnit to rollback changes to the temporary tables used by the index build. In the event of a replica set step down, the index build may be cleaned up, along with the associated IndexBuildInterceptor and the temporary tables, before the abort procedure is completed for the transaction. This may result in the rollback handler in the RecoveryUnit accessing the internal state of an IndexBuildInterceptor that is no longer available. A potential scenario, which requires SERVER-42824 to be implemented , is described in SERVER-42621.



 Comments   
Comment by Githook User [ 28/Aug/19 ]

Author:

{'name': 'Benety Goh', 'username': 'benety', 'email': 'benety@mongodb.com'}

Message: SERVER-42869 fix crash in IndexBuildsCoordinator::sideWrite() rollback handler

This can happen when an index build cleanup takes priority over aborting a transaction
that has some uncommitted writes to the side table.

(cherry picked from commit fc57c83820eaa846790bac737221c8ee960d4068)
Branch: v4.2
https://github.com/mongodb/mongo/commit/0adca0e077ec30435ab852827b01e786b6a80891

Comment by Githook User [ 28/Aug/19 ]

Author:

{'name': 'Benety Goh', 'username': 'benety', 'email': 'benety@mongodb.com'}

Message: SERVER-42869 use shared_ptr to manage side writes counter in IndexBuildInterceptor

(cherry picked from commit 8a285153c1729dd9dcb417f1dccfa8593d25fe7e)
Branch: v4.2
https://github.com/mongodb/mongo/commit/df801bb56490ef3e25863379ca5f0f9e1fe90a48

Comment by Githook User [ 22/Aug/19 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-42869 fix crash in IndexBuildsCoordinator::sideWrite() rollback handler

This can happen when an index build cleanup takes priority over aborting a transaction
that has some uncommitted writes to the side table.
Branch: master
https://github.com/mongodb/mongo/commit/fc57c83820eaa846790bac737221c8ee960d4068

Comment by Githook User [ 22/Aug/19 ]

Author:

{'username': 'benety', 'email': 'benety@mongodb.com', 'name': 'Benety Goh'}

Message: SERVER-42869 use shared_ptr to manage side writes counter in IndexBuildInterceptor
Branch: master
https://github.com/mongodb/mongo/commit/8a285153c1729dd9dcb417f1dccfa8593d25fe7e

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