Hello,
I’m trying to understand how setting FCV on a sharded cluster works. Taking as an example version 4.0.
According to the documentation setting new FCV on a shared cluster is being done through a mongos instance.
I tried to check the code and found the following workflow:
- FCV is triggered on mongos : mongo/cluster_set_feature_compatibility_version_cmd.cpp at 91e3352a1aa717674575fce3cc6edb2f279a4479 · mongodb/mongo · GitHub
- mongos sends the command to config servers: mongo/cluster_set_feature_compatibility_version_cmd.cpp at 91e3352a1aa717674575fce3cc6edb2f279a4479 · mongodb/mongo · GitHub
- config replicaset executes mongo/set_feature_compatibility_version_command.cpp at v4.0 · mongodb/mongo · GitHub
- it does that through the block dedicated to config server: mongo/set_feature_compatibility_version_command.cpp at v4.0 · mongodb/mongo · GitHub
- Within this block config will update to new FCV and trigger upgradeChunksHistory for each collection.
- It will trigger the upgrade of FCV on each shard: mongo/set_feature_compatibility_version_command.cpp at v4.0 · mongodb/mongo · GitHub.
- setting FCV on config replicaset.
===============================
As I understand from the above FCV is set on config replicaset after it was set on all shards.
Locks, at least in version 4.0 seem to be set only at individual replicaset level, correct?
Is this correct flow in case of a sharded cluster?
Thank you,
Cristian