[SERVER-54162] Non indicative error is displayed when mongoS configDB replica set name is incorrect. Created: 01/Feb/21  Updated: 12/Dec/23

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

Type: Improvement Priority: Minor - P4
Reporter: Stas Baskin Assignee: Backlog - Cluster Scalability
Resolution: Unresolved Votes: 0
Labels: neweng, sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File mongos.log    
Assigned Teams:
Cluster Scalability
Participants:
Case:

 Description   

Overview:
When `mongoS` is launched with an incorrect replica set name for the config server host, there is no clear indication of the error in customer actions.

The displayed error is:

"Cannot accept sharding commands if not started with --shardsvr"

Encountered in version: 4.4.3

Scenario:
1. Start data nodes as:

mongod --replSet shard01 --dbpath <paths> --logpath <logbaths> --port <ports> --fork --shardsvr 

2. Start config nodes as:

mongod --replSet configRepl --dbpath <path> --logpath <logpath> --port <conf_port> --fork --configsvr 

3. Start `mongoS` as:

mongos --logpath <logpath> --port <port> --configdb shard01/<conf_host>:<conf_port> --fork

The --configdb option in this command uses the incorrect replica set name "shard01" instead of "configRepl".

4. Connect to mongoS
5. Run commands:

sh.enableSharding("myNewDB")
use myNewDB
db.myNewCollection1.insertOne( { x: 1 }

Result:
Error that suggests the server was started without the required configuration.

WriteError({
  "index": 0,
  "code": 193,
  "errmsg": "Cannot accept sharding commands if not started with --shardsvr",
  "op": {
    "_id": ObjectId("601804bf64ac35a70d27f863"),
    "x": 1
  }
})

Expected Result:
An indicative error that specifies that the config server <fill configDB param> is not available.


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