[SERVER-13531] Collection drop doesn't clean the shard version on empty shards Created: 09/Apr/14  Updated: 10/Dec/14  Resolved: 06/Jun/14

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

Type: Bug Priority: Major - P3
Reporter: Siyuan Zhou Assignee: Randolph Tan
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File coll_drop.js    
Issue Links:
Duplicate
duplicates SERVER-11256 improve handling of empty vs nonexist... Closed
Related
Operating System: ALL
Steps To Reproduce:

Run attached js script.

Participants:
Linked BF Score: 0

 Description   

In a sharded collection, if all chunks on the primary shard has been migrated to non-primary shards, collection drop command on mongos will not send "drop" command to the empty primary shard, but set its shard version to unsharded/dropped state 0|0||0000... However, an empty shard has the shard version 0|0||epoch and thinks the new shard version is compatible with its current one, so the empty shard doesn't drop its metadata.

In this situation, another insert and query to the just dropped (now unsharded) collection will go to the primary that has stale metadata. The inserted doc will be skipped because the shard doesn't think this doc belongs to it (it thinks it's empty) based on its stale metadata.



 Comments   
Comment by Thomas Rueckstiess [ 09/Apr/14 ]

attached test fails on 2.4.10 and 2.6.0 as well.

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