Make the frequency at which heartbeats update the _vt.vreplication table configurable #7659
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Motivation
For an idle source shard, the source vstreamer sends a heartbeat. Currently that is once per second. On receiving the heartbeat the target vreplication module updates the time_updated column of the relevant row of _vt.vreplication. For some setups this is a problem, for example:
See related issues for more information.
Implementation
This PR provides a tablet level configuration parameter
-vreplication_heartbeat_update_interval
which determines how often the time_updated column is updated if there are no real events on the source and the source. Default is 1 second. Keep this low if you expect high QPS and are monitoring this column to alert about potential outages. Keep this high if you experience any of the issues mentioned above.Notes
This is an initial light-weight implementation to address immediate concerns of affected users.
This also doesn't address the problem of long-running workflows (like materialize or reverse replication) for high qps systems.
To address this, in the long term, we will be refactoring the vreplication table so that the static part (including the source proto) will be separated from the dynamic part (position, timestamps) , so as to minimize the size of binlog entries.
The
VReplicationHeartbeat
metric will continue to be updated at 1 second, so for systems using this metric for monitoring, you will continue to get 1-second granularity for alerts.Signed-off-by: Rohit Nayak rohit@planetscale.com
Related Issue(s)
Checklist
Impacted Areas in Vitess
Components that this PR will affect: