replication: introduce replicaset name
The replicaset name is carried with replicaset UUID wherever any sanity validations are needed like whether 2 instances belong to the same replicaset. Part of #5029 @TarantoolBot document Title: `box.cfg.replicaset_name` and `box.info.replicaset.name` The new option `box.cfg.replicaset_name` allows to assign the replicaset name to a human-readable text value to be displayed in the new info key - `box.info.replicaset.name` - and to be validated when the instances in the replicaset connect to each other. The name is broadcasted in "box.id" built-in event as "replicaset_name" key. It is string when set and nil when not set. When set, it has to match in all instances of the entire replicaset. 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.replicaset_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 39 additions, 0 deletionssrc/box/alter.cc
- src/box/applier.cc 15 additions, 0 deletionssrc/box/applier.cc
- src/box/box.cc 71 additions, 2 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/iproto_constants.c 1 addition, 0 deletionssrc/box/iproto_constants.c
- src/box/iproto_constants.h 1 addition, 0 deletionssrc/box/iproto_constants.h
- src/box/lua/cfg.cc 13 additions, 0 deletionssrc/box/lua/cfg.cc
- src/box/lua/info.c 5 additions, 0 deletionssrc/box/lua/info.c
- src/box/lua/load_cfg.lua 5 additions, 0 deletionssrc/box/lua/load_cfg.lua
- src/box/lua/upgrade.lua 3 additions, 0 deletionssrc/box/lua/upgrade.lua
- src/box/replication.cc 1 addition, 0 deletionssrc/box/replication.cc
- src/box/replication.h 3 additions, 1 deletionsrc/box/replication.h
- src/box/xrow.c 37 additions, 0 deletionssrc/box/xrow.c
- src/box/xrow.h 6 additions, 1 deletionsrc/box/xrow.h
- test/box-luatest/downgrade_test.lua 7 additions, 0 deletionstest/box-luatest/downgrade_test.lua
- test/box-luatest/gh_7894_export_iproto_constants_and_features_test.lua 1 addition, 0 deletions...est/gh_7894_export_iproto_constants_and_features_test.lua
- test/box/error.result 1 addition, 0 deletionstest/box/error.result
- test/replication-luatest/replicaset_name_test.lua 494 additions, 0 deletionstest/replication-luatest/replicaset_name_test.lua
Loading
Please register or sign in to comment