fix(grpc-data): #969 concurrent cadence renewals of one predecessor share one metadata call and one commit

Two Subscribe cadences of one node reach the renewal window on the same tick
and each ran its own overlap renewal of the same predecessor: two origin
metadata calls, and the second commit adopted the first's successor yet
replaced the node's committed definition again (harmless since #968, wasted).

ProjectedDataAccess now keeps in-flight cadence renewals per predecessor proof
(reference identity, same node). A cadence that finds one waits for it; a
committed shared renewal is its success too (it adopts the committed successor
exactly as the existing already-committed shortcut does, its own caller
re-authorized by TryPrepareBinding). A shared renewal that did not commit is no
verdict: the joiner renews for itself, so one cadence stopping or being refused
only delays the other. No sink interface change.

Tests: Concurrent_cadence_renewals_of_one_predecessor_share_one_metadata_call_and_one_commit
(red: 2 metadata calls; green: 1 call, 1 definition replacement, both streams
kept) plus a variant where the shared renewal fails and the joiner renews
itself. The #968 adoption wire test keeps exercising the unshared path via a
test switch.
This commit is contained in:
Joseph Doherty
2026-12-02 15:10:02 -05:00
parent 708a4889ca
commit a571a0fc99
4 changed files with 170 additions and 1 deletions
+9
View File
@@ -158,6 +158,15 @@ Two cadences of the same node made it likely, because both renew on the same tic
(redundant) renewal replaces the definition again while the first cadence rebinds. A lookup now
re-evaluates a definition replaced mid-check instead of reporting it missing.
Since #969 cadences of the same node no longer renew it twice: a cadence that reaches the renewal window
while another cadence is already renewing the same predecessor waits for that renewal (one origin
metadata call, one definition replacement) and, if it committed, rebinds onto its successor exactly as
when it finds the successor already committed (its own caller is re-authorized against the successor).
A shared renewal that did not commit (the other cadence stopped, its caller was refused, the origin
failed) is no verdict for the waiting cadence, which then renews for itself, so one cadence's failure only
delays another's renewal. On-demand lapse renewals (Read/HistoryRead/Write of a lapsed node) are not
shared with cadence renewals; a racing pair still commits one successor and the second adopts it.
## Rollout and diagnosis
1. Provision TLS trust and connection-scoped target credentials on each consumer; configure the