[SERVER-30052] Better synchronization between collection shard and drop Created: 07/Jul/17  Updated: 23/Sep/19  Resolved: 18/Jul/17

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 3.4.6, 3.5.9
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Kaloian Manassiev Assignee: Kaloian Manassiev
Resolution: Won't Fix Votes: 0
Labels: todo_in_code
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
related to SERVER-43487 Complete TODO listed in SERVER-30052 Closed
Operating System: ALL
Sprint: Sharding 2017-07-31
Participants:
Linked BF Score: 0

 Description   

Currently, the 'shardCollection' command's checking/refresh phase is not protected by a distributed lock.

This means that while that phase is performing a refresh, a concurrent drop can wipe out the chunks from underneath. Moving the distributed lock acquisition to happen inside the command itself should take care of this problem.



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

Author:

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

Message: SERVER-30052 Move collection dist lock acquisition outside of ShardingCatalogManager

This commit places it inside the command itself.
Branch: master
https://github.com/mongodb/mongo/commit/79c1ac98fbeebcc2b621889e36ff54f7b0117430

Comment by Kaloian Manassiev [ 18/Jul/17 ]

Shard collection and drop as implemented currently, fundamentally cannot be synchronized. This is because in the second part of shardCollection we perform splits and merges, which themselves need the collection distributed lock. Because of this, we cannot hold the distributed lock for the entire duration of 'shardCollection', which again leaves a window open where drop can come in.

Closing this ticket as won't fix as it will be obviated once we have UUIDs in place. The queryoptimizer3.js test will remain disabled from the suite until then.

Comment by Githook User [ 12/Jul/17 ]

Author:

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

Message: SERVER-30052 Temporarily disable queryoptimizer3.js from the sharded collections passthrough suite
Branch: master
https://github.com/mongodb/mongo/commit/8e51f8b78e674d1098eb44ec86802f5a2a478cc5

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