replication: update lag on the slave when the master is idle
If the master doesn't generate replication events, the lag on the slave doesn't get updated. This is confusing, because due to this the lag may stay high even if the replica is up-to-date with the master. To fix this, this patch makes relay threads send slaves the current time on the master in special "heartbeat" messages. A "heartbeat" message is sent every time the relay thread is woken by timeout while waiting for WAL events. Upon receiving a "heartbeat" message, a slave updates the lag and continues waiting for more messages from the master. Closes #2976
Showing
- src/box/relay.cc 19 additions, 1 deletionsrc/box/relay.cc
- src/box/xrow.c 9 additions, 0 deletionssrc/box/xrow.c
- src/box/xrow.h 9 additions, 0 deletionssrc/box/xrow.h
- test/replication/errinj.result 19 additions, 3 deletionstest/replication/errinj.result
- test/replication/errinj.test.lua 9 additions, 2 deletionstest/replication/errinj.test.lua
Loading
Please register or sign in to comment