Repository navigation
Do not list tables of data lake catalogs and Remote databases before shutdown - #133669
Conversation
…e shutdown `DatabaseCatalog::shutdownImpl` enumerates the tables of every user database to flush `Buffer` tables before any database goes away. For a `DataLakeCatalog` database, `getTablesIterator` initializes the catalog client and requests the table list from the catalog; for a `Remote` database it requests it from another server. When that server is unreachable, the request is retried with a backoff, and the server does not stop: the main thread sleeps in `ReadWriteBufferFromHTTP::waitBeforeRetry` under `RestCatalog::loadConfig`, and the stress test reports "Possible deadlock on shutdown (see gdb.log)". These databases hold no `Buffer` tables, so skip them in this loop. CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=133447&sha=23b710d2e229f81edb3e90504add23c04bd6526f&name_0=PR&name_1=Stress%20test%20(amd_debug) Related: #133447 Co-Authored-By: Claude Fable 5.2 <[email protected]>
|
Workflow [PR], commit [f246ec2] Summary: ✅
AI ReviewSummaryThe PR avoids remote table enumeration during the pre-shutdown Missing context / blind spots
Final VerdictStatus: ✅ Approve |
…down `DatabaseOverlayReadOnly::getTablesIterator` forwards the listing to its source databases, so an `Overlay` over a data lake catalog or a `Remote` database still requested the table list from another server in `DatabaseCatalog::shutdownImpl`, although the source itself is skipped. Add `IDatabase::ownsTables`, which is false for `DatabaseOverlayReadOnly`, and skip such databases in the pass that flushes `Buffer` tables. The tables it returns are `StorageAlias` objects, which hold no buffered rows, and its sources are visited by the same loop on their own. Co-Authored-By: Claude Fable 5.2 <[email protected]>
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units167 translation units recompiled, 1200 s compile time in total, 167 of them have a recent master baseline. |
Related: #133447
Related: #118985
DatabaseCatalog::shutdownImpllists the tables of every user database to flushBuffertables before any database goes away (#118985). For aDataLakeCatalogdatabase,getTablesIteratorinitializes the catalog client and requests the table list from the catalog; for aRemotedatabase it requests it from another server. When that server is unreachable, the request is retried with a backoff and the server does not stop. In the stress test below the main thread sleeps inReadWriteBufferFromHTTP::waitBeforeRetryunderRestCatalog::loadConfig←DatabaseDataLake::getTablesIterator←DatabaseCatalog::shutdownImpl, and the check reportsPossible deadlock on shutdown (see gdb.log), after which the server is killed.These databases hold no
Buffertables, so they are skipped in this loop. AnOverlaydatabase is skipped as well: it forwards the listing to its sources, which can be such databases, and theStorageAliastables it returns hold no buffered rows.CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=133447&sha=23b710d2e229f81edb3e90504add23c04bd6526f&name_0=PR&name_1=Stress%20test%20(amd_debug)
No test is added: the hang needs a catalog that becomes unreachable before the server stops, and it is what the stress test already exercises. Only the changed translation units were compiled locally.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
The server no longer requests the list of tables from a data lake catalog or a
Remotedatabase while shutting down, which delayed the shutdown for a long time when the catalog or the remote server was unreachable.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/133669]
Version info
26.12.1.479-master(included in26.12and later)