applier: filter incoming synchro packets via transaction initiator
Currently we use synchro packets filtration based on their contents, in particular by their xrow->replica_id value. Still there was a question if we can optimize this moment and rather filter out all packets coming from non-leader replica. Raft specification requires that only data from a current leader should be applied to local WAL but doesn't put a concrete claim on the data transport, ie how exactly rows are reaching replicas. This implies that data propagation may reach replicas indirectly via transit hops. Thus we drop applier->instance_id filtering and rely on xrow->replica_id matching instead. In the test (inspired by Serge Petrenko's test) we recreate the situation where replica3 obtains master's node data (which is a raft leader) indirectly via replica2 node. Closes #6035 Co-developed-by:Serge Petrenko <sergepetrenko@tarantool.org> Signed-off-by:
Cyrill Gorcunov <gorcunov@gmail.com>
Showing
- src/box/applier.cc 15 additions, 12 deletionssrc/box/applier.cc
- src/lib/raft/raft.h 0 additions, 7 deletionssrc/lib/raft/raft.h
- test/replication/gh-5445-leader-inconsistency.result 15 additions, 0 deletionstest/replication/gh-5445-leader-inconsistency.result
- test/replication/gh-5445-leader-inconsistency.test.lua 5 additions, 0 deletionstest/replication/gh-5445-leader-inconsistency.test.lua
- test/replication/gh-6035-election-filter.result 139 additions, 0 deletionstest/replication/gh-6035-election-filter.result
- test/replication/gh-6035-election-filter.test.lua 64 additions, 0 deletionstest/replication/gh-6035-election-filter.test.lua
- test/replication/gh-6035-master.lua 1 addition, 0 deletionstest/replication/gh-6035-master.lua
- test/replication/gh-6035-node.lua 34 additions, 0 deletionstest/replication/gh-6035-node.lua
- test/replication/gh-6035-replica1.lua 1 addition, 0 deletionstest/replication/gh-6035-replica1.lua
- test/replication/gh-6035-replica2.lua 1 addition, 0 deletionstest/replication/gh-6035-replica2.lua
- test/replication/suite.cfg 1 addition, 0 deletionstest/replication/suite.cfg
Loading
Please register or sign in to comment