Repository navigation
Conversation
…applying them `StorageObjectStorageQueue::alter` passed the literals of `MODIFY SETTING` as parsed (`String` for '20000', `Int64` for -1) to 36 typed `Field::safeGet` reads in `ObjectStorageQueueMetadata::alterSettings`, the member chain of `alter` and `ObjectStorageQueueMetadata::updateSettings`, while `CREATE`/`ATTACH` convert every value (`ObjectStorageQueueSettings::loadFromQuery`) and check the cross-setting rules (`validateSettings`). Consequences, observed on master 80508bd and on the official 26.9.6.6 build: - `polling_min_timeout_ms = '20000'` (accepted by CREATE) failed with BAD_GET. - `alterSettings` writes Keeper before the member chain runs, so `after_processing = 'delete', polling_min_timeout_ms = '10000'` failed with BAD_GET after Keeper already said `delete`, and the next ATTACH failed with METADATA_MISMATCH. - `-1` for a UInt64 setting and `5000000000` for a UInt32 setting were applied as 18446744073709551615 and 705032704, and `processing_threads_num = 0` or `after_processing = 'tag'` without a key were accepted. Each was written into the definition, which the next ATTACH rejected. - `cleanup_interval_min_ms = cleanup_interval_max_ms + 1` made `generateRescheduleInterval` compute `rng() % 0`: SIGFPE in the cleanup task about 1 s after the ALTER, and after the restart the table did not load. Now `alter` loads the settings of the new definition with `loadFromQuery` and `validateSettings` (is_attach = true, as ATTACH does) before the first state change, and uses the typed values for the changed settings. A bad value fails with the CREATE error and changes nothing. AzureQueue shares the code. The two cleanup bounds live in the `ObjectStorageQueueMetadata` that all tables of a server with the same `keeper_path` share, and `updateSettings` changes only the bound that was altered. With table `a` at 100/100 and table `b` on the same path, `ALTER TABLE b MODIFY SETTING cleanup_interval_min_ms = 101` is valid for `b`, left the bounds at 101/100 and crashed the cleanup task the same way. `generateRescheduleInterval` now returns the minimum when the bounds are inverted. Test 05293_s3queue_alter_setting_values fails on master and passes with the fix (50/50 randomized runs). Mutants without the typed values, with the validation after the Keeper write, without the validation, without the `cleanup_interval_min_ms` check, and without the guard in `generateRescheduleInterval` each fail it. The integration test test_storage_s3_queue/test_4.py::test_alter_settings passes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Condense the two-line comment above the settings validation in StorageObjectStorageQueue::alter to one line. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 3 rounds, 3 findings, the last round clean) plus my own review.
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-9:20260929-223200 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-6:20260929-193500 |
|
Workflow [PR], commit [03d1b9f] Summary: ✅
AI ReviewSummaryPR #122986 converts and validates Final VerdictStatus: ✅ Approve |
`checkAlterIsPossible` and `alter` compared the raw literals to decide whether a setting changes, so `buckets = '4'` over a stored `buckets = 4`, or `false` over `0`, counted as a change. The change-only guards then rejected a statement that changes nothing: `buckets` with attached materialized views, and any setting that the table's mode does not allow to change. Both now compare the values as the setting parses them, in `isSettingValueChanged`. For a setting that is in the definition, a value that does not parse now fails with its parse error also when the mode does not allow changing the setting, instead of `SUPPORT_IS_DISABLED`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Object file sizes6 object files changed (+19.58 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 units15 translation units recompiled, 84 s compile time in total, 15 of them have a recent master baseline. |
`ObjectStorageQueueSettings::hasBuiltin` accepts `enable_logging_to_s3queue_log` through `adjustSettingName`, but `applyChanges` and `get` do not, so an `ALTER` of that setting failed with `UNKNOWN_SETTING` instead of `SUPPORT_IS_DISABLED`, and a no-op in another spelling was rejected. Add `ObjectStorageQueueSettings::castValueUtil`, which resolves names as `hasBuiltin` does, like `MergeTreeSettings::castValueUtil`, and compare the values with it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
`ALTER TABLE ... MODIFY SETTING` and `RESET SETTING` stripped the `s3queue_` prefix from setting names, but kept the old name `enable_logging_to_s3queue_log` apart from `enable_logging_to_queue_log`. A statement that named the setting differently from the table definition added a second entry instead of replacing the first: restating the current value was rejected with `SUPPORT_IS_DISABLED`, and `RESET SETTING` under the other name did nothing. Both now resolve names as `loadFromQuery` does, through the new `ObjectStorageQueueSettings::resolveName`. As with the prefix, the next `ALTER` stores such a setting under its current name. Co-Authored-By: Claude Opus 5.5 <[email protected]>
CI finish ledger - 5e020b7Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
Neither row comes from this diff, which touches only Session id: cron:our-pr-ci-monitor:20260930-080205 |
…ter-setting-values # Conflicts: # src/Storages/ObjectStorageQueue/StorageObjectStorageQueue.cpp
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.
Related: #108283
Related: #103417
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fixed
ALTER TABLE ... MODIFY SETTINGofS3QueueandAzureQueuetables. A value written as a string (for examplepolling_min_timeout_ms = '20000') is now converted as inCREATEinstead of failing withBAD_GET, and the new settings are validated before anything is changed. Before, a failed statement could leave its other settings changed in Keeper, and a value thatCREATErejects (for exampleprocessing_threads_num = 0) was accepted, which made the table fail to attach after a restart;cleanup_interval_min_msset tocleanup_interval_max_ms + 1also crashed the server.Description
On 26.9.6.6,
ALTER TABLE <S3Queue table> MODIFY SETTING polling_min_timeout_ms = '20000'fails withBAD_GETalthoughCREATEaccepts it, andMODIFY SETTING cleanup_interval_min_ms = 1001with a maximum of 1000 crashes the server with SIGFPE.Root cause.
StorageObjectStorageQueue::alterhands the raw literals to typedsafeGetreads and never runs the conversion and checks ofCREATE/ATTACH. Keeper is written first, so a later failing read leaves it changed: afterMODIFY SETTING after_processing = 'delete', polling_min_timeout_ms = '10000'the nextATTACHfails withMETADATA_MISMATCH.-1,5000000000for aUInt32setting,processing_threads_num = 0or a minimum above the maximum go into the definition, which the nextATTACHrejects. A minimum of the maximum plus one makesgenerateRescheduleIntervaldivide by zero. Tables with the samekeeper_pathshare these bounds, so a value valid for the altered table can still invert them.Change. Before changing anything,
alterloads and validates the new definition's settings asATTACHdoes and applies the typed values; a bad value fails with theCREATEerror and changes nothing. Change detection resolves old setting names and compares converted values, so'4'over a stored4is not a change.generateRescheduleIntervalreturns the minimum for inverted bounds. A Keeper or disk fault after the Keeper write can still split the state, as before.Validation.
05293_s3queue_alter_setting_valuesfails on master and passes with the fix (50/50 randomized runs).🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/122986]