Repository navigation
Report object storage disk as local when it is using local object storage - #110665
Conversation
|
Workflow [PR], commit [b363814] Summary: ✅
AI ReviewSummaryThis PR makes PR Metadata
Suggested replacement: ### Changelog category (leave one):
- Improvement
### Changelog entry:
Dynamic `local_blob_storage` disks now report `is_remote = 0`, and custom disk creation performs additional local-path validation for local and object-storage disks.Findings❌ Blockers
Tests
Final Verdict
LLVM Coverage ReportMeasured on commit b363814.
Changed lines: Changed C/C++ lines covered: 198/229 (86.46%) · Uncovered code |
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 41/65 (63.08%) · Uncovered code |
Since ClickHouse#110665 a custom disk with `object_storage_type = local` must live under `custom_local_disks_base_directory`, otherwise `CREATE TABLE ... disk = disk(...)` fails with `BAD_ARGUMENTS` ("Base path for custom local disks must be defined in config file"). The three `SYSTEM RESTART DISK` tests of `test_part_loading_tree_rollback` create such disks and errored at fixture setup after merging master. Point the setting at the directory the tests already use, as `test_attach_backup_from_s3_plain` does for its local disk. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The tests of #119850 also cover behaviour that came from #110665, which was not backported to 26.8 (its cherry-pick was closed). In 26.8 the `custom_local_disks_base_directory` check of a disk defined in SQL runs after the disk is registered and its directory created, does not cover object storage disks over the local filesystem (they are reported as remote), and exempts a disk named `backup`. Keep the part that this backport fixes: `ALTER TABLE ... MODIFY SETTING disk = disk(...)` with a local path outside the base directory is now rejected, and the settings constraints still compare the resolved disk. Drop the checks of registration and directory creation, the object storage cases, and the integration test for a `locations` child with a local backend, which all depend on #110665. CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=124151&sha=1348e3964bcfa0dfa2569720e5461b11401f7b5b&name_0=BackportPR PR: #124151 Co-Authored-By: Claude Opus 5.5 <[email protected]>
26.7 does not have #110665, so the `custom_local_disks_base_directory` fence still runs in `getOrCreateCustomDisk` after the disk is created, skips object storage disks over the local filesystem, and exempts a disk named `backup`. The cases that depend on that change (local object storage, `metadata_path`, the `backup` name, and the integration case for a `locations` child of type `local`) are dropped, and the stateless test checks only that the `ALTER` is rejected, not that nothing is left behind. https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=124150&sha=da3fccc21af70c4f21ec0718646f39d45812d15a&name_0=BackportPR #124150 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ypick/26.7/124453 Adapted to the pre-#110665 `ObjectStorageFactory::create` signature of this release branch: `run_remote_host_filter_check` is appended after the existing `skip_access_check` parameter, and `registerDiskObjectStorage` names its `custom_disk` argument to derive it. The `url.checkRemoteHostFilter` call in `StorageS3Configuration::check` keeps this branch's `checkAndNormalizeHeaders`. Co-Authored-By: Claude Fable 5.1 <[email protected]>
…ypick/26.8/124453 Adapted to the pre-#110665 `ObjectStorageFactory::create` signature of this release branch: `run_remote_host_filter_check` is appended after the existing `skip_access_check` parameter, and `registerDiskObjectStorage` names its `custom_disk` argument to derive it. The `url.checkRemoteHostFilter` call in `StorageS3Configuration::check` keeps this branch's `checkAndNormalizeHeaders`. Co-Authored-By: Claude Fable 5.1 <[email protected]>
…ypick/26.9/124453 Adapted to the pre-#110665 `ObjectStorageFactory::create` signature of this release branch: `run_remote_host_filter_check` is appended after the existing `skip_access_check` parameter, and `registerDiskObjectStorage` names its `custom_disk` argument to derive it. The `url.checkRemoteHostFilter` call in `StorageS3Configuration::check` keeps this branch's `checkAndNormalizeHeaders`. Co-Authored-By: Claude Fable 5.1 <[email protected]>
…ypick/26.3/124453 Adapted to the pre-#110665 `ObjectStorageFactory::create` signature of this release branch: `run_remote_host_filter_check` is appended after the existing `skip_access_check` parameter, and `registerDiskObjectStorage` names its `custom_disk` argument to derive it. The `url.checkRemoteHostFilter` call in `StorageS3Configuration::check` keeps this branch's `checkAndNormalizeHeaders`. 26.3 additionally lacks `ServerCredentialMarkerInjector`, `for_system_database` and `DistributedPlanExecutor.cpp`, so `DiskFromAST::createCustomDisk` keeps its two-argument form and only the `DiskConfigurationFlattener` is driven by `visitBottomUp`; the S3 creator computes `uri` first, so the host-filter check follows the settings line. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Adapted to this branch, which carries #124453 on the pre-#110665 factory API: the third `ObjectStorageFactory::create` parameter becomes `RemoteHostFilterCheck remote_host_filter_check` next to `skip_access_check`, and `registerDiskObjectStorage` derives it from its `attach` and `custom_disk` arguments. `RemoteHostFilter::checkURL` keeps this branch's unmasked message and only gains the early returns. `DatabaseFactory::Arguments` has no `is_restore_from_backup` here, so only `isLoadingFromExistingMetadata` is added. The backward-compatibility test starts from the pinned image `26.3.50.11` (built 2026-10-13, before #124453 reached this branch) instead of the floating `26.8` tag, which will soon include the check itself and would fail to create the disks. 26.3 keeps its non-static `registerS3ObjectStorage`, its single-line `storage_settings->loadFromQuery` call and has no `DistributedPlanExecutor.cpp`. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Adapted to this branch, which carries #124453 on the pre-#110665 factory API: the third `ObjectStorageFactory::create` parameter becomes `RemoteHostFilterCheck remote_host_filter_check` next to `skip_access_check`, and `registerDiskObjectStorage` derives it from its `attach` and `custom_disk` arguments. `RemoteHostFilter::checkURL` keeps this branch's unmasked message and only gains the early returns. `DatabaseFactory::Arguments` has no `is_restore_from_backup` here, so only `isLoadingFromExistingMetadata` is added. The backward-compatibility test starts from the pinned image `26.9.18.11` (built 2026-10-13, before #124453 reached this branch) instead of the floating `26.8` tag, which will soon include the check itself and would fail to create the disks. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Adapted to this branch, which carries #124453 on the pre-#110665 factory API: the third `ObjectStorageFactory::create` parameter becomes `RemoteHostFilterCheck remote_host_filter_check` next to `skip_access_check`, and `registerDiskObjectStorage` derives it from its `attach` and `custom_disk` arguments. `RemoteHostFilter::checkURL` keeps this branch's unmasked message and only gains the early returns. `DatabaseFactory::Arguments` has no `is_restore_from_backup` here, so only `isLoadingFromExistingMetadata` is added. The backward-compatibility test starts from the pinned image `26.8.26.12` (built 2026-10-13, before #124453 reached this branch) instead of the floating `26.8` tag, which will soon include the check itself and would fail to create the disks. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Adapted to this branch, which carries #124453 on the pre-#110665 factory API: the third `ObjectStorageFactory::create` parameter becomes `RemoteHostFilterCheck remote_host_filter_check` next to `skip_access_check`, and `registerDiskObjectStorage` derives it from its `attach` and `custom_disk` arguments. `RemoteHostFilter::checkURL` keeps this branch's unmasked message and only gains the early returns. `DatabaseFactory::Arguments` has no `is_restore_from_backup` here, so only `isLoadingFromExistingMetadata` is added. The backward-compatibility test starts from the pinned image `26.7.29.12` (built 2026-10-13, before #124453 reached this branch) instead of the floating `26.8` tag, which will soon include the check itself and would fail to create the disks. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Cherry pick #110665 to 26.3: Report object storage disk as local when it is using local object storage
… is using local object storage
Cherry pick #110665 to 26.8: Report object storage disk as local when it is using local object storage
… is using local object storage
Cherry pick #110665 to 26.9: Report object storage disk as local when it is using local object storage
… is using local object storage
Backport #110665 to 26.3: Report object storage disk as local when it is using local object storage
Backport #110665 to 26.9: Report object storage disk as local when it is using local object storage
Backport #110665 to 26.8: Report object storage disk as local when it is using local object storage
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
This patch changes the
isRemoteoutcome forDiskObjectStorageover local object storage and improves local paths check for complex disks.Workflow [PR]
Sync PR [sync-upstream/pr/110665]
Version info
26.10.1.422-master(included in26.10and later)26.9.36.2,26.8.44.2,26.3.69.4