[SERVER-25978] Shard node stepdown may delete collection metadata which is in use by active cursors Created: 06/Sep/16  Updated: 19/Nov/16  Resolved: 07/Sep/16

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 3.3.12
Fix Version/s: 3.3.14

Type: Bug Priority: Major - P3
Reporter: Kaloian Manassiev Assignee: Kaloian Manassiev
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 2016-09-19
Participants:
Linked BF Score: 0

 Description   

Cursors opened against sharded collections will contain a pointer to the CollectionMetadata, which corresponds to the version of the collection they are using and also a "lease" on that metadata so the range deleter will not clean it up while the cursor is still active.

The stepdown code, however, indiscriminately clears the CollectionShardingState map and as a result these queries no longer reference a valid CollectionMetadata object.

Instead of clearing the map, the stepdown code should just mark the collections as not sharded.



 Comments   
Comment by Githook User [ 07/Sep/16 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-25978 Do not clear the CollectionShardingState map on stepdown
Branch: master
https://github.com/mongodb/mongo/commit/78d90db28d8341f073361c2df7a35acb17cd8f42

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