Skip to content

[hotfix] Check if batches is empty to prevent readNextOffset from throwing NoSuchElementException.#2945

Open
pisceslj wants to merge 1 commit intoapache:mainfrom
pisceslj:fix_NoSuchElementException_when_recover_log
Open

[hotfix] Check if batches is empty to prevent readNextOffset from throwing NoSuchElementException.#2945
pisceslj wants to merge 1 commit intoapache:mainfrom
pisceslj:fix_NoSuchElementException_when_recover_log

Conversation

@pisceslj
Copy link
Copy Markdown
Contributor

@pisceslj pisceslj commented Mar 27, 2026

Purpose

Linked issue: Fix NoSuchElementException that occurs when recovering log segments #2943

Fix NoSuchElementException that occurs when recovering log segments

Brief change log

Use Iterables.isEmpty to check if batches is empty in the readNextOffset function. If batches is empty, directly return the baseOffset.

Tests

API and Format

No

Documentation

No

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.

1 participant