Repository navigation
Conversation
…hears of them ReplicationConfig::with_feedback_observer takes a callback, called after each successful standby status update that advanced the reported position, with how long that position waited since the oldest raise it is the first to report. Coalesced raises keep the oldest start; a failed write keeps it, and feedback_pending_since / carry_feedback_pending carry it into a replacement session. No clock is read without an observer or for raises that do not advance the position; positions are not exposed.
cargo-semver-checks against 0.4.1 found that the observer's dyn Fn made ReplicationConfig lose UnwindSafe and RefUnwindSafe. The callback is only called by the worker, so implement both for FeedbackObserver, and test the public types' auto traits.
Use a compare-exchange loop, which also builds at the MSRV, and test that a carried pending start keeps the oldest.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Stacked on #13 (base
change-driven-feedback).Problem
A consumer acknowledges positions with
update_applied_lsn. It cannot tell how long an acknowledged position waited before the server heard of it, so it has nothing to alert on when feedback is slow or stuck.Change
ReplicationConfig::with_feedback_observer(FeedbackObserver): a callback called after each successful standby status update that advanced the reported position. It receivesFeedbackSent { pending_for }, the time from the oldest raise of the applied position that this update is the first to report until the write succeeded. It is never called for an update that repeats the position (keepalive replies, idle wakeups).ReplicationClient::feedback_pending_since()(readable after the session ended) andcarry_feedback_pending(since)let a caller carry it into a replacement session.Tests