-
Notifications
You must be signed in to change notification settings - Fork 460
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
Bump LogRecordBatch's CURRENT_LOG_MAGIC_VALUE to V1 to support leaderEpoch #778
Conversation
1a1693f to
e8b5338
Compare
ea098f3 to
875f12f
Compare
|
@wuchong pr ready, could you take a look at this pr? thx. |
e3dd71e to
03c9bbe
Compare
platinumhamburg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR LGTM. However, there are some minor issues: several test cases hardcode the CURRENT_LOG_MAGIC_VALUE magic value. It would be better to parameterize these related test cases.
...ient/src/test/java/com/alibaba/fluss/client/table/scanner/log/DefaultCompletedFetchTest.java
Outdated
Show resolved
Hide resolved
fluss-common/src/test/java/com/alibaba/fluss/record/MemoryLogRecordsArrowBuilderTest.java
Outdated
Show resolved
Hide resolved
fluss-common/src/test/java/com/alibaba/fluss/record/MemoryLogRecordsArrowBuilderTest.java
Outdated
Show resolved
Hide resolved
fluss-common/src/test/java/com/alibaba/fluss/record/MemoryLogRecordsArrowBuilderTest.java
Outdated
Show resolved
Hide resolved
fluss-common/src/test/java/com/alibaba/fluss/record/MemoryLogRecordsArrowBuilderTest.java
Outdated
Show resolved
Hide resolved
|
@platinumhamburg comments addressed |
3495486 to
3b33f5f
Compare
d88c76c to
434a4f4
Compare
fluss-common/src/main/java/org/apache/fluss/record/LogRecordBatchFormat.java
Outdated
Show resolved
Hide resolved
fluss-common/src/main/java/org/apache/fluss/record/DefaultLogRecordBatch.java
Outdated
Show resolved
Hide resolved
fluss-common/src/main/java/org/apache/fluss/record/FileLogProjection.java
Outdated
Show resolved
Hide resolved
fluss-common/src/main/java/org/apache/fluss/record/LogRecordBatchFormat.java
Outdated
Show resolved
Hide resolved
fluss-common/src/test/java/org/apache/fluss/testutils/DataTestUtils.java
Outdated
Show resolved
Hide resolved
wuchong
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed a commit to address the above comments. Please review the changes. @swuferhong
3b33f5f to
b60e2a1
Compare
|
@wuchong LGTM, the CI has been failed. |
|
I think this PR affects a lot also this, right? |
…leaderEpoch (apache#778) Co-authored-by: Jark Wu <[email protected]> # Conflicts: # fluss-client/src/test/java/org/apache/fluss/client/write/IndexedLogWriteBatchTest.java # fluss-common/src/main/java/org/apache/fluss/record/MemoryLogRecordsIndexedBuilder.java
…support leaderEpoch (apache#778)" This reverts commit a25c64b.
…leaderEpoch (apache#778) Co-authored-by: Jark Wu <[email protected]>
…leaderEpoch (apache#778) Co-authored-by: Jark Wu <[email protected]>
…support leaderEpoch (apache#778)" This reverts commit a25c64b.
…leaderEpoch (apache#778) Co-authored-by: Jark Wu <[email protected]>
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