Skip to content

Bump LogRecordBatch's CURRENT_LOG_MAGIC_VALUE to V1 to support leaderEpoch #778

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

swuferhong
Copy link
Collaborator

Purpose

Linked issue: #749

Currently, Fluss uses HighWatermark to ensure data synchronization between the leader and followers. However, this approach can lead to data loss or data inconsistency during cluster upgrades or when tabletServers crash. Referencing Kafka KIP-101, we plan to replace the HighWatermark mechanism in Fluss with a leader epoch update mechanism.

To achieve this goal, we need to build a consistent LeaderEpochCache across different tabletServers. The update of this LeaderEpochCache relies on the fetchLogRequest pulling the leader's RecordBatch and reading the LeaderEpoch from the batch to update the cache.

Currently, the LogRecordBatch does not include the LeaderEpoch, so it needs to be introduced, and the magic version of LogRecordBatch should be upgraded accordingly.

Brief change log

Tests

API and Format

Documentation

@swuferhong swuferhong force-pushed the logRecordBatch-add-leaderEpoch branch 3 times, most recently from 1a1693f to e8b5338 Compare April 22, 2025 01:42
@swuferhong swuferhong marked this pull request as draft April 22, 2025 03:01
@swuferhong swuferhong linked an issue Apr 24, 2025 that may be closed by this pull request
2 tasks
@swuferhong swuferhong force-pushed the logRecordBatch-add-leaderEpoch branch from e8b5338 to ea098f3 Compare April 24, 2025 06:29
@swuferhong swuferhong force-pushed the logRecordBatch-add-leaderEpoch branch from ea098f3 to 875f12f Compare April 24, 2025 07:43
@swuferhong swuferhong marked this pull request as ready for review April 24, 2025 07:46
@swuferhong
Copy link
Collaborator Author

@wuchong pr ready, could you take a look at this pr? thx.

@swuferhong swuferhong requested a review from wuchong April 25, 2025 02:16
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.

Bump LogRecordBatch's CURRENT_LOG_MAGIC_VALUE to V1 to support leaderEpoch
1 participant