Repository navigation
Backport #115334 to 25.8: Do not let SET <name> = DEFAULT bypass the settings constraints - #116258
Conversation
…settings constraints
|
Workflow [BackportPR], commit [67fec0b] |
|
🕵 The only CI failure here was @groeneai, investigate the failure: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=116258&sha=629bd7e0f725f065b6ea8e783f98ae4b3e28e067&name_0=BackportPR&name_1=Stateless%20tests%20%28amd_asan%2C%20distributed%20plan%2C%20parallel%2C%202%2F2%29 and provide a fix in a separate PR. If the fix is already in progress, link it here. |
|
Investigated. This is a second, distinct failure mode in that test, not the one that failed on #114927 on 2026-08-16. The 08-16 one was
Outside the test,
No open PR fixes this signature. I will fix it on master and link the PR here. Clearing this red on 25.8 will then need |
|
Fixed on master in #116734. The quarantine rename in the replicated This is a different signature from the 2026-08-16 failure on another PR (
|
A replicated `ATTACH_PART` log entry claims a candidate directory in `detached/` by renaming it to `attaching_<dir>`, builds the part with a two-component `part_dir` (`detached/attaching_<dir>`) and loads it. When the load throws a non-retryable exception the part must be renamed aside under a `broken_` prefix so it stops being an attach candidate, and `old_dir` is then cleared so the rollback becomes a no-op. That rename could never succeed. `renameToDetached` routes through `DataPartStorageOnDiskBase::getPartDirForPrefix`, which appends `part_dir` verbatim, and `getRelativePathForDetachedPart` prepends `detached/` again, so the target is `detached/broken_detached/attaching_<dir>` and its parent does not exist. The `_tryN` existence probe passes for the same reason, so no retry fires. The rename dies with ENOENT, `old_dir` is left set, and the broken part stays an attach candidate, so every later `ATTACH PARTITION` for that partition keeps failing on it. No concurrency is required. This is a regression. a5eeba9 introduced the quarantine as a local rename inside `detached/`, and 56cd154, under three hours later the same day, replaced it with `part->renameToDetached("broken", false)` while adding the correct retryable/non-retryable split. The branch has been dead on arrival since. Restore the local rename, targeting a free `detached/broken_<dir>[_tryN]`. `broken_<dir>` parses with a non-empty prefix and a valid name, so it is excluded from both attach candidate filters and stays removable by both `DROP DETACHED PART` and `DROP DETACHED PARTITION`; routing through the generic allocator would instead produce a name that does not parse, which `DROP DETACHED PARTITION` skips. The target is handed to `renameTo` explicitly, with `remove_new_dir_if_exists` false, so the rename refuses an occupied directory instead of recursively removing a part an earlier quarantine put there, and the collision advances to the next `_tryN` name. `renameToDetached` cannot be reused for this because it passes true. On any other error, or when the last attempt collides, the exception is rethrown so the failure is logged, `old_dir` is left set and the rollback runs as before. Nothing generic changes and the branch has no working caller to regress. A rollback whose target base name was re-taken concurrently can still orphan `attaching_<dir>`, and the claim can still take a directory a concurrent `DETACH` is populating; neither is addressed here. Add an integration test rather than a functional one, because it has to remove `count.txt` from a part directory inside `detached/`. Reported on ClickHouse#116258 CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=116258&sha=629bd7e0f725f065b6ea8e783f98ae4b3e28e067&name_0=BackportPR&name_1=Stateless%20tests%20%28amd_asan%2C%20distributed%20plan%2C%20parallel%2C%202%2F2%29 Related: ClickHouse#54748
Original pull-request #115334
Cherry-pick pull-request #115936
This pull-request is a last step of an automated backporting.
Treat it as a standard pull-request: look at the checks and resolve conflicts.
Merge it only if you intend to backport changes to the target branch, otherwise just close it.
The PR source
The PR is created in the CI job
Version info
25.8.34.7