Skip to content

fix(s3wal): improve next() logic to handle pre-fetched records#3087

Merged
superhx merged 1 commit into
1.6from
fix_s3wal_next
Dec 8, 2025
Merged

fix(s3wal): improve next() logic to handle pre-fetched records#3087
superhx merged 1 commit into
1.6from
fix_s3wal_next

Conversation

@superhx
Copy link
Copy Markdown
Collaborator

@superhx superhx commented Dec 8, 2025

  • [Bug] the nextRecord is not cleaned up when directly calling #next without calling #hasNext
  • The bug won't happen in production because each #next is called after #hasNext

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug in the RecoverIterator.next() method where the nextRecord field was not properly cleared in all code paths, potentially causing the same record to be returned multiple times.

Key Changes:

  • Consolidated the two separate conditional checks into a single if-else statement with a combined condition
  • Added explanatory comments describing when nextRecord is already available versus when hasNext() populates it

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@superhx superhx merged commit 608bc01 into 1.6 Dec 8, 2025
12 of 13 checks passed
@superhx superhx deleted the fix_s3wal_next branch December 8, 2025 09:07
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.

3 participants