[SERVER-39919] movePrimary can leave around "orphaned collections", and there is no "orphaned collection filtering" Created: 01/Mar/19  Updated: 27/Oct/23  Resolved: 15/Mar/19

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 3.6.11, 4.0.6, 4.1.8
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Esha Maharishi (Inactive) Assignee: [DO NOT USE] Backlog - Sharding Team
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Assigned Teams:
Sharding
Operating System: ALL
Participants:
Linked BF Score: 27

 Description   

Commands that run concurrently with a movePrimary may silently succeed because they operate on the "orphaned collection" - agg with $out is one example, since agg with $out would otherwise fail if the collection had been dropped.



 Comments   
Comment by Kaloian Manassiev [ 15/Mar/19 ]

This will go away with the Tracking Unsharded Collections project.

Comment by Esha Maharishi (Inactive) [ 05/Mar/19 ]

kaloian.manassiev Because of this ticket, I realized I think targeting for writes after movePrimary could be fixed by holding the movePrimary critical section until after the unsharded collections are dropped from the donor.

This way, commands against the donor that check for the existence of the unsharded collection would either see the collection has been dropped and

  • fail explicitly (like agg with $out, which fails with CommandFailed)
  • fail with CannotImplicitlyCreateCollection, which would cause the router to refresh (at least on CRUD writes, SERVER-34733).

The user would still need to refresh all nodes' routing caches to get correct targeting for reads after movePrimary, since reads can succeed even if the collection doesn't exist.

Not saying we should necessarily implement this (that is, extend the movePrimary critical section), but it's an interesting idea.

Comment by Kaloian Manassiev [ 05/Mar/19 ]

How is this different than all the other issues that exist with movePrimary, such as inserts into unsharded collections (SERVER-22310) ?

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