Files
lmxopcua/tests
Joseph Doherty 3b6a82b4ee fix(dataconn): #1026 an interrupted lease renewal no longer strands its item; name the pin holders of a refused renewal
The previous #1026 commit left one failure: on a fresh rig (s1026-h run 1) only 852 of 1888 large-mapping items
recovered after the SOURCE restart; the rest stayed BadUserAccessDenied because every renewal failed in the catalog
cache's bound of one retained predecessor per node (RenewalFail.Cache.PredecessorChain 81 163).

Cause: a renewal interrupted mid-cycle. The demand had rebound onto the successor S (RenewedEvent) but the stream ended
before S's baseline reached the node's SourceState, so the idle source still served (and pinned) the predecessor P.
Once both leases lapsed, every between-attempt renewal of S needed P unpinned (P retired+pinned, S pinned, new = 3 > 2),
and nothing ever released the idle source: its pins go only when GetSource replaces an invalid source, which needs a
valid demand, which needs the renewal. An origin restart does this to every batch in flight (~1000 items here).

Fix: between attempts, before renewing, retire an idle source whose own proof lapsed AND is no longer the node's current
proof (it fell behind its demands), exactly as GetSource retires an invalid source; the next attempt creates a fresh one.
A source that is on the node's current proof keeps its overlap predecessor (expired-overlap recovery parking relies on
it: releasing it broke Two_cadences_release_expired_overlap_without_borrowing_witnesses_during_failover).

Diagnostics: catalog pins carry a holder kind (demand/read/binding/source/parked); a refused chain counts
RenewalFail.Chain.<role>.<holder>. Commit-closure failures are split (Canceled/Deadline/Fence/Cache), the cache's own
refusals named (RenewalFail.Cache.<reason>).

Test: A_renewal_interrupted_before_the_successor_baseline_still_recovers_after_both_leases_lapse (holds the rebind's
remove ack, lets both leases lapse; never recovers without the fix).

Live (OrbStack rig s1026-j, fresh, 160 + 1888 items, 4 Hz churn, SOURCE pair restart), three consecutive gate runs:
PASS / PASS / PASS. Open 10.2 / 10.7 / 3.1 s, post-restart recovery 1.54 / 1.52 / 1.54 s, consumer Reset /
ResetHistory / ResetSourceInvalidated / ResetInterestLost deltas 0 in every run, no history-expired or
source-invalidated log line, origin invalidations 0 (only InterestHistoryGap catch-ups).

Co-Authored-By: Claude <noreply@anthropic.com>
2026-12-05 06:15:39 -05:00
..