Skip to content

Conversation

@Prajwal-banakar
Copy link
Contributor

@Prajwal-banakar Prajwal-banakar commented Jan 14, 2026

Purpose

Linked issue: close #2301

The purpose of this change is to fix a bug where the LogScanner enters an infinite retry loop when a table is dropped during an active scan. Instead of logging "unknown table or bucket" warnings indefinitely, the scanner now correctly identifies the dropped table via a metadata refresh and terminates with a TableNotExistException.

Brief change log

Metadata Management: Updated MetadataUtils.java to properly handle cache eviction of dropped tables during metadata updates.
Log Fetcher Logic: Modified LogFetcher.java to catch fetch errors and trigger a metadata refresh to verify if the table still exists.
Exception Handling: Implemented logic to distinguish between a truly deleted table and a recreated table (new ID).
If the table is deleted, it throws TableNotExistException to break the retry loop.
If the table is recreated, it updates the internal TableId and continues fetching, maintaining compatibility with Flink failover requirements.

Tests

Verified the fix with the following tests:

New Integration Test: Added testDropTableWhileScanning in LogScannerITCase.java which simulates a table drop during a scan and asserts that the scanner fails gracefully.
Regression Testing: Verified that LogFetcherITCase.java passes, confirming the scanner correctly identifies table recreation.
Engine Integration: Verified that Flink118TableSourceFailOverITCase.java passes, ensuring the change does not break Flink's ability to recover from table recreation during a job.
Full Module Verification: Ran ./mvnw test -pl fluss-client -o to ensure no regressions were introduced across the 124 existing client tests.

API and Format

This change does not affect the external public API of Fluss.
This change does not affect the storage format.

Documentation

This change does not introduce a new feature and does not require a documentation update.

@Prajwal-banakar Prajwal-banakar changed the title [FLUSS-2301] Fail Log Scanner when table is dropped during scan [Client] Fail Log Scanner when table is dropped during scan Jan 14, 2026
Copy link
Contributor

@luoyuxia luoyuxia left a comment

Choose a reason for hiding this comment

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

@swuferhong Could you please help review this?

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.

Drop a table during log scanner scan records should fail the scanner

2 participants