Repository navigation
Cherry pick #124930 to 26.7: Fix ATTACH for S3 disks created without 'remote_url_allow_hosts - #125786
Merged
robot-ch-test-poll merged 10 commits intoOct 14, 2026
Merged
Conversation
… for the disk check Two paths still enforced `remote_url_allow_hosts` on definitions that the server stored itself: - Databases at server start. `loadDatabase` runs the stored `ATTACH DATABASE` with `create = true`, so `setForceAttach` is skipped and the mode is `ATTACH`, not `FORCE_ATTACH`. The server did not start in CI with a database whose metadata disk points to an endpoint outside the list. The signal for this path is `is_metadata_replay`. - A short `ATTACH TABLE t` or `ATTACH DATABASE db` reads the definition back from the metadata file and marks it with `attach_short_syntax`, while the mode is `ATTACH`. `DatabaseFactory::Arguments::isLoadingFromExistingMetadata` combines the mode, `is_metadata_replay` and `attach_short_syntax` for the database metadata disk. `registerStorageMergeTree` adds `attach_short_syntax` to the mode for tables. A user `ATTACH` with a full definition keeps `attach_short_syntax` false and stays enforced. The log line, the `system.warnings` text, the comments and the docs name the third event. Co-Authored-By: Claude Fable 5.1 <[email protected]>
…`DETACH PERMANENTLY` In an `Atomic` database a full-definition `ATTACH TABLE` needs a `UUID`; without it the query fails with `INCORRECT_QUERY` before the disk is built, which is what CI reported. The case now passes a `UUID` and expects `UNACCEPTABLE_URL`. A table detached permanently before the upgrade has no disk at server start, so the short `ATTACH TABLE t_detached` on the new binary is the first creation of its disk: it must be accepted and reported. The database case adds a `DETACH DATABASE` / `ATTACH DATABASE` cycle and uses the default restart wait. Co-Authored-By: Claude Fable 5.1 <[email protected]>
…sk-remote-host-filter-on-load
…sk-remote-host-filter-on-load
…rt and `UNDROP` The previous commit set the `is_loading_from_existing_metadata` flag for a short `ATTACH TABLE t` / `ATTACH DATABASE db`. That flag is shared by every custom-disk check (`dynamic_disk_allow_*`, the server-credentials marker, the local-paths check, the disk-name and settings-hash checks), so the change silenced all of them for the short form, not only the host filter. The host filter now follows the other disk checks: skipped when the server replays metadata it stored itself, at start (`is_metadata_replay`, mode `FORCE_ATTACH` / `FORCE_RESTORE`) and on `UNDROP`, enforced for every user `ATTACH`, short or with a definition. A table parked with `DETACH ... PERMANENTLY` before the upgrade gets `UNACCEPTABLE_URL` on its first `ATTACH` until the operator adds the `<s3_bucket>` entry; `DETACH` and `ATTACH` in a running server reuse the disk built at start and are not affected. Co-Authored-By: Claude Fable 5.1 <[email protected]>
…er the entry is added The permanently detached table now expects `UNACCEPTABLE_URL` on its first `ATTACH`, consistent with `CREATE` and with a full-definition `ATTACH`. The test then adds `<s3_bucket>minio1:9001/root</s3_bucket>` to the allow-list, reloads the config and attaches the table without a restart. The `DETACH DATABASE` / `ATTACH DATABASE` cycle stays as a check that a reused metadata disk is not re-validated. Co-Authored-By: Claude Fable 5.1 <[email protected]>
A table dropped before the upgrade stays in the drop queue and is rebuilt at server start from `metadata_dropped` under `FORCE_RESTORE`. The test drops a table on a third disk before the restart, checks that two disks were reported, and runs `UNDROP TABLE` on the new binary. The drop delay is raised to one hour in the test config so the queue survives a slow restart under sanitizers. The docs sentence now says what the code does: the exemption is the rebuild at start, which is what keeps `UNDROP TABLE` working. Co-Authored-By: Claude Fable 5.1 <[email protected]>
…te-host-filter-on-load Fix ATTACH for S3 disks created without 'remote_url_allow_hosts
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]>
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 #124930
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.
Before you resolve anything
Conflicts are often caused by a prerequisite change that has not been backported yet, rather than by a real divergence. The bot re-tries this cherry-pick against the release branch on every run, so if that is the case here it will merge itself as soon as the prerequisite lands, and you will see a comment saying so. Manual resolution is only needed while the conflict persists.
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