replication: introduce cluster name
The patch adds 2 new entities to replication: the concept of a cluster which has multiple replicasets and a name for this cluster. The name so far doesn't participate in any replication protocols. It is just stored in _schema and is validated against the config. The old mentions of 'cluster' (in logs, in some protocol keys like in the feedback daemon) everywhere are now considered obsolete and probably will be eventually replaced with 'replicaset'. Part of #5029 @TarantoolBot document Title: `box.cfg.cluster_name` and `box.info.cluster.name` The new option `box.cfg.cluster_name` allows to assign the cluster name to a human-readable text value to be displayed in the new info key - `box.info.cluster.name` - and to be validated when the instances in the cluster connect to each other. The name is broadcasted in "box.id" built-in event as "cluster_name" key. It is string when set and nil when not set. When set, it has to match in all instances of the entire cluster in all its replicasets. If a name wasn't set on cluster bootstrap (was forgotten or the cluster is upgraded from a version < 3.0), then it can be set on an already running instance via `box.cfg.cluster_name`. To change or drop an already installed name one has to use `box.cfg.force_recovery == true` in all instances of the cluster. After the name is updated and all the instances synced, the `force_recovery` can be set back to `false`. The name can be <= 63 symbols long, can consist only of chars '0'-'9', '-' and 'a'-'z'. It must start with a letter. When upper-case letters are used in `box.cfg`, they are automatically converted to lower-case. The names are host- and DNS-friendly.
Showing
- changelogs/unreleased/global-names.md 5 additions, 0 deletionschangelogs/unreleased/global-names.md
- src/box/alter.cc 68 additions, 0 deletionssrc/box/alter.cc
- src/box/box.cc 85 additions, 8 deletionssrc/box/box.cc
- src/box/box.h 1 addition, 0 deletionssrc/box/box.h
- src/box/errcode.h 1 addition, 0 deletionssrc/box/errcode.h
- src/box/lua/cfg.cc 13 additions, 0 deletionssrc/box/lua/cfg.cc
- src/box/lua/info.c 7 additions, 1 deletionsrc/box/lua/info.c
- src/box/lua/load_cfg.lua 17 additions, 0 deletionssrc/box/lua/load_cfg.lua
- src/box/lua/upgrade.lua 11 additions, 0 deletionssrc/box/lua/upgrade.lua
- src/box/replication.cc 2 additions, 0 deletionssrc/box/replication.cc
- src/box/replication.h 2 additions, 0 deletionssrc/box/replication.h
- test/box-luatest/downgrade_test.lua 19 additions, 0 deletionstest/box-luatest/downgrade_test.lua
- test/box/error.result 1 addition, 0 deletionstest/box/error.result
- test/replication-luatest/cluster_name_test.lua 443 additions, 0 deletionstest/replication-luatest/cluster_name_test.lua
Loading
Please register or sign in to comment