MongoDB Sharded Cluster Downgrade 4.2 -> 4.0

Hello All,

I’m currently working on an Anible Playbook to dowgrade a shadred cluster from 4.2 to 4.0. I’m following the steps documented at… https://docs.mongodb.com/manual/release-notes/4.2-downgrade-sharded-cluster/

After disabling the balancer I then move onto a Play that upgrades the mongos instances. This play I run serially so it should work through the mongos instance one by one. This fails on the first instance, when starting the downgraded version of the mongos service, with the following message…

"2020-12-06T16:38:16.059+0000 I NETWORK  [mongosMain] Starting new replica set monitor for cfg/ mongos2.local:27019, mongos3.local:27019,mongos1.local:27019
2020-12-06T16:38:16.060+0000 I SHARDING [thread1] creating distributed lock ping thread for process mongos1:27017:1607272696:-8549465232112236536 (sleeping for 30000ms)
2020-12-06T16:38:16.132+0000 F NETWORK  [mongosMain] This mongos server must be upgraded. It is attempting to communicate with an upgraded cluster with which it is incompatible. Error: 'IncompatibleWithUpgradedServer: Server min and max wire version (8,8) is incompatible with client min wire version (7,7).You (client) are attempting to connect to a node (server) that no longer accepts connections with your (client’s) binary version. Please upgrade the client’s binary version.' Crashing in order to bring attention to the incompatibility, rather than erroring endlessly.
2020-12-06T16:38:16.132+0000 F -        [mongosMain] Fatal Assertion 50709 at src/mongo/client/dbclient_connection.cpp 278
2020-12-06T16:38:16.132+0000 F -        [mongosMain]"

I have confirmed the mongos instance has been downgraded to 4.0…

[vagrant@mongos1 ~]$ mongos --version
mongos version v4.0.21
git version: 3f68a848c68e993769589dc18e657728921d8367
OpenSSL version: OpenSSL 1.1.1 FIPS  11 Sep 2018
allocator: tcmalloc
modules: none
build environment:
    distmod: rhel80
    distarch: x86_64
    target_arch: x86_64..

The config server is still running the 4.2 version as expected…

[vagrant@mongos1 ~]$ mongod --version
db version v4.2.11
git version: ea38428f0c6742c7c2c7f677e73d79e17a2aab96
OpenSSL version: OpenSSL 1.1.1 FIPS  11 Sep 2018
allocator: tcmalloc
modules: none
build environment:
    distmod: rhel80
    distarch: x86_64
    target_arch: x86_64

My config servers are running on the same hosts as the mongos processes. The documentation clearly states to upgrade the mongos instances before the shards or config servers. Is something wrong or am I missing something here?

Cheers,

Rhys

Hi @Rhys_Campbell

Make sure you have completed all of the Prerequisites. Your error is likely due to the FeatureCompatibilityVersion still being set to 4.2