[HUDI-8955] Resolve Kafka beginning offsets with retention to prevent OffsetOutOfRange exception#12762
Merged
yihua merged 2 commits intoapache:masterfrom Feb 24, 2025
Merged
Conversation
529bb25 to
615dc04
Compare
f00947a to
3e4b7ab
Compare
yihua
reviewed
Feb 18, 2025
hudi-common/src/main/java/org/apache/hudi/common/util/LogicalClock.java
Outdated
Show resolved
Hide resolved
hudi-common/src/main/java/org/apache/hudi/common/util/SystemClock.java
Outdated
Show resolved
Hide resolved
yihua
reviewed
Feb 18, 2025
hudi-utilities/src/main/java/org/apache/hudi/utilities/config/KafkaSourceConfig.java
Outdated
Show resolved
Hide resolved
hudi-utilities/src/test/java/org/apache/hudi/utilities/sources/helpers/TestKafkaOffsetGen.java
Outdated
Show resolved
Hide resolved
yihua
reviewed
Feb 18, 2025
hudi-utilities/src/main/java/org/apache/hudi/utilities/config/KafkaSourceConfig.java
Outdated
Show resolved
Hide resolved
c505f65 to
495df92
Compare
… OffsetOutOfRange exception
495df92 to
50d898a
Compare
voonhous
pushed a commit
to voonhous/hudi
that referenced
this pull request
Apr 8, 2025
… OffsetOutOfRange exception (apache#12762) (cherry picked from commit 6edf209)
voonhous
pushed a commit
to voonhous/hudi
that referenced
this pull request
Apr 8, 2025
… OffsetOutOfRange exception (apache#12762) (cherry picked from commit 6edf209)
voonhous
pushed a commit
to voonhous/hudi
that referenced
this pull request
Apr 9, 2025
… OffsetOutOfRange exception (apache#12762) (cherry picked from commit 6edf209)
voonhous
pushed a commit
to voonhous/hudi
that referenced
this pull request
Apr 15, 2025
… OffsetOutOfRange exception (apache#12762) (cherry picked from commit 6edf209)
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.
Change Logs
Streams reading from Kafka source can result in OffsetOutOfRangeException when trying to read messages that are out of range for a partition. This could happen because messages may expire while the job is progressing due to retention
The idea is to get topic retention config and try to move the starting offset forward by some buffer (configurable), to avoid keep losing data due to successive failures
Kafka has time and size based retention but in this PR we are only taking time based retention into account.
Impact
No API changes
Risk level (write none, low medium or high below)
No risk as such as message skipping based on retention only happens if desired config is enabled by the user
Documentation Update
Describe any necessary documentation update if there is any new feature, config, or user-facing change. If not, put "none".
ticket number here and follow the instruction to make
changes to the website.
This PR introduces a new config: https://github.com/apache/hudi/pull/12762/files#diff-f4175c9ad2bf10bb31a3ddf52cf922ae555c65b387dfe305ed760d27a11bc4d1R170
Contributor's checklist