schema: allow _cluster update after join
The function replica_check_id() is called on any change in _cluster: insert, delete, update. It was supposed to check if the replica ID is valid - not nil, not out of range (VCLOCK_MAX). But it was also raising an error when the ID matched this instance's ID unless the instance was joining. That happened even if a _cluster tuple was updated without changing the ID at all. For example, if one would just do _cluster:replace(_cluster:get(box.info.id)). Better do the check in the only place where the mutation can happen - on deletion. Since replica ID is a primary key in _cluster, it can't be updated there. Only inserted or deleted. This commit is backported to 2.11, since we want to allow using persistent names as early as we can in order to simplify the upgrade process. We also bump the schema version in the following commit in order to distinguish this version from overs 2.11.X, where persistent names doesn't work. Closes #10549 NO_DOC=bugfix and refactoring NO_CHANGELOG=cannot happen without touching system spaces NO_TEST=too insignificant for an own test (cherry picked from commit cb8f4715)
Showing
- src/box/alter.cc 16 additions, 0 deletionssrc/box/alter.cc
- src/box/replication.cc 0 additions, 16 deletionssrc/box/replication.cc
- test/replication-py/cluster.result 6 additions, 2 deletionstest/replication-py/cluster.result
- test/replication-py/cluster.test.py 3 additions, 0 deletionstest/replication-py/cluster.test.py
Loading
Please register or sign in to comment