[SERVER-53934] Refuse to start shards and config servers with setParameter requireApiVersion=true Created: 20/Jan/21  Updated: 29/Oct/23  Resolved: 19/Feb/21

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

Type: Task Priority: Major - P3
Reporter: A. Jesse Jiryu Davis Assignee: Huayu Ouyang
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Documented
is documented by DOCS-14240 Investigate changes in SERVER-53934: ... Closed
Related
is related to PYTHON-2520 Update mongo-orchestration to support... Backlog
Backwards Compatibility: Fully Compatible
Sprint: Repl 2021-02-22
Participants:

 Description   

In SERVER-49887 we introduced the requireApiVersion parameter which can be enabled at startup with --requireApiVersion, or at runtime with "setParameter". A server with this parameter enabled rejects all commands that lack an "apiVersion" field. This is intended to force external applications to configure their API version.

xuerui.fa and I realized, while discussing SERVER-53555, that shard or config servers must require apiVersion. Connections internal to the sharded cluster should be marked as "internal client" and be excused from the requireApiVersion rule (once we fix SERVER-53555); however, it seems a likely source of obscure bugs if some connections aren't marked internal and all their commands are rejected.

Let's update mongod so it refuses to start with -requireApiVersion plus either --shardSvr or --configSvr. And at runtime, if mongod was started with -shardSvr or --configSvr (but not --requireApiVersion), then "setParameter" should refuse to enable requireApiVersion. Let's document that config servers and shards shouldn't be started with requireApiVersion. The intention of requireApiVersion is enforce a rule on external clients, and config servers and shards only talk with internal clients, so they shouldn't be started with requireApiVersion.



 Comments   
Comment by Githook User [ 19/Feb/21 ]

Author:

{'name': 'Huayu Ouyang', 'email': 'huayu.ouyang@mongodb.com', 'username': 'huayu-ouyang'}

Message: SERVER-53934 Refuse to start shards and config servers with setParameter requireApiVersion=true
Branch: master
https://github.com/mongodb/mongo/commit/59ca20987d055bdaa7214efd569047b5e5778191

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