replication: allow to re-register with new UUID
Previously it wasn't allowed to change instance UUID in _cluster. When needed, it had to be done manually by deleting the instance from _cluster and inserting it back with a new UUID. Or not to be done at all. Re-UUID (like re-name) was reported to be used when people didn't want to register new replica IDs. They wanted to rejoin lost replicas from scratch but keep the numeric ID. With UUID they could deal by either setting it explicitly to the old value on a new instance, or by doing the manual re-UUID like described above. This commit is supposed to make things simpler. If a replica has a name, then its re-join with another UUID is not an error. Its record in _cluster is automatically updated to store the new UUID. That is only possible if the old-UUID-instance is not connected anymore and is not listed in replication cfg. Closes #5029 @TarantoolBot document Title: Instance rebootstrap with new UUID but same ID and name If an instance has a non-empty instance name (`box.cfg.instance_name`), then at rebootstrap it can keep the name and its old numeric ID (space `_cluster['id']` field). This might be needed if one doesn't want to pollute `_cluster` with new rows, and somewhy doesn't want to or can't just drop the rows belonging to the dead replicas. In order for this to work 1) the rebootstrapping replica must keep its old non-empty instance name, 2) the other instances should not have any alive connections to the old dead replica. Ideally, the old replica should be just deleted from `box.cfg.replication` everywhere. When that works, the old row in `_cluster` is automatically updated with the new instance UUID.
Showing
- changelogs/unreleased/global-names.md 3 additions, 0 deletionschangelogs/unreleased/global-names.md
- src/box/alter.cc 75 additions, 7 deletionssrc/box/alter.cc
- src/box/box.cc 10 additions, 2 deletionssrc/box/box.cc
- src/box/replication.cc 10 additions, 3 deletionssrc/box/replication.cc
- src/box/replication.h 7 additions, 0 deletionssrc/box/replication.h
- test/replication-luatest/instance_name_test.lua 65 additions, 1 deletiontest/replication-luatest/instance_name_test.lua
- test/replication-py/cluster.result 2 additions, 2 deletionstest/replication-py/cluster.result
Loading
Please register or sign in to comment