[SERVER-81598] ShardingTest with `shard: 1` and `configShard: true` starts two shards Created: 29/Sep/23  Updated: 30/Sep/23  Resolved: 30/Sep/23

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

Type: Bug Priority: Major - P3
Reporter: Wenqin Ye Assignee: Wenqin Ye
Resolution: Declined Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Sharding NYC
Operating System: ALL
Participants:

 Description   

When you run the following:

const st = new ShardingTest({shard: 1, rs: {nodes: 2}, configShard: true}); 

It ends up creating two shards (one config shard and one regular shard) whereas it should only create a config shard.

This can be confirmed by looking at the logs:

c20040| {"t":{"$date":"2023-09-29T22:14:48.864+00:00"},"s":"I",  "c":"SHARDING", "id":21942,   "ctx":"ShardingReady","msg":"Going to insert new entry for shard into config.shards","attr":{"shardType":"{ _id: \"config\", host: \"4e946117-c466-4605-9ca3-067c86db1ec2/ip-10-122-14-26:20040\", state: 1, topologyTime: Timestamp(1696025688, 39) }"}}
c20040| {"t":{"$date":"2023-09-29T22:14:57.939+00:00"},"s":"I",  "c":"SHARDING", "id":21942,   "ctx":"conn33","msg":"Going to insert new entry for shard into config.shards","attr":{"shardType":"{ _id: \"b1a038a0-3e94-45c8-ad50-7ab48a552d3c\", host: \"b1a038a0-3e94-45c8-ad50-7ab48a552d3c/ip-10-122-14-26:20042,ip-10-122-14-26:20043\", state: 1, topologyTime: Timestamp(1696025697, 8) }"}}


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