Follow-up from Запретить добавлять в кластер узел с несовместимой версией
Summary
Improve instance version check through governor step, here is the overview of the implemented process:
In _pico_instance we are storing version of the executable file of running instance.
In _pico_property we are storing the cluster_version which is global in the cluster (it's initialized in the bootstrap_entries while cluster is bootstrapping).
If global cluster_version is 25.X, then all instances are eligible to have versions either 25.X or 25.(X+1).
Imagine we have a cluster of 3 instances:
- i1: _pico_instance.picodata_version = 24.7.1
- i2: _pico_instance.picodata_version = 24.7.1
- i3: _pico_instance.picodata_version = 24.7.1
- _pico_property.cluster_version = 24.7.1
And at some point you want to upgrade to a newer version of picodata. You turn off one instance and run again this instance(with his old config/directory) with a new executable, let's do it with i1
- i1: _pico_instance.picodata_version = 24.8.1
- i2: _pico_instance.picodata_version = 24.7.1
- i3: _pico_instance.picodata_version = 24.7.1
- _pico_property.cluster_version = 24.7.1
Then, you can do same with i2 and i3:
- i1: _pico_instance.picodata_version = 24.8.1
- i2: _pico_instance.picodata_version = 24.8.1
- i3: _pico_instance.picodata_version = 24.7.1
- _pico_property.cluster_version = 24.7.1
As you can see, global cluster_version is still same because there is at least one instance with old version, upgrade is happening after all instances have updated their versions, let's finally update i3 and see the result:
- i1: _pico_instance.picodata_version = 24.8.1
- i2: _pico_instance.picodata_version = 24.8.1
- i3: _pico_instance.picodata_version = 24.8.1
- _pico_property.cluster_version = 24.8.1
Finally all instances upgraded their versions, governor noticed that, and updated our global version - _pico_property.cluster_version to a new version, cluster is updated, congrats!
-
Close #1150 (closed)
-
Cherry-pick to: none
-
Docs follow-up: docs#408 (closed)
-
Changelog is updated -
Follow-up for !1424 (merged)
-
See also #976 (closed)
Closes #1150 (closed)