[SERVER-77031] Add test cases for write one on collection when sharding state is stale Created: 11/May/23  Updated: 29/Oct/23  Resolved: 19/May/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.1.0-rc0

Type: Bug Priority: Major - P3
Reporter: Yuhong Zhang Assignee: Yoon Soo Kim
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-70118 Handle collection sharding state chan... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Execution Team 2023-05-29
Participants:

 Description   

We can make a scenario that s0 and s1 have artificially different ideas of collection routing info on the same time-series collection. The scenario in interest is like this, assuming that we have two mongos [s0, s1].

  1. Creates a sharded timeseries collection with two shards and inserts some documents into it on s1
  2. Drops the same collection and create an unsharded timeseries collection and insert some documents into it on s0. The s1 still thinks that the same collection is a sharded timeseries collection

At this point, if we run a two-phase deleteOne or findAndModify on s1, we get an error NamespaceNotSharded: Expected collection timeseries_arbitrary_writes_multi_mongos.system.buckets.ts to be sharded from the first phase (cluster query) of the two-phase protocol. This might be because s1 thinks that the collection is a sharded time-series collection but it is actually unsharded.

Update: Repurposed this ticket to add test cases for findAndModify & deleteOne on 1) unsharded to sharded case and 2) sharded to unsharded case.

Original title:
Outdated collection routing info for time-series deleteOne without shard key with multiple mongos



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

Author:

{'name': 'Yoonsoo Kim', 'email': 'yoonsoo.kim@mongodb.com', 'username': 'yun-soo'}

Message: SERVER-77031 Add test cases for write one on collection with stale sharding state
Branch: master
https://github.com/mongodb/mongo/commit/276cf80e85fa46dbd3a3fe1f3f8b9993be1961c4

Generated at Thu Feb 08 06:34:20 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.