[SERVER-83557] Create collection coordinator assume that getAllShardIds is sorted Created: 23/Nov/23  Updated: 24/Nov/23  Resolved: 24/Nov/23

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

Type: Bug Priority: Major - P3
Reporter: Pol Pinol Assignee: Pol Pinol
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Problem/Incident
is caused by SERVER-78918 Make `shardCollection` command shard ... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: CAR Team 2023-11-27
Participants:

 Description   

When we received a ShardNotFound at the create collection coordinator, we compare the shards from the shard registry from the ones persisted on the recoverable document. We use `binary_search` to do it. The `binary_search` algorithm assumes that the vector passed is sorted, not the case for `getAllShardIds` from the shard registry.

The goal of this ticket is to fix this behaviour.



 Comments   
Comment by Githook User [ 24/Nov/23 ]

Author:

{'name': 'Pol Pinol Castuera', 'email': 'pol.pinol@mongodb.com', 'username': 'PolPinol'}

Message: SERVER-83557 Create collection coordinator assume that getAllShardIds is sorted
Branch: master
https://github.com/mongodb/mongo/commit/3c361f84766110bea5d5813f141575e3033ada30

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