Skip to content

Conversation

@drmingdrmer
Copy link
Member

@drmingdrmer drmingdrmer commented Dec 5, 2025

Changelog

refactor: use watch channel for communication between core and replication task

Replace unbounded MPSC channel with watch channel for broadcasting
committed log id to replication tasks. This simplifies the replication
event handling by using an EventWatcher that monitors both entries and
committed updates.

Changes:

  • Add EventWatcher to receive events from entries and committed watch channels
  • Rename Replicate to Data for log entries replication data
  • Add committed_tx/committed_rx watch channel pair in RaftCore
  • Use send_if_greater() for committed log id updates
  • Remove per-replication MPSC sender in favor of shared watch channel

  • Improvement

This change is Reviewable

…ation task

Replace unbounded MPSC channel with watch channel for broadcasting
committed log id to replication tasks. This simplifies the replication
event handling by using an EventWatcher that monitors both entries and
committed updates.

Changes:
- Add `EventWatcher` to receive events from entries and committed watch channels
- Rename `Replicate` to `Data` for log entries replication data
- Add `committed_tx`/`committed_rx` watch channel pair in `RaftCore`
- Use `send_if_greater()` for committed log id updates
- Remove per-replication MPSC sender in favor of shared watch channel
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 12 of 12 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @drmingdrmer)

@drmingdrmer drmingdrmer enabled auto-merge December 5, 2025 05:58
@drmingdrmer drmingdrmer added this pull request to the merge queue Dec 5, 2025
Merged via the queue into databendlabs:main with commit 3602b5f Dec 5, 2025
38 checks passed
@drmingdrmer drmingdrmer deleted the 281-watch-tx-repl branch December 5, 2025 06:06
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.

2 participants