Repository navigation
Revert "Revert "Fix propagation of settings in accurateCastOrDefault"" - #114912
alexey-milovidov merged 17 commits into
Conversation
|
Workflow [PR], commit [cd98c24] Summary: ✅
AI ReviewSummaryThis PR restores Final Verdict✅ No new findings. LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 66/70 (94.29%) · Uncovered code |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction. Object file sizes5 object files changed (+32.17 KiB total), 0 added.
737 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 units740 translation units recompiled, 6821 s compile time in total, 740 of them have a recent master baseline. |
|
🕵 Closing as obsolete: the PR head commit |
|
^ It's not clear to me. |
…ue-pr-114912-merge-aug16
…t-109946-respect-settings-accurate-cast-or-default
Do not wrap target types that encode NULL natively in an outer `Nullable`.
|
🕵 Addressed the unresolved |
|
The
All 21 red jobs die at the same translation unit with the same error: The cherry-pick applied cleanly because nothing conflicted: this PR restores the caller, and the callee is what those branches lack. 26.6 is green for exactly that reason. If you want the prerequisite to land first, I measured how far it ports. Simulating the cherry-pick of
So I have not touched the robot's PRs and I am not hand-authoring release-branch ports, per the label route you confirmed on #111910. Flagging the measurement so the decision is yours. |
Cherry pick #114912 to 26.7: Revert "Revert "Fix propagation of settings in `accurateCastOrDefault`""
… in `accurateCastOrDefault`""
Backport #114912 to 26.7: Revert "Revert "Fix propagation of settings in `accurateCastOrDefault`""
Backport #114912 to 26.5: Revert "Revert "Fix propagation of settings in `accurateCastOrDefault`""
… in `accurateCastOrDefault`""
Backport #114912 to 26.6: Revert "Revert "Fix propagation of settings in `accurateCastOrDefault`""
…f settings in `accurateCastOrDefault`""
|
Gentle ping on the open decision here: #115535 (25.8) and #115536 (26.3) still do not compile, because they restore the caller while those branches lack the callee |
The tests backported with #114912 assert behavior that comes from other, unbackported master changes: - `04510_accurateCastOrDefault_settings`: the time-zone substitution block needs master's `substituteTimeZoneInDateTimeType` in `CastOverloadResolverImpl`. - `04512_accurateCastOrDefault_nullable_target`: the `Dynamic` and `LowCardinality(Nullable(...))` targets need master's `canContainNull` check in `CastOverloadResolverImpl::getReturnTypeImpl` (25.8 still has `isVariant`, so `makeNullable(Dynamic)` throws ILLEGAL_TYPE_OF_ARGUMENT). Same trim as the 26.3 backport #115536. Both trimmed tests verified locally against this PR's own CI binary (25.8.33.1). CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=115535&sha=a4fa72b7604c3af05e53398053eaa63f87bbadd9&name_0=BackportPR PR: #115535 Co-Authored-By: Claude Fable 5 <[email protected]>
Edited following .claude/skills/edit-changelog/SKILL.md, by hand on a workstation: the editing step of the NightlyChangelog job has been failing its own verification since 2026-08-12, so three raw blocks had accumulated (47 + 84 + 628 entries). Of the 759 raw entries, 482 are integrated into the in-progress 26.8 section and 277 are dropped: - Section 3: the 300 `NOT FOR CHANGELOG / INSIGNIFICANT` entries are dropped, except 41 that describe a user-visible change and are promoted into a real category, among them a server abort on a corrupt `ORC` stripe footer (#114924), `EXPLAIN ANALYZE` for streaming queries (#112445), `SELECT` from `TimeSeries` (#115622), streaming watermarks (#106169), and the `clickhouse-local` CORS overrides (#115129). - Section 2: every revert in the range cancels out inside it, so neither side appears. Two are re-applications: #114912 re-applies the `accurateCastOrDefault` fix, so #109946 keeps its entry with both links and the intervening revert #114911 is gone; #114409 re-applies the PromQL streaming plan, recorded on the #113656 entry. - Section 4: `Build/Testing/Packaging Improvement` keeps the seven entries a user, packager or from-source builder notices (musl `getaddrinfo` and `sched_getcpu`, signed macOS artifacts, Debian packages for release builds only, zstd-compressed Docker layers, `unit_tests_dbms` without the full library set, vendored Rust built with optimizations locally) and drops the CI plumbing. - Sections 5 and 6: bare pull request URLs converted to links, settings put in backticks, four entries rewritten from developer notes into user-visible descriptions, and three moved into `Performance Improvement`. No entry of a strict-retention category was deleted: the job's own `verify_edit` passes on this edit. Not done here, because the release manager does it at release time: the full significance sort, the aggressive merging of sibling pull requests, and the `FIXME` release date and presentation links.
Backport #114912 to 26.3: Revert "Revert "Fix propagation of settings in `accurateCastOrDefault`""
Address review: `resolve_reverted_originals` granted deletion credit to every raw-block revert with a `Reverts owner/repo#N` marker, even when that revert was itself reverted later in the same range — so an edit dropping `#109946` (reverted by `#114911`, which `#114912` reverted in turn) still passed verification while the fix ships in the release. Now the resolved reverts are walked in descending PR-number order (a revert always has a higher number than its target): an uncancelled revert cancels the reverts it targets and only uncancelled reverts contribute deletion credit. Because a revert of a revert made through the web UI can lack the body marker (`#114912` has none), the target is also resolved from the nested title — `Revert "Revert "X""` binds to the earlier range revert titled `Revert "X"`. PR: #116221 Co-Authored-By: Claude Fable 5 <[email protected]>
Backport #114912 to 25.8: Revert "Revert "Fix propagation of settings in `accurateCastOrDefault`""
…f settings in `accurateCastOrDefault`""
…f settings in `accurateCastOrDefault`""
`verify_edit` was only net-effect aware inside one raw block, while the job edits a release cycle in ~30 nightly increments and a revert chain routinely spans them: 1. run N integrates `#109946`; 2. run N+1 sees `#114911` and deletes `#109946`; 3. run N+2 sees only raw `#114912`. On run N+2 nothing disappears in the edit — `#109946` went away the previous day — so verification passed with a shipped fix missing from `CHANGELOG.md`, and the editing agent had no way to know the entry ever existed: it is gone from the file, and the intervening revert is gone from the raw blocks. The branch now carries that memory itself, in trailers on its own edit commits, the same way `Changelog-generated-up-to:` carries the generation point: Changelog-revert: <revert> <reverted> <title of the revert> Changelog-deleted-entry: <pull request> <its bullet as it was deleted> `analyze_reverts` resolves each run's reverts against that ledger and reduces the *cumulative* graph, so a chain spread over several runs behaves exactly like one arriving in a single raw block, at any depth: - the reduction is what decides deletion credit, so a cancelled revert licenses nothing; - an entry recorded as deleted whose revert is no longer uncancelled has to be back in `CHANGELOG.md` — `verify_edit` fails the run while it is not, and the prompt asks for it by name, quoting the bullet from the ledger; - the recorded titles also let a web-UI `Revert "Revert "X""` (which carries no `Reverts owner/repo#N` marker) bind to an earlier revert the job saw days ago. A branch whose edit commits predate the trailers has an empty ledger and keeps the previous behaviour. `ci/tests/test_changelog_nightly_revert_ledger.py` pins the timelines: the whole chain in one block, the revert alone, the revert of the revert arriving after the deletion, a revert of the re-apply, an empty ledger, and an unresolvable revert.
**The retention path judged entries by any link, the restore path by attribution.** The previous commit fixed the restore side only, so a strict raw entry still counted as preserved when another bullet merely mentioned its pull request in prose — and `revert_licensed_deletions` then had no attributed bullet to snapshot, making the entry unrecoverable as well as gone. Both halves of `disappeared_entries` now use the attribution, which also removes a spurious failure in the other direction: rewording a bullet and dropping an inline reference to another pull request is not the loss of that pull request's entry. **A restoration did not have to record the pull request that re-applied the change.** Skill section 2.5 appends its link to the entry, and that link is the only trace of the re-apply left in the release, since its own revert bullet is deleted. Restoring a bare `#109946` without `#114912` passed. `verify_edit` now requires it, on the bullet the entry landed on rather than somewhere in the section, and only for this run's restorations — a later edit may reword the entry. **The duplicate guard compared sets of duplicated pull requests.** An entry already written twice could gain a third copy without changing the set. `duplicate_attributions` becomes `attribution_counts`, and the check is `count > max(1, count before the edit)`: no increase is allowed, while the count an edit inherits is left alone (removing an entry is what the retention rule forbids). Four tests added; each fails without its fix.
`reapplied_by` walked one level out from the direct remover, so it found the revert that first put a change back and stopped there. With `#109946` ← `#114911` ← `#114912` ← `#115500` ← `#116000` — out, back, out, back, all inside one cycle — it reported only `#114912`, which the recorded bullet already carried from the first restoration. The re-apply check was therefore satisfied by the stale line and `#116000` was lost for good: a revert of a revert has no bullet of its own, so the link on the entry is its only trace in the release. `revert_chain` now walks the whole chain above the entry, and the uncancelled reverts of that chain are the ones that ship, so they are the ones that belong on the bullet. `removed_by` is the complement — the cancelled ones — which also makes the prompt name both removals of a repeated cycle instead of the first. The three-pull-request case is unchanged: one remover, one re-applier. The prompt asks for the links of every re-applier, noting that some may already be on the recorded line from an earlier restoration. `test_a_longer_chain_records_every_reapply` walks the five-pull-request timeline and asserts `removed_by == ['114911', '115500']`, `reapplied_by == ['114912', '116000']`, that replaying the recorded line is rejected for missing `#116000`, and that appending it passes. It fails with the one-level walk.
The editing step of the `NightlyChangelog` job has been failing its own
verification every night since 2026-08-12, always the same way:
Entries disappeared in the edit without a matching revert (['103182', '109946'])
`verify_edit` requires that every raw entry of a strict-retention category
keeps its pull request link - an entry may be rewritten, merged or moved, but
not dropped, because the generation point has already moved past it and no
later run will offer it again. The prompt never said so, and the skill stated
the rule only implicitly, so the agent pruned entries it judged
insignificant: `ClickHouse#103182` (`Lightweight Updates v2`, a `Backward Incompatible
Change`) was deleted outright.
The second half of the same failure is the revert handling. `ClickHouse#109946` fixed
the propagation of settings in `accurateCastOrDefault`, `ClickHouse#114911` reverted
it, and `ClickHouse#114912` reverted that revert - all three in one range. The skill
covers this in section 2.5, but the agent reached the "landed and then
reverted, so delete both" rule first and lost a fix that ships.
So:
- The prompt now lists the strict-retention categories (from
`STRICT_RETENTION_CATEGORIES`, so the two cannot drift apart), says which
entries may be deleted and why deleting anything else is unrecoverable, and
states the revert-of-revert rule.
- The skill gets a retention rule ahead of the individual edits, and the
walk over `NO CL ENTRY` checks whether a revert is itself reverted before
it concludes that a change was reverted. The `accurateCastOrDefault` chain
is written out there as the worked example.
- A retry now tells the agent why the previous attempt was rejected. Without
it, all three attempts of a run reproduced the same edit and the same
rejection - visible in every run from 2026-08-12 on.
A hand edit that followed these rules passed `verify_edit` on the first try,
which is how the 26.8 backlog (759 raw entries) was cleared in
ClickHouse#111720.
Related: ClickHouse#111720
Related: ClickHouse#116138
Restores propagation of query settings in
accurateCastOrDefaultand preserves successful sourceNULLs encoded byDynamicandVariant.Related: #114911
Depends on #114769
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
accurateCastOrDefault.Workflow [PR]
Sync PR [sync-upstream/pr/114912]
Version info
26.7.5.9,26.6.4.15,26.5.8.12,26.3.23.3,25.8.34.8