Hotfix 0.34.1: upgrade no longer runs a whole-index influence pass; a stop during startup is not fatal (#334) #342

Closed
buildagent wants to merge 0 commits from hotfix-334 into master
Member

Fixes #334, a field report from zammad-dev. On 0.34.0 with de.h-dv.ruby owning Ruby, the first daemon after the upgrade sat in one resolve step for 45 minutes, then exited with code 1 on sqlite error: interrupted.

Root cause

An upgrade changes the host identity, so the daemon's startup activation rebuilds the tree as a new generation and promotes it.

  • The rebuilt generation lost its first-party status. build::request wrote the new generation through activation::write_generation, which leaves builtin_equivalent = 0. Only activation::record, on the ordinary pass, ever set it to 1.
  • So the promotion's resolve went unscoped. The generation counted as third party, the grant fingerprint moved, and influence::apply_general ran over every ref, about 646k on Zammad.
  • The cost sits in the anchor arm. It does a prefix compare that cannot use an index.
  • Measured on a local Zammad 7.0.2 copy: 1,370,778 ms in resolution_influence before the fix, 1,070 ms after.
  • Not new in 0.34.0. Any upgrade of a package-owned project hits it.

Commits

  • 68bca7b5: build::request records builtin-equivalence from the live PackageHost, as the ordinary pass does.
    • Test: first_party_influence::a_pipeline_built_generation_keeps_the_first_party_exemption.
    • Mutation, run by the lane and re-run by me: removing the call → RED, …must be recorded builtin-equivalent: [0].
  • 7a5f4d5f: a requested stop (SIGTERM/SIGINT) during the startup activation goes through the clean-shutdown path instead of Fatal exit 1. The owed work was already durable in the m0007 pending tables.
    • Test: a_requested_stop_never_makes_a_startup_failure_fatal.
    • Both mutations RED, re-run by me.
    • The call-site wiring is covered by a live SIGTERM run on the Zammad copy: exit 1 before, exit 0 after.
  • 514e37e0: version_bump.sh 0.34.1.

Verification on this tree

  • fmt, clippy, rustdoc with -D warnings --document-private-items, guest_gates.sh: clean.
  • Workspace (the ci.yml command): no failures.
  • Daemon leg, corpus_ratchet and precision_gate are running locally now; I'll post the results here.

Follow-ups, not in this PR

  • #339: a package profile stored by the older host is unreadable (17 of 18 fields).
  • #340: the anchor arm should run once per qualifier instead of per ref, and step 3 is duplicated.
  • #341: readers see an unresolved generation between the pointer switch and the resolve.

🤖 Generated with Claude Code

https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu

Fixes #334, a field report from zammad-dev. On 0.34.0 with de.h-dv.ruby owning Ruby, the first daemon after the upgrade sat in one resolve step for 45 minutes, then exited with code 1 on `sqlite error: interrupted`. ## Root cause An upgrade changes the host identity, so the daemon's startup activation rebuilds the tree as a new generation and promotes it. - **The rebuilt generation lost its first-party status.** `build::request` wrote the new generation through `activation::write_generation`, which leaves `builtin_equivalent = 0`. Only `activation::record`, on the ordinary pass, ever set it to 1. - **So the promotion's resolve went unscoped.** The generation counted as third party, the grant fingerprint moved, and `influence::apply_general` ran over every ref, about 646k on Zammad. - **The cost sits in the anchor arm.** It does a prefix compare that cannot use an index. - **Measured on a local Zammad 7.0.2 copy:** 1,370,778 ms in `resolution_influence` before the fix, 1,070 ms after. - **Not new in 0.34.0.** Any upgrade of a package-owned project hits it. ## Commits - **68bca7b5:** `build::request` records builtin-equivalence from the live `PackageHost`, as the ordinary pass does. - Test: `first_party_influence::a_pipeline_built_generation_keeps_the_first_party_exemption`. - Mutation, run by the lane and re-run by me: removing the call → RED, `…must be recorded builtin-equivalent: [0]`. - **7a5f4d5f:** a requested stop (SIGTERM/SIGINT) during the startup activation goes through the clean-shutdown path instead of `Fatal` exit 1. The owed work was already durable in the m0007 pending tables. - Test: `a_requested_stop_never_makes_a_startup_failure_fatal`. - Both mutations RED, re-run by me. - The call-site wiring is covered by a live SIGTERM run on the Zammad copy: exit 1 before, exit 0 after. - **514e37e0:** `version_bump.sh 0.34.1`. ## Verification on this tree - fmt, clippy, rustdoc with `-D warnings --document-private-items`, `guest_gates.sh`: clean. - Workspace (the ci.yml command): no failures. - Daemon leg, corpus_ratchet and precision_gate are running locally now; I'll post the results here. ## Follow-ups, not in this PR - **#339:** a package profile stored by the older host is unreadable (17 of 18 fields). - **#340:** the anchor arm should run once per qualifier instead of per ref, and step 3 is duplicated. - **#341:** readers see an unresolved generation between the pointer switch and the resolve. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
`build::request` recorded a new generation's `generation_packages`
through `activation::write_generation` alone, which writes
`builtin_equivalent = 0`. Only `activation::record` (the ordinary pass)
stamped the first-party exemption, so every generation the activation
pipeline built was third party until the next ordinary pass.

The daemon's startup activation is that pipeline: an upgrade moves the
host identity, the daemon rebuilds the tree as a new generation and
promotes it. The promotion's resolve then saw a grant fingerprint that
suddenly named the first-party Ruby package, so `Influence::apply` ran
`apply_general` UNSCOPED, anchor arm included, over every reference.

Measured on a copy of the reporter's shape (Zammad 7.0.2, Ruby owned by
de.h-dv.ruby, indexed by the previous release, opened by this release's
daemon; machine contended, load 6-12): `resolution_influence` took
1,370,778 ms (step 3 competed 59 s, step 4 anchor arm ~22 min), against
61-82 ms in the migration's own Full pass and 1,070 ms with this fix.
During it the watcher was not armed and readers saw the switched-to
generation with refs_resolved 0.

The pipeline's extractors carry the live PackageHost, so the request
transaction now stamps the exemption from it, exactly as `record` does.

Test: first_party_influence::a_pipeline_built_generation_keeps_the_
first_party_exemption drives the daemon's startup-activation calls on a
first-party leg. Mutation run: delete the new call -> RED, "the
generation the activation pipeline built must be recorded
builtin-equivalent: [0]".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
SIGINT/SIGTERM during the startup activation's promotion interrupts the
resolve that follows the committed pointer switch. `startup_activation`
classified that SQLITE_INTERRUPT as StartupFailure::Fatal, so the daemon
exited 1 with "startup generation N committed; resolution remains
pending: sqlite error: interrupted" although the switch had already made
the owed work durable and the next start repairs it (measured: the
restarted daemon ran the owed Full pass and indexed the edits made
during the dead one).

A Fatal failure now ends the process only when no stop was requested;
otherwise it reaches the existing clean-shutdown path. Measured on the
Zammad copy, SIGTERM mid-promotion: before, exit 1 + ERROR; after,
exit 0 + "shutting down during initial reconcile; pending resolve work
is durable".

Test: tests::a_requested_stop_never_makes_a_startup_failure_fatal.
Mutations run: drop the `!stopping` guard -> RED ("a requested stop
must reach the clean-shutdown path"); retry every Fatal -> RED ("a real
refusal of this activation must still exit non-zero").

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Release 0.34.1: version_bump.sh
All checks were successful
Package CI / package (csharp) (push) Successful in 19s
Package CI / package (xaml) (push) Successful in 20s
Package CI / package (php) (push) Successful in 27s
Package CI / package (rust) (push) Successful in 29s
Package CI / package (python) (push) Successful in 36s
Package CI / package (timeline) (push) Successful in 38s
Package CI / package (svelte) (push) Successful in 46s
Package CI / package (javascript) (push) Successful in 45s
Package CI / package (ruby) (push) Successful in 53s
Package CI / package (typescript) (push) Successful in 55s
Release Build / Generate Version (push) Successful in 21s
Release Build / Required CI green (push) Successful in 55s
Release Build / Build linux-aarch64 (push) Successful in 12m51s
Release Build / Build linux-x86_64 (push) Successful in 15m3s
Release Build / Build linux-x86_64-musl (push) Successful in 15m41s
Release Build / Pack the first-party packages-8 (push) Successful in 58s
Release Build / Pack the first-party packages-2 (push) Successful in 1m1s
Release Build / Pack the first-party packages-6 (push) Successful in 1m4s
Release Build / Pack the first-party packages-7 (push) Successful in 1m14s
Release Build / Pack the first-party packages (push) Successful in 1m7s
Release Build / Pack the first-party packages-4 (push) Successful in 1m20s
Release Build / Pack the first-party packages-5 (push) Successful in 1m21s
Release Build / Pack the first-party packages-3 (push) Successful in 1m21s
Release Build / Pack the first-party packages-1 (push) Successful in 1m30s
Release Build / Pack the first-party packages-9 (push) Successful in 1m34s
Release Build / Build windows-x86_64 (push) Successful in 24m53s
Release Build / Assemble the release archives (push) Successful in 3m15s
Release Build / Windows archive smoke (msvc) (push) Successful in 30s
Release Build / Create Forgejo Release (push) Successful in 9m28s
Release Build / Seed the package channel (push) Successful in 2m34s
514e37e0ac
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0126PDDLB4wNHxKXvWM1VNmu
Author
Member

The local full gate run on 514e37e0 passed with no failures:

  • fmt, clippy, docs (-D warnings --document-private-items) and guest_gates.sh: clean;
  • workspace and daemon leg: 557 test result: ok lines;
  • corpus_ratchet: 9/9;
  • precision_gate: 7/7 with 0 phantoms; the POPULATION lines match those from the #275 run earlier today.
The local full gate run on 514e37e0 passed with no failures: - fmt, clippy, docs (`-D warnings --document-private-items`) and `guest_gates.sh`: clean; - workspace and daemon leg: 557 `test result: ok` lines; - `corpus_ratchet`: 9/9; - `precision_gate`: 7/7 with 0 phantoms; the POPULATION lines match those from the #275 run earlier today.
Author
Member

Fast-forwarded into master at 514e37e0 and released as v0.34.1 (release run 1035, 56 assets): https://git.h-dv.de/h-dv/code-index/releases/tag/v0.34.1

CI passed on both the PR (runs 1029–1031) and the master push (runs 1032–1034). Forgejo does not mark a fast-forward as merged, so I'm closing this by hand.

Fast-forwarded into master at 514e37e0 and released as v0.34.1 (release run 1035, 56 assets): https://git.h-dv.de/h-dv/code-index/releases/tag/v0.34.1 CI passed on both the PR (runs 1029–1031) and the master push (runs 1032–1034). Forgejo does not mark a fast-forward as merged, so I'm closing this by hand.
buildagent closed this pull request 2026-10-08 20:57:28 +02:00
All checks were successful
CI (Windows) / changes (what this run must test) (pull_request) Successful in 21s
Package CI / changes (which packages this run must test) (pull_request) Successful in 21s
CI / changes (what this run must test) (pull_request) Successful in 29s
Package CI / package (csharp) (pull_request) Successful in 11s
Package CI / package (svelte) (pull_request) Successful in 12s
Package CI / package (javascript) (pull_request) Successful in 21s
Package CI / package (python) (pull_request) Successful in 21s
Package CI / package (typescript) (pull_request) Successful in 29s
Package CI / package (php) (pull_request) Successful in 29s
Package CI / package (ruby) (pull_request) Successful in 40s
Package CI / package (xaml) (pull_request) Successful in 38s
CI / cargo fmt (pull_request) Successful in 1m10s
CI / OSS corpus tier-3 scale (nightly) (pull_request) Has been skipped
CI / Grammar rebuild from source (nightly) (pull_request) Has been skipped
Package CI / package (timeline) (pull_request) Successful in 47s
Package CI / package (rust) (pull_request) Successful in 49s
CI / CI lane wall-clock headroom (pull_request) Successful in 1m0s
CI / guest crates (fmt, clippy, doc) (pull_request) Successful in 1m10s
CI / cargo doc (intra-doc links) (pull_request) Successful in 5m20s
CI / cargo test (abi, 32-bit + wasm32) (pull_request) Successful in 6m58s
CI / cargo deny (pull_request) Successful in 7m10s
CI / cargo check (MSRV 1.98) (pull_request) Successful in 7m22s
CI / cargo clippy (pull_request) Successful in 7m24s
CI / cargo check (windows-gnu) (pull_request) Successful in 7m28s
CI / OSS corpus (tier 1) (pull_request) Successful in 31m43s
CI / cargo test (pull_request) Successful in 51m51s
CI / cargo test (daemon transport) (pull_request) Successful in 12m34s
CI / Plugin path cost + pool throughput (nightly) (pull_request) Has been skipped
CI (Windows) / fmt + clippy + build + test (windows) (pull_request) Successful in 1h33m32s
CI / changes (what this run must test) (push) Successful in 33s
Package CI / changes (which packages this run must test) (push) Successful in 38s
CI (Windows) / changes (what this run must test) (push) Successful in 50s
CI (Windows) / fmt + clippy + build + test (windows) (push) Has been skipped
CI / cargo fmt (push) Successful in 52s
CI / CI lane wall-clock headroom (push) Has been skipped
CI / guest crates (fmt, clippy, doc) (push) Has been skipped
CI / cargo doc (intra-doc links) (push) Has been skipped
CI / OSS corpus (tier 1) (push) Has been skipped
CI / OSS corpus tier-3 scale (nightly) (push) Has been skipped
CI / Grammar rebuild from source (nightly) (push) Has been skipped
CI / cargo clippy (push) Has been skipped
CI / cargo check (MSRV 1.98) (push) Has been skipped
CI / cargo check (windows-gnu) (push) Has been skipped
CI / cargo test (abi, 32-bit + wasm32) (push) Has been skipped
CI / cargo deny (push) Has been skipped
CI / cargo test (push) Has been skipped
CI / cargo test (daemon transport) (push) Has been skipped
CI / Plugin path cost + pool throughput (nightly) (push) Has been skipped
Package CI / package (csharp) (push) Successful in 19s
Package CI / package (xaml) (push) Successful in 20s
Package CI / package (php) (push) Successful in 27s
Package CI / package (rust) (push) Successful in 29s
Package CI / package (python) (push) Successful in 36s
Package CI / package (timeline) (push) Successful in 38s
Package CI / package (svelte) (push) Successful in 46s
Package CI / package (javascript) (push) Successful in 45s
Package CI / package (ruby) (push) Successful in 53s
Package CI / package (typescript) (push) Successful in 55s
Release Build / Generate Version (push) Successful in 21s
Release Build / Required CI green (push) Successful in 55s
Release Build / Build linux-aarch64 (push) Successful in 12m51s
Release Build / Build linux-x86_64 (push) Successful in 15m3s
Release Build / Build linux-x86_64-musl (push) Successful in 15m41s
Release Build / Pack the first-party packages-8 (push) Successful in 58s
Release Build / Pack the first-party packages-2 (push) Successful in 1m1s
Release Build / Pack the first-party packages-6 (push) Successful in 1m4s
Release Build / Pack the first-party packages-7 (push) Successful in 1m14s
Release Build / Pack the first-party packages (push) Successful in 1m7s
Release Build / Pack the first-party packages-4 (push) Successful in 1m20s
Release Build / Pack the first-party packages-5 (push) Successful in 1m21s
Release Build / Pack the first-party packages-3 (push) Successful in 1m21s
Release Build / Pack the first-party packages-1 (push) Successful in 1m30s
Release Build / Pack the first-party packages-9 (push) Successful in 1m34s
Release Build / Build windows-x86_64 (push) Successful in 24m53s
Release Build / Assemble the release archives (push) Successful in 3m15s
Release Build / Windows archive smoke (msvc) (push) Successful in 30s
Release Build / Create Forgejo Release (push) Successful in 9m28s
Release Build / Seed the package channel (push) Successful in 2m34s

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
h-dv/code-index!342
No description provided.