[Feature] Optimize CDC sync database action to avoid blocking on listTables operation with large number of tables
- Lingua principale
- Java
- Stelle
- 3.4k
- Fork
- 1.4k
- Merge medio
- 1g 9h
- PR unite (30g)
- 423
Descrizione
### Search before asking
- [x] I searched in the [issues](https://github.com/apache/paimon/issues) and found nothing similar.
### Motivation
When using CDC synchronous database operations on a database containing a large number of tables (hundreds of thousands), the "catalog. listTables (database)" operation in "SyncDataActionBase" may take a long time to complete, causing the entire synchronization job to start blocking for a long time. This will significantly affect the duration of CDC synchronization task initiation.
### Solution
### Current Behavior
The current implementation calls `catalog.listTables(database)` during initialization and maintains a `createdTables` set to track table creation status. This approach:
1. Blocks the entire sync process while listing all tables
2. Consumes unnecessary memory to maintain the `createdTables` set
3. Performs redundant operations when tables are created lazily
### Expected Behavior
The sync process should:
1. Avoid blocking on `listTables` operation during initialization
2. Create tables lazily when needed without maintaining a global `createdTables` set
3. Improve overall performance for databases with large numbers of tables
### Solution
Optimize the table creation logic by:
1. Removing the upfront `listTables` call in `SyncDatabaseActionBase`
2. Eliminating the `createdTables` set from `RichCdcMultiplexRecordEventParser`
3. Implementing lazy table creation in `CdcDynamicTableParsingProcessFunction` with existence checks
### Anything else?
_No response_
### Are you willing to submit a PR?
- [x] I'm willing to submit a PR!
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Leggi prima SyncDatabaseActionBase e RichCdcMultiplexRecordEventParser, quindi segui la creazione delle tabelle tramite CdcDynamicTableParsingProcessFunction. Conferma che il percorso di inizializzazione non si blocca più su catalog.listTables(database), che il tracciamento globale di createdTables è stato rimosso e che le tabelle vengono create pigramente con controlli di esistenza.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- java
- Ambito
- databases, stream-processing
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 35/100