Repository navigation
Require the same source and WRITE for queue after_processing - #129383
Conversation
|
Workflow [PR], commit [10e54da] Summary: ✅
AI ReviewSummaryThe PR binds shared queue metadata to a source hash, requires Missing context / blind spots
Findings❌ Blockers
Tests
Final VerdictStatus: ❌ Block Close the literal-source reattachment bypass and add its regression coverage. |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Object file sizes32 object files changed (+55.44 KiB total), 0 added.
716 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only Compile time of recompiled translation units195 translation units recompiled, 1470 s compile time in total, 195 of them have a recent master baseline. Median compile-time ratio to the baselines is ×1.06 (machine-speed difference or a change affecting every TU); per-TU deltas below are relative to that ratio. |
c6a4e04 to
5847815
Compare
The S3KernelHelper constructor detects the region-less AWS endpoint with `url.endpoint.substr(11) == "amazonaws.com"` (11 = length of "https://s3."). For an endpoint of at most 10 characters (`http://a`, `http://s3`, `https://ab`, `http://a:1`), `substr(11)` has pos > size() and throws std::out_of_range, so a DeltaLake table on such an S3-compatible endpoint could not be opened: release builds returned `Code: 1001 ... std::out_of_range`, debug and sanitizer builds aborted on the LOGICAL_ERROR. Found by AST fuzzer (amd_debug, targeted) on PR ClickHouse#129383. Check the length first. The result is unchanged for every endpoint that did not throw: for 11 characters the old `substr(11)` was "" (false), and for longer ones the comparison is the same. The test stops the query with an invalid `delta_lake_snapshot_version` right after the metadata constructor, before the delta-kernel touches the network; host `a` does not resolve, and a DNS failure is not retried by the region probe, so the test is fast and deterministic. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
This change gives up a property we rely on: So I want to suggest a different fix: Sharing a
Both changes are necessary: with only (1), a joiner with a |
after_processingWRITE for queue after_processing
# Conflicts: # tests/queries/0_stateless/05441_s3queue_move_destination_access.sh
…parallel_inserts = 1` throws
# Conflicts: # src/Storages/StorageFactory.h
Backport #129383 to 26.11: Require the same source and `WRITE` for queue `after_processing`
…rypick/26.10/129383 Conflicts: - `registerQueueStorage.cpp`: keep only the `<Poco/URI.h>` include that the PR adds; 26.10 does not include `<Databases/IDatabase.h>`. - `StorageFactory.h`: add the new `getExportAccess` overload without `[[nodiscard]]`, like the other declarations in 26.10. - `05441_s3queue_move_destination_access.sh`: keep the `RESTORE TEMPORARY TABLE` case of 26.10 and add the `RESTORE` case of the PR. - `05366_s3queue_metadata_mismatch_immutable_fields`: 26.10 does not have this test, which was added in #125286. Add it with the cases of the PR. Related: #129383 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ypick/26.9/129383 Conflicts: - `registerQueueStorage.cpp`: keep only the `<Poco/URI.h>` include that the PR adds; 26.9 does not include `<Databases/IDatabase.h>`. 26.9 does not have `isReplayedTableDefinition` and `isSecondaryDDLReplay`, so `strict_metadata_check` uses the same conditions directly, as `registerStorageMergeTree.cpp` does in 26.9. - `StorageFactory.h`: add the new `getExportAccess` overload without `[[nodiscard]]`, like the other declarations in 26.9. - `StorageObjectStorageConfiguration.h`: add only `initialized_from_named_collection`; `is_replayed_definition` is not in 26.9. - `InterpreterAlterQuery.cpp` and `InterpreterAlterQuery.h`: add the `engine` argument to the 26.9 signature of `getRequiredAccessForCommand`. 26.9 does not have `run_as_submitting_user` for `Replicated` databases, so that part of the PR is not backported, and the comment of the `Replicated` case in `05441_s3queue_move_destination_access.sh` says that the initiator checks the grants. - `05441_s3queue_move_destination_access.sh`: keep the `RESTORE TEMPORARY TABLE` case of 26.9 and add the `RESTORE` case of the PR. - `05366_s3queue_metadata_mismatch_immutable_fields`: 26.9 does not have this test, which was added in #125286. Add it with the cases of the PR. Related: #129383 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Cherry pick #129383 to 26.9: Require the same source and `WRITE` for queue `after_processing`
Cherry pick #129383 to 26.10: Require the same source and `WRITE` for queue `after_processing`
…ypick/26.8/129383 Conflicts: - `registerQueueStorage.cpp`: keep only the `<Poco/URI.h>` include that the PR adds. 26.8 does not have the `exclusive` mode, so the PR line that clears the path of an `exclusive` queue is not backported. 26.8 does not have `isReplayedTableDefinition` and `isSecondaryDDLReplay`, so `strict_metadata_check` uses the same conditions directly. - `StorageFactory.h`: add the new `getExportAccess` overload without `[[nodiscard]]`, like the other declarations in 26.8. - `StorageObjectStorageConfiguration.h`: add only `initialized_from_named_collection`; `is_replayed_definition` is not in 26.8. - `InterpreterAlterQuery.cpp` and `InterpreterAlterQuery.h`: add the `engine` argument to the 26.8 signature of `getRequiredAccessForCommand`. 26.8 does not have `run_as_submitting_user` for `Replicated` databases, so that part of the PR is not backported, and the comment of the `Replicated` case in `05441_s3queue_move_destination_access.sh` says that the initiator checks the grants. 26.8 does not look up the table by name again after the access check, and the `ALTER` runs on the table that was checked, so the second check of the PR is not needed. - `05441_s3queue_move_destination_access.sh`: keep the `RESTORE TEMPORARY TABLE` case of 26.8 and add the `RESTORE` case of the PR. - `05366_s3queue_metadata_mismatch_immutable_fields`: 26.8 does not have this test, which was added in #125286. Add it with the cases of the PR, without the case of the `exclusive` mode. Related: #129383 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Cherry pick #129383 to 26.8: Require the same source and `WRITE` for queue `after_processing`
Cherry pick #129383 to 26.3: Require the same source and `WRITE` for queue `after_processing`
…ypick/26.3/129383 Conflicts: - `registerQueueStorage.cpp`: keep only the `<Poco/URI.h>` include that the PR adds. 26.3 does not have the `s3_uri_style` setting, so `getQueueSource` parses the URL without user info with the default style, as 26.3 parses the URL of the table. `StorageAzureConfiguration` in 26.3 has `getNamespace` instead of `getContainer`. 26.3 does not have the `exclusive` mode, so the PR line that clears the path of an `exclusive` queue is not backported. 26.3 does not have `isReplayedTableDefinition` and `isSecondaryDDLReplay`, so `strict_metadata_check` uses the same conditions directly. - `Azure/Configuration.h`: 26.3 does not have `getSasKey`, so the new `getConnectionURLWithoutQuery` reads `connection_params.endpoint.sas_auth`. - `StorageObjectStorageConfiguration.cpp` and `StorageObjectStorageConfiguration.h`: add only `initialized_from_named_collection`. - `StorageFactory.h`: add the new `getExportAccess` overload without `[[nodiscard]]`, like the other declarations in 26.3. - `StorageObjectStorageQueue.cpp`: `alter` in 26.3 takes the mode from `getTableMetadata`, so the settings of the queue on this server come from it too. - `InterpreterAlterQuery.cpp` and `InterpreterAlterQuery.h`: `getRequiredAccess` in 26.3 does not take the table, so it takes the name of the engine, and `executeToTable` passes the engine of the table that is not a stand-in of a table that is not loaded yet. 26.3 does not have `run_as_submitting_user` for `Replicated` databases, so that part of the PR is not backported, and the comment of the `Replicated` case in `05441_s3queue_move_destination_access.sh` says that the initiator checks the grants. 26.3 does not look up the table by name again after the access check, and the `ALTER` runs on the table that was checked, so the second check of the PR is not needed. - `05441_s3queue_move_destination_access.sh`: keep the `RESTORE TEMPORARY TABLE` case of 26.3 and add the `RESTORE` case of the PR. - `05366_s3queue_metadata_mismatch_immutable_fields`: 26.3 does not have this test, which was added in #125286. Add it with the cases of the PR, without the cases of the `exclusive` mode and of `s3_uri_style`. - `test_storage_s3_queue/test_0.py`: the old version of the upgrade test is 25.10, because 26.7 is newer than 26.3. Related: #129383 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Backport #129383 to 26.9: Require the same source and `WRITE` for queue `after_processing`
Backport #129383 to 26.10: Require the same source and `WRITE` for queue `after_processing`
Backport #129383 to 26.8: Require the same source and `WRITE` for queue `after_processing`
The `ALTER` of a setting named in the query also counts as a change when its value differs from the queue's shared or Keeper value (ClickHouse#129383). That comparison used the raw literal, so the current value written as a string (`buckets = '4'`) was a change again: on an `Ordered` queue it was refused because `s3queue_migrate_old_metadata_to_buckets` is not set, and it rewrote the Keeper metadata for the other Keeper settings. Compare the value converted by its setting instead, as for the table definition.
Backport #129383 to 26.3: Require the same source and `WRITE` for queue `after_processing`
Closes: https://github.com/ClickHouse/clickhouse-private/issues/69745
Related: #86907
Tables sharing a
keeper_pathshare oneafter_processing, so a table joining another queue's path could make it delete, move or tag its files. Keeper now stores the source, which must match, these actions needWRITE, andALTERchanges only the settings it names.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fixed a table with the
keeper_pathof anotherS3QueueorAzureQueuemaking it delete, move or tag its source files. The source must now match, and these actions need theWRITEgrant.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/129383]
Version info
26.12.1.167-master(included in26.12and later)26.11.1.2922,26.10.12.3,26.9.37.9,26.8.45.8,26.3.71.5