Details
-
Improvement
-
Resolution: Fixed
-
Major
-
7.2.0, 7.1.3
Description
ns-server follows the below mechanism to elect the index node rebalance master:
================
ns_server gets the node info from each of the service nodes in the cluster and selects the max node across these node infos where the comparison function compares in order:
- Node priority
- Whether the node is in the keep set
- Whether the node is the orchestrator
Logic is here:
- Get node infos: https://github.com/couchbase/ns_server/blob/neo/src/service_rebalancer.erl#L151
- Call to pick leader: https://github.com/couchbase/ns_server/blob/neo/src/service_rebalancer.erl#L161
- Comparison function: https://github.com/couchbase/ns_server/blob/neo/src/service_rebalancer.erl#L219
The idea is to allow the service use priority to pick a node running the latest code if it would like to do so. Ties are broken by picking a node that will remain in the cluster after the rebalance and then picking the orchestrator node if the service happens to be running on that node.
In any case, to ensure that you always get the latest node you can bump your priority.
I'd suggest giving yourself more space in the integers you use. E.g. for a release X.Y.Z-MPW you could compute:
- W + P * 100 + Y * 10,000 + X * 1000,000
So for 7.2.1-MP3 you'd get 7020103. You don't need to bump it all the time of course, just when you need to.
================
Currently, Indexer is bumping up the priority every major version. 7.1.x is priority 6 and 7.2.0 is priority 7.
const INDEXER_71_VERSION = 6
const INDEXER_72_VERSION = 7
For minor release version/MP patch release, if any planner related changes are done, those will not be picked up till the full cluster upgrade, or at least there is no guarantee.
The idea is to have enough spaces between major releases, so that the priority can be bumped up when required.
Attachments
Issue Links
- backports to
-
MB-57056 [Backport MB-56700 to 7.2.1] Allow higher version nodes to be chosen as rebalance master during minor release upgrade
- Closed
For Gerrit Dashboard: MB-56700 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
192358,12 | MB-56700 - update logic to report Server Version | unstable | indexing | Status: MERGED | +2 | +1 |
192871,4 | MB-57056 - update logic to report Server Version | neo | indexing | Status: MERGED | +2 | +1 |