Repository navigation
Cherry pick #109082 to 26.5: Split remote database and data lake visibility settings - #109220
Merged
robot-ch-test-poll3 merged 10 commits intoJul 3, 2026
Merged
Conversation
Restore `show_data_lake_catalogs_in_system_tables` for `DataLakeCatalog` visibility in system introspection tables. Add `show_remote_databases_in_system_tables`, enabled by default, for `MySQL` and `PostgreSQL` databases only. Keep separate `IDatabase` APIs so data lake catalogs and remote databases are classified independently.
Record `show_remote_databases_in_system_tables` with default `true` where the setting is introduced, and update the `26.6` settings reference accordingly.
Keep the existing remote database integration tests focused on the `system.columns` visibility behavior restored by this PR. The explicit `SHOW COLUMNS` and `SHOW INDEX` checks were added together with the original `show_remote_databases_in_system_tables` change, but they are not needed for the default remote database visibility coverage.
Add a `show_remote_databases_in_system_tables` entry to the 26.7 settings changes history block so the Upgrade check passes: the baseline release is 26.6, and the check requires an entry in a version block newer than the baseline. Keep the values as `true, true` so `compatibility` mode does not roll the restored default back to `false`. Tag `04210_show_remote_databases_in_system_tables` as `no-parallel`. The test registers `PostgreSQL` and `MySQL` databases on an unreachable host; with the new default `show_remote_databases_in_system_tables = true` they are visible in `system.tables`, `system.columns` and `system.completions`, so concurrent tests that scan those tables without a database filter timed out with `POSTGRESQL_CONNECTION_FAILURE`. This caused failures in 00564_temporary_table_management, 01518_cast_nullable_virtual_system_column, 03566_system_completions_table, 03602_query_system_tables_definer and 00696_system_columns_limit. CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=109082&sha=latest&name_0=PR
Keep `show_remote_databases_in_system_tables` as a single `26.6` settings-history entry with default value `true`. This avoids duplicate history entries while keeping the restored default visible in the generated compatibility reference.
Revert commit e79fd5f and return to the layout from commit 9c7c5ab and commit 1fc129c: `show_remote_databases_in_system_tables` is recorded as `{true, true}` in both the `26.2` and the `26.7` settings-history blocks. The `26.2` entry covers the planned backports to 26.2+ release branches, and the `26.7` entry satisfies the Upgrade check, which requires an entry in a block newer than the 26.6 baseline release. Keeping both values `true` means `compatibility` mode never rolls the restored default back to `false`, matching the pre-#104416 behavior where `MySQL` and `PostgreSQL` databases were always visible.
…system-tables Split remote database and data lake visibility settings
…ypick/26.5/109082 # Conflicts: # src/Interpreters/InterpreterSystemQuery.cpp # src/Storages/System/StorageSystemConstraints.cpp # src/Storages/System/StorageSystemIcebergFiles.cpp # tests/queries/0_stateless/02995_settings_26_4_1.tsv
Contributor
There was a problem hiding this comment.
Pull request overview
Backports upstream change that separates visibility controls for data-lake catalogs vs remote SQL databases in system tables, restoring the original semantics for show_data_lake_catalogs_in_system_tables while keeping MySQL/PostgreSQL visibility independently configurable.
Changes:
- Reintroduces
show_data_lake_catalogs_in_system_tables(data-lake only) and makesshow_remote_databases_in_system_tables(MySQL/PostgreSQL only) default totrue. - Extends
DatabaseCatalog/IDatabasewith explicit data-lake catalog classification and updates system-table database enumeration accordingly. - Updates stateless + integration tests to reflect the split settings and new defaults.
Reviewed changes
Copilot reviewed 41 out of 41 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/queries/0_stateless/04210_show_remote_databases_in_system_tables.sql | Updates stateless test expectations and adds tags for remote DB visibility behavior. |
| tests/queries/0_stateless/04210_show_remote_databases_in_system_tables.reference | Updates expected output for the revised settings behavior. |
| tests/queries/0_stateless/02995_settings_26_4_1.tsv | Adds the new setting to the expected settings snapshot. |
| tests/integration/test_postgresql_database_engine/test.py | Aligns PostgreSQL integration assertions with new default visibility behavior. |
| tests/integration/test_mysql57_database_engine/test.py | Aligns MySQL 5.7 integration assertions with new default visibility behavior. |
| tests/integration/test_mysql_database_engine/test.py | Aligns MySQL integration assertions with new default visibility behavior. |
| src/Storages/System/StorageSystemTables.cpp | Uses both settings to control inclusion of datalake catalogs vs remote DBs in system.tables. |
| src/Storages/System/StorageSystemReplicationQueue.cpp | Switches database enumeration filter to exclude datalake catalogs. |
| src/Storages/System/StorageSystemReplicas.cpp | Switches database enumeration filter to exclude datalake catalogs. |
| src/Storages/System/StorageSystemProjections.cpp | Switches database enumeration filter to exclude datalake catalogs. |
| src/Storages/System/StorageSystemPartsBase.cpp | Switches database enumeration filter to exclude datalake catalogs. |
| src/Storages/System/StorageSystemPartMovesBetweenShards.cpp | Switches database enumeration filter to exclude datalake catalogs. |
| src/Storages/System/StorageSystemObjectStorageQueueSettings.cpp | Switches database enumeration filter to exclude datalake catalogs. |
| src/Storages/System/StorageSystemMutations.cpp | Switches database enumeration filter to exclude datalake catalogs. |
| src/Storages/System/StorageSystemKafkaConsumers.cpp | Switches database enumeration filter to exclude datalake catalogs. |
| src/Storages/System/StorageSystemIcebergHistory.cpp | Ensures Iceberg history can enumerate both datalake catalogs and remote DBs when needed. |
| src/Storages/System/StorageSystemGraphite.cpp | Switches database enumeration filter to exclude datalake catalogs. |
| src/Storages/System/StorageSystemDistributionQueue.cpp | Switches database enumeration filter to exclude datalake catalogs. |
| src/Storages/System/StorageSystemDataSkippingIndices.cpp | Switches database enumeration filter to exclude datalake catalogs. |
| src/Storages/System/StorageSystemDatabases.cpp | Ensures system.databases always includes datalake catalogs and remote DBs. |
| src/Storages/System/StorageSystemDatabaseReplicas.cpp | Switches database enumeration filter to exclude datalake catalogs. |
| src/Storages/System/StorageSystemCompletions.cpp | Uses both settings to control DB/table/column completion enumeration. |
| src/Storages/System/StorageSystemColumns.cpp | Uses both settings to control inclusion of datalake catalogs vs remote DBs in system.columns. |
| src/Storages/System/StorageSystemClusters.cpp | Switches database enumeration filter to exclude datalake catalogs. |
| src/Storages/StorageMerge.cpp | Ensures Merge storage DB-regexp expansion can include both datalake catalogs and remote DBs. |
| src/Storages/RocksDB/StorageSystemRocksDB.cpp | Switches database enumeration filter to exclude datalake catalogs. |
| src/Server/ReplicasStatusHandler.cpp | Switches database enumeration filter to exclude datalake catalogs. |
| src/Interpreters/ServerAsynchronousMetrics.cpp | Switches database enumeration filter to exclude datalake catalogs. |
| src/Interpreters/loadMetadata.cpp | Switches database enumeration filter to exclude datalake catalogs. |
| src/Interpreters/InterpreterSystemQuery.cpp | Updates system-query DB enumeration to exclude datalake catalogs. |
| src/Interpreters/InterpreterShowTablesQuery.cpp | Forces visibility settings on for explicit SHOW TABLES against datalake/remote DBs. |
| src/Interpreters/InterpreterCreateQuery.cpp | Counts all DBs (including datalake/remote) for database-count limit enforcement. |
| src/Interpreters/InterpreterCheckQuery.cpp | Switches database enumeration filter to exclude datalake catalogs. |
| src/Interpreters/DatabaseCatalog.h | Splits DB enumeration options into with_datalake_catalogs vs with_remote_databases. |
| src/Interpreters/DatabaseCatalog.cpp | Implements separate filtered DB caches and hint behavior for datalake vs remote DBs. |
| src/Databases/IDatabase.h | Introduces isDatalakeCatalog alongside isRemoteDatabase. |
| src/Databases/DataLake/DatabaseDataLake.h | Marks DataLake DB as isDatalakeCatalog. |
| src/Core/SettingsChangesHistory.cpp | Updates settings change history entry to reflect the new setting semantics. |
| src/Core/Settings.cpp | Restores show_data_lake_catalogs_in_system_tables and sets show_remote_databases_in_system_tables default to true. |
| src/Client/BuzzHouse/Generator/SessionSettings.cpp | Adds fuzzing/session generation support for show_data_lake_catalogs_in_system_tables. |
| src/Backups/BackupEntriesCollector.cpp | Ensures backup metadata enumeration includes both datalake catalogs and remote DBs when backing up all DBs. |
| else | ||
| { | ||
| for (auto & elem : DatabaseCatalog::instance().getDatabases(GetDatabasesOptions{.with_remote_databases = false})) | ||
| for (auto & elem : DatabaseCatalog::instance().getDatabases(GetDatabasesOptions{.with_datalake_catalogs = false})) |
| else if (query.is_drop_whole_replica) | ||
| { | ||
| auto databases = DatabaseCatalog::instance().getDatabases(GetDatabasesOptions{.with_remote_databases = false}); | ||
| auto databases = DatabaseCatalog::instance().getDatabases(GetDatabasesOptions{.with_datalake_catalogs = false}); |
|
|
||
| /// This check is actually redundant, but it may prevent from some user mistakes | ||
| for (auto & elem : DatabaseCatalog::instance().getDatabases(GetDatabasesOptions{.with_remote_databases = false})) | ||
| for (auto & elem : DatabaseCatalog::instance().getDatabases(GetDatabasesOptions{.with_datalake_catalogs = false})) |
| LOG_TRACE(log, "{} primary keys for all tables", load ? "Loading" : "Unloading"); | ||
|
|
||
| for (auto & database : DatabaseCatalog::instance().getDatabases(GetDatabasesOptions{.with_remote_databases = false})) | ||
| for (auto & database : DatabaseCatalog::instance().getDatabases(GetDatabasesOptions{.with_datalake_catalogs = false})) |
| } | ||
|
|
||
| for (auto & database : getDatabases(GetDatabasesOptions{.with_remote_databases = false})) | ||
| for (auto & database : getDatabases(GetDatabasesOptions{.with_datalake_catalogs = false})) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Original pull-request #109082
Do not merge this PR manually
This pull-request is a first step of an automated backporting.
It contains changes similar to calling
git cherry-picklocally.If you intend to continue backporting the changes, then resolve all conflicts if any.
Otherwise, if you do not want to backport them, then just close this pull-request.
The check results does not matter at this step - you can safely ignore them.
Troubleshooting
If the conflicts were resolved in a wrong way
If this cherry-pick PR is completely screwed by a wrong conflicts resolution, and you want to recreate it:
pr-cherrypicklabel from the PRYou also need to check the Original pull-request for
pr-backports-createdlabel, and delete if it's presented thereThe PR source
The PR is created in the CI job