Skip to content
Snippets Groups Projects
Commit 10e11e9b authored by Vladimir Davydov's avatar Vladimir Davydov Committed by Konstantin Osipov
Browse files

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
parent 7906e408
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment