-
Type: Task
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Replication
-
Repl 2022-05-16
When running rs.status or rs.conf, we will observe the current version of the replica set:
"configVersion" : 88889
The same information can be found in the local.system.replset collection.
The problem is every time there is a reconfiguration of the replicaset, this number is incremented hundreds of times. If we do the reconfig with force:true it grows more than 100K this value can grow by thousands
Since it is an ever-increasing value, this can eventually lead to the:
mongo> rs.reconfig(cfg, {"force": true} ); { "ok" : 0, "errmsg" : "version field value of 2147494497 is out of range", "code" : 103, "codeName" : "NewReplicaSetConfigurationIncompatible" }
The workaround is changing the version in the local collection with the command:
db.system.replset.update({"_id": "replset"}, {$set: {"version":1}})
And restart the replica set. I wonder why the version is not incremented by one (version++). In this way, the version would virtually never expire since the maximum value is ~2billion.