Skip to content

[client] Prevent EOF during concurrent remote log downloads - #3816

Open
fxbing wants to merge 1 commit into
apache:mainfrom
fxbing:fix/20260730-multi-scanner-remote-log-eof
Open

[client] Prevent EOF during concurrent remote log downloads#3816
fxbing wants to merge 1 commit into
apache:mainfrom
fxbing:fix/20260730-multi-scanner-remote-log-eof

Conversation

@fxbing

@fxbing fxbing commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Purpose

Linked issue: close #3815

LogFetcher could reuse a fetchable-bucket snapshot captured before a metadata update. If a response populated the buffer during that update, the same bucket could be fetched again. A duplicate remote-log download then truncated the local segment while an existing reader was still using it, causing Unexpected EOF.

Brief change log

  • Recompute fetchable buckets under the LogFetcher lock after metadata updates.
  • Download each remote segment to a unique same-directory temporary file, then atomically publish the completed file.
  • Clean up temporary files when a download or publish fails.

Tests

  • LogFetcherTest and RemoteLogDownloaderTest: 13 tests passed.
  • ./mvnw -o -pl fluss-client validate

API and Format

No public API or storage format changes.

Documentation

No documentation changes are required.

Generative AI disclosure

Yes. OpenAI Codex was used to assist with implementation and review.

- Recheck fetchable buckets under the fetcher lock to avoid stale duplicate requests.
- Download into unique temporary files and atomically publish complete segments.
- Add deterministic regressions for stale fetch snapshots and open-reader safety.
@fxbing fxbing closed this Jul 31, 2026
@fxbing fxbing reopened this Jul 31, 2026
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.

[client] Concurrent remote log downloads can cause Unexpected EOF

1 participant