Update connector contract to protect delivery-ack window with certainty - #182
Merged
Conversation
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Chengxuan
approved these changes
Sep 1, 2026
Chengxuan
left a comment
Contributor
There was a problem hiding this comment.
The incremental changes look great to me. A few suggestions on the doc and naming of the variable.
…ion-manager into catchup-sequence-guard
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
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.
This fixes a scenario where an event stream listener could silently drop events.
The scenario has been observed in practice when there are multiple listeners on a single event stream, and those listeners are catching up to the head while redelivery is occurring delaying acknowledgment of events detected during catchup by one of those listeners.
Each listener's checkpoint within the overall event stream advances two ways:
EventListenerHWMto check the position the connector's scan has reachedThe second can be ahead of the first, as the connector pushes events into a channel in FFTM and continues to scan forwards to find more events while FFTM assembles those events into a batch, and delivers that batch awaiting ack.
The guards against moving the checkpoint forwards while those events were pending acknowledgment were not strong enough in FFTM.
Fix architecture
A minimal additive change is made to the FFCAPI on the return value to
EventListenerHWMResponse(), so that it not only returns the scan position, but also the checkpoint position of the highest event passed to the FFTM channel.When a connector implements that simple contract (separate PR to EVMConnect), the changes in this FFTM PR provide an absolute assurance that the checkpoint is never moved forward by the scan interval, while there are uncommitted deliveries that have been pushed from the connector to FFTM.
transaction-manager/pkg/ffcapi/event_listener_hwm.go
Lines 28 to 58 in 5e887b9
Also included: