[SERVER-43330] ReplicationStateTransitionLockGuard::_unlock doesn't work with its move constructor Created: 13/Sep/19  Updated: 29/Oct/23  Resolved: 25/Sep/19

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

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

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.2
Sprint: Repl 2019-09-23, Repl 2019-10-07
Participants:
Linked BF Score: 0

 Description   

If a ReplicationStateTransitionLockGuard ("this") is constructed via the move constructor, it inherits the RSTL lock from "other" and "other"'s _result is then set to LOCK_INVALID. However, when "other" is destructed, it calls ReplicationStateTransitionLockGuard::_unlock which unlocks the RSTL using the same _opCtx as "this". As a result, "this" no longer holds the RSTL even though "this"._result is LOCK_OK.



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

Author:

{'name': 'Lingzhi Deng', 'username': 'ldennis', 'email': 'lingzhi.deng@mongodb.com'}

Message: SERVER-43330 Remove ReplicationStateTransitionLockGuard move constructor

(cherry picked from commit e4139a8394fb7d35503a0b559fc90723f7ab9de7)
Branch: v4.2
https://github.com/mongodb/mongo/commit/e7a7530bc76d62424afa455dc36495b57b09cd93

Comment by Githook User [ 25/Sep/19 ]

Author:

{'name': 'Lingzhi Deng', 'username': 'ldennis', 'email': 'lingzhi.deng@mongodb.com'}

Message: SERVER-43330 Remove ReplicationStateTransitionLockGuard move constructor
Branch: master
https://github.com/mongodb/mongo/commit/e4139a8394fb7d35503a0b559fc90723f7ab9de7

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