[SERVER-78036] Handle the race between the getting and setting of the LogicalTimeValidator during sharding initialization Created: 13/Jun/23  Updated: 29/Oct/23  Resolved: 14/Jun/23

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 7.1.0-rc0, 7.0.0-rc6, 6.0.9, 5.0.21

Type: Bug Priority: Major - P3
Reporter: Cheahuychou Mao Assignee: Cheahuychou Mao
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:
v7.0, v6.0, v5.0
Sprint: Sharding NYC 2023-06-26
Participants:
Linked BF Score: 135

 Description   

After SERVER-60466, a mongod started with --shardsvr but does not yet have a shard identity would temporarily use the replica set version of the LogicalTimeValidator, which would later get replaced by sharded version of the LogicalTimeValidator during sharding initialization. The LogicalTimeValidator is a unique pointer decoration on the ServiceContext. As a result, once the replica set LogicalTimeValidator is replaced by the sharded replica set. The replica set LogicalTimeValidator object would become invalid and could lead to segmentation fault as seen in BF-29030. One resolution would be to make the LogicalTimeValidator a shared_ptr decoration so threads that have the replica set LogicalTimeValidator while sharding initialization occurs can continue to use it until they are done.



 Comments   
Comment by Githook User [ 08/Aug/23 ]

Author:

{'name': 'Cheahuychou Mao', 'email': 'mao.cheahuychou@gmail.com', 'username': 'cheahuychou'}

Message: SERVER-78036 Handle the race between the getting and setting of the LogicalTimeValidator during sharding initialization

(cherry picked from commit 4d1ea3cda60f0077d9e79e4b66c4d006681ea2a1)
Branch: v5.0
https://github.com/mongodb/mongo/commit/d639e599a44a513aeccd5fb103da16e415d127a6

Comment by Githook User [ 06/Jul/23 ]

Author:

{'name': 'Cheahuychou Mao', 'email': 'mao.cheahuychou@gmail.com', 'username': 'cheahuychou'}

Message: SERVER-78036 Handle the race between the getting and setting of the LogicalTimeValidator during sharding initialization

(cherry picked from commit 4d1ea3cda60f0077d9e79e4b66c4d006681ea2a1)
Branch: v6.0
https://github.com/mongodb/mongo/commit/0dcd075db8d791dd2e223e7aa5cbafaaaa1c9b55

Comment by Githook User [ 26/Jun/23 ]

Author:

{'name': 'Cheahuychou Mao', 'email': 'mao.cheahuychou@gmail.com', 'username': 'cheahuychou'}

Message: SERVER-78036 Handle the race between the getting and setting of the LogicalTimeValidator during sharding initialization

(cherry picked from commit 4d1ea3cda60f0077d9e79e4b66c4d006681ea2a1)
Branch: v7.0
https://github.com/mongodb/mongo/commit/004b78272920e96623ca68a3f0510cd16d6efebe

Comment by Githook User [ 14/Jun/23 ]

Author:

{'name': 'Cheahuychou Mao', 'email': 'mao.cheahuychou@gmail.com', 'username': 'cheahuychou'}

Message: SERVER-78036 Handle the race between the getting and setting of the LogicalTimeValidator during sharding initialization
Branch: master
https://github.com/mongodb/mongo/commit/4d1ea3cda60f0077d9e79e4b66c4d006681ea2a1

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