[SERVER-40632] Reload shard registry before attempting to get number of shards in ShardRegistry::getNumShards() Created: 12/Apr/19  Updated: 27/Oct/23  Resolved: 02/Nov/21

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

Type: Improvement Priority: Major - P3
Reporter: Blake Oler Assignee: Tommaso Tocci
Resolution: Gone away Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-54230 Stop returning sorted shard IDs vecto... Closed
Participants:

 Description   

If getNumShards() returns before the shard registry is populated, it's possible that it can incorrectly return that zero shards exist.

This function is only used in one place.

This ticket is simply to either:

  1. Remove this function and replace with getAllShardIds(), which does do a reload, or:
  2. Add a reload inside getNumShards() if the number turns out to be zero.


 Comments   
Comment by Tommaso Tocci [ 02/Nov/21 ]

This has been fixed in SERVER-54230

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