[SERVER-28841] CollectionShardingState / ScopedCollectionMetadata destructor races Created: 18/Apr/17  Updated: 30/Oct/23  Resolved: 16/May/17

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 3.4.0, 3.5.7
Fix Version/s: 3.4.5, 3.5.8

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

Issue Links:
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

Intermittent; run jstests

Sprint: Sharding 2017-05-29
Participants:
Linked BF Score: 0

 Description   

There are numerous races of various sorts around destruction of MetadataManager and ScopedCollectionMetadata objects. Fixing them requires changes to ScopedCollectionMetadata and CollectionMetadataTracker layout, and locking in the MetadataManager destructor.

Reproduce by running jstests/sharding/cleanup_orphaned_cmd_during_movechunk.js and jstests/concurrency/fsm_all_simultaneous repeatedly.



 Comments   
Comment by Githook User [ 19/May/17 ]

Author:

{u'username': u'nathan-myers-mongo', u'name': u'Nathan Myers', u'email': u'nathan.myers@10gen.com'}

Message: SERVER-28841 (BF) untangle spurious shared-library dependency
Branch: master
https://github.com/mongodb/mongo/commit/b06c6e96c39e2eb700c40b44bd9450bee29de1a3

Comment by Nathan Myers [ 18/May/17 ]

Corresponding data structure simplifications were folded into 3.5, which do not affect correctness, but improve maintainability.

Comment by Githook User [ 18/May/17 ]

Author:

{u'username': u'nathan-myers-mongo', u'name': u'Nathan Myers', u'email': u'nathan.myers@10gen.com'}

Message: SERVER-28841 (forward-port) simpler CollectionMetadata lifetime management
Branch: master
https://github.com/mongodb/mongo/commit/3e3c1c44f36a6121ca707e7d9700f9a5689a1c25

Comment by Githook User [ 16/May/17 ]

Author:

{u'username': u'nathan-myers-mongo', u'name': u'Nathan Myers', u'email': u'nathan.myers@10gen.com'}

Message: SERVER-28841 Fix ScopedCollectionMetadata destructor races
Branch: v3.4
https://github.com/mongodb/mongo/commit/4db4a7cc7d73c77feb7e5d7c81533c026296f54c

Comment by Nathan Myers [ 20/Apr/17 ]

This improvement can be forward-ported to 3.5 to simplify its code.

Generated at Thu Feb 08 04:19:12 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.