applier: treat register txns like regular ones
Applier during the registration waiting (for registering a new ID or a name) could keep doing the master txns received before the registration was started. They could still be inside WAL doing a disk write, when the replica sends a register request. Before this commit, it could cause an assertion failure in debug and a double LSN error in release. The reason was that during the registration waiting the applier treated all incoming txns as "final join" txns. I.e. it wasn't checking if those txns were already received, but not committed yet. During normal subscribe process the appliers (potentially multiple) protect themselves from that by keeping track of the vclocks which are already applied and also being applied right now (replicaset.applier.vclock). Such protection ensures that receiving same row from 2 appliers wouldn't result into its double write. It also protects from the case when a txn was received, goes to WAL, but then the applier reconnects, resubscribes, and gets the same txn again - it shouldn't be applied. The patch makes so that the registration waiting after recovery works like subscribe. Registration during recovery would mean bootstrap via join. And outside of recovery it means the instance is already running. Closes #9916 NO_DOC=bugfix
Showing
- changelogs/unreleased/gh-9916-registration-invalid-lsn.md 5 additions, 0 deletionschangelogs/unreleased/gh-9916-registration-invalid-lsn.md
- src/box/applier.cc 21 additions, 7 deletionssrc/box/applier.cc
- test/replication-luatest/anon_test.lua 81 additions, 0 deletionstest/replication-luatest/anon_test.lua
- test/replication-luatest/instance_name_test.lua 88 additions, 1 deletiontest/replication-luatest/instance_name_test.lua
Loading
Please register or sign in to comment