[SERVER-45910] Router might target wrong shard on write operation for unsharded collection Created: 31/Jan/20  Updated: 29/Oct/23  Resolved: 08/Apr/20

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

Type: Bug Priority: Major - P3
Reporter: Marcos José Grillo Ramirez Assignee: Blake Oler
Resolution: Fixed Votes: 0
Labels: sharding-csrs-stepdown-only, sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.0
Sprint: Sharding 2020-04-20
Participants:
Linked BF Score: 14

 Description   

Suppose we have 2 shards: shard0 and shard1 and 2 routers: router0 and router1.

From router0 we create an unsharded collection making sure that the primary shard is shard0. If we issue a write operation from router1 to that same collection, it might be targeted to shard1, which will cause the insert operation to fail. Refer to the build failure comments for more information.



 Comments   
Comment by Githook User [ 13/May/20 ]

Author:

{'name': 'Blake Oler', 'email': 'blake.oler@mongodb.com', 'username': 'BlakeIsBlake'}

Message: SERVER-45910 Ensure all routers see result of movePrimary in change_streams_primary_shard_unaware.js

(cherry picked from commit 912bce679aeb48503175f3ac1cb0a87f32f0463f)
Branch: v4.0
https://github.com/mongodb/mongo/commit/e478a6c8cd4e6cd9bcd7e842d1f51ce462ffc9de

Comment by Githook User [ 06/Apr/20 ]

Author:

{'name': 'Blake Oler', 'email': 'blake.oler@mongodb.com', 'username': 'BlakeIsBlake'}

Message: SERVER-45910 Ensure all routers see result of movePrimary in change_streams_primary_shard_unaware.js
Branch: v4.2
https://github.com/mongodb/mongo/commit/912bce679aeb48503175f3ac1cb0a87f32f0463f

Comment by Marcos José Grillo Ramirez [ 07/Feb/20 ]

We could use 2 routers instead of 3 and issue the insert from the first router instead of the third

Comment by Esha Maharishi (Inactive) [ 07/Feb/20 ]

marcos.grillo, is there a fix we could make to the test in earlier branches to prevent this failure from occurring on those branches?

Comment by Esha Maharishi (Inactive) [ 07/Feb/20 ]

Note, this was fixed in 4.4 by PM-1051

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