storage/postgres: Always send keepalives
for the replication slot with a tokio::interval
#30631
+21
−0
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.
We've encountered at least one issue in local testing where the upstream Postgres DB's
wal_sender_timeout
is low enough that the timeout elapses before any of our existing inputs trigger a keepalive message to be sent.This PR adds a
tokio::Interval
to the existing loop so we can make sure we are sending a standby update/keepalive at least a healthy interval.Motivation
Fix an issue we've encountered in local testing with Neon.
Related to: https://github.com/MaterializeInc/incidents-and-escalations/issues/146
Tips for reviewer
This is my first foray into storage code! It's a relatively simple change, but there could be nuances with control flow that I'm missing
Checklist
$T ⇔ Proto$T
mapping (possibly in a backwards-incompatible way), then it is tagged with aT-proto
label.