Repository navigation
[flink][cdc] Skip dropped tables when restoring source splits - #11368
zhangyue19921010 wants to merge 2 commits into
Conversation
|
CI stopped in JDK setup (tar exit 2). Could you rerun the failed job? |
JingsongLi
left a comment
There was a problem hiding this comment.
This fixes a documented recovery failure for database-wide CDC. I ran 39 tests on Flink 1, including the pending and assigned split regressions and the savepoint/rescale integration test. All passed. A separate reader test found a regression for warehouses with many active tables.
| Identifier identifier = nextSplit.getIdentifier(); | ||
| currentSplitId = nextSplit.splitId(); | ||
| // Reader state can contain splits for a table removed while the job was stopped. | ||
| if (!tableManager.isTableAvailable(identifier)) { |
There was a problem hiding this comment.
[P2] Keep catalog lookups off the warm split path. This availability check runs for newly assigned splits too. I read Parquet splits from 257 ordinary append tables in round-robin order through a single reader with the default cache sizes. After warm-up, the base reader made zero additional Catalog.getTable calls and this reader made 257 per round. The 1,024-entry schema and read caches still had every table, but the 256-entry table cache missed on every split. With a REST catalog and catalog.properties.cache-enabled=false, that means a synchronous GetTable request per split on the fetch thread. Please limit the check to restored splits, or detect missing tables when loading an uncached schema or reader.
There was a problem hiding this comment.
Fixed in 5a573a9: the availability check now happens only when the split schema is not cached (getTableSchemaIfAvailable), so warm splits make no extra Catalog.getTable calls while restored splits, which start with empty caches, still skip dropped tables (covered by a new counting-catalog test).
Purpose
Fixes #11367.
When a Paimon CDC source scans a database or warehouse with
tableunset, restoring after a source table is dropped fails if the checkpoint still contains pending or assigned splits. Skip coordinator splits for tables excluded during metadata restore, and finish reader splits whose table is unavailable when their schema is loaded so remaining tables can continue.This change covers discovery across multiple tables. An explicitly selected missing table still follows the existing discovery behavior.
The catalog is consulted only when a split's schema is not cached, so warm splits make no extra lookups. Successful table lookups remain cached. Missing tables are not cached, and other catalog errors still propagate.
Tests
CDCSourceTableManagerTest,CDCSourceSplitReaderTestandCDCSourceRestoreTest(30 tests) pass with Checkstyle and Spotless enabled.Validated on JDK 11 with Java 8 source target. The new unfinished-split trigger is verified through source APIs and serialized state. The existing Flink integration control drops a table after consuming its rows, then restores and rescales.