Skip to content

Conversation

@drmingdrmer
Copy link
Member

@drmingdrmer drmingdrmer commented Nov 4, 2025

Changelog

change: Add on_commit on_complete to Responder trait

Add ProgressResponder and use it as default Responder that receives
on_commit and on_complete events.

  • on_commit is called when a log entry is committed;
  • on_complete is called when the log entry is applied to state machine
    or an error occur.

Replace OneshotResponder with ProgressResponder throughout the codebase to
provide both commit and completion(apply or error) notifications by default.

Upgrade tip:

When not using application defined Responder, nothing todo.

Otherwise, update the implementation of Responder by adding
on_commit if needed, and replacing send with on_complete.



This change is Reviewable

@drmingdrmer drmingdrmer marked this pull request as draft November 4, 2025 07:34
@drmingdrmer drmingdrmer force-pushed the 0017-responder-on-commit branch 4 times, most recently from 7601320 to aa54527 Compare November 4, 2025 14:57
xp-trumpet
xp-trumpet previously approved these changes Nov 4, 2025
Copy link
Collaborator

@xp-trumpet xp-trumpet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xp-trumpet reviewed 14 of 18 files at r1, 2 of 2 files at r2, 5 of 5 files at r3, 1 of 1 files at r4, 2 of 2 files at r5, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @drmingdrmer and @schreter)

Add `ProgressResponder` and use it as default `Responder` that receives
`on_commit` and `on_complete` events.

- `on_commit` is called when a log entry is committed;
- `on_complete` is called when the log entry is applied to state machine
  or an error occur.

Replace OneshotResponder with ProgressResponder throughout the codebase to
provide both commit and completion(apply or error) notifications by default.

- Fix: databendlabs#1460

Upgrade tip:

When not using application defined `Responder`, nothing todo.

Otherwise, update the implementation of `Responder` by adding
`on_commit` if needed, and replacing `send` with `on_complete`.
@drmingdrmer drmingdrmer force-pushed the 0017-responder-on-commit branch from aa54527 to dcc2c17 Compare November 4, 2025 15:00
@drmingdrmer drmingdrmer marked this pull request as ready for review November 4, 2025 15:00
Copy link
Member Author

@drmingdrmer drmingdrmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 13 of 18 files reviewed, 1 unresolved discussion (waiting on @ariesdevil, @schreter, and @xp-trumpet)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Support separate on_commit and on_apply callbacks in Responder

3 participants