How Enabling FCV on Sharded Clusters works


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:

  1. FCV is triggered on mongos :
  2. mongos sends the command to config servers:
  3. config replicaset executes
  4. it does that through the block dedicated to config server:
  5. Within this block config will update to new FCV and trigger upgradeChunksHistory for each collection.
  6. It will trigger the upgrade of FCV on each shard:
  7. 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,

Hi Cristian, why is important to know this. This is the kind of internal detail that is likely to change in future versions of MongoDB and shouldn’t make a difference to end users?