raft: use local LSN in relay recovery restart
When a Raft node is elected as a leader, it should resend all its data to the followers from the last acked vclock. Because while the node was not a leader, the other instances ignored all the changes from it. The resending is done via restart of the recovery cursor in the relay thread. When the cursor was restarted, it used the last acked vclock to find the needed xlog file. But it didn't set the local LSN component, which was 0 (replicas don't send it). When in reality the component was not zero, the recovery cursor still tried to find the oldest xlog file having the first local row. And it couldn't. The first created local row may be gone long time ago. The patch makes the restart keep the local LSN component unchanged, as it was used by the previous recovery cursor, before the restart. Closes #5433
Showing
- src/box/relay.cc 19 additions, 1 deletionsrc/box/relay.cc
- test/replication/gh-5433-election-restart-recovery.result 119 additions, 0 deletionstest/replication/gh-5433-election-restart-recovery.result
- test/replication/gh-5433-election-restart-recovery.test.lua 59 additions, 0 deletionstest/replication/gh-5433-election-restart-recovery.test.lua
- test/replication/suite.cfg 1 addition, 0 deletionstest/replication/suite.cfg
Loading
Please register or sign in to comment