Skip to content

TN recovery can use incomplete participant routes and block shutdown #25951

Closed

Description

@VioletQwQ-0

Bug report

TN recovery can use incomplete participant routes and can remain blocked after cancellation.

This is independently reproducible on current main at 3046f14d94b3f1a25839eeeb65729b64f85ac647.

Failure 1: recovered 2PC metadata has no live route

A recovered prepared transaction can contain only the durable participant identity (ShardID). The recovery coordinator currently sends GetStatus immediately with that incomplete shard metadata. The observed target is:

<ShardID:2, ReplicaID:0, Address:"">

Recovery should complete each participant's current ReplicaID and transaction service address from the TN cluster snapshot before sending status or commit requests. If the participant is temporarily absent, recovery should wait and retry rather than send to an empty route.

Failure 2: storage recovery ignores cancellation while publishing

KVTxnStorage.StartRecovery publishes recovered transactions with an unconditional channel send. With 17 records and the service's 16-entry recovery channel left full, canceling the supplied context does not terminate the producer.

recovery remained blocked on a full transaction channel after cancellation

This also means TN shutdown cannot safely cancel a service whose Start() is waiting for recovery to finish.

Expected invariant

  • Prepared/committing recovery requests use a complete current TN participant route.
  • A temporarily missing participant or transient cluster lookup is retried.
  • Canceling recovery terminates route waits, storage producers, the recovery consumer, and the blocked TxnService.Start() path.
  • Repeated close and partial-start cleanup remain safe.

Scope

This issue is limited to generic transaction recovery routing and cancellation. It does not include AUTO_INCREMENT semantics, allocator changes, or 2PC replay ordering/timestamp behavior.

Activity

  1. self-assigned this
    on Jul 21, 2026
  2. added
    kind/bug
    on Jul 21, 2026
  3. added a commit that references this issue on Jul 22, 2026
    bbca3f3
  4. VioletQwQ-0 commented on Jul 22, 2026

    @VioletQwQ-0
    CollaboratorAuthor

    Closed by #25956, merged as bbca3f3.\n\nThe merged change covers the full scope of this issue:\n- recovered coordinator transactions resolve complete current TN participant routes before recovery RPCs;\n- missing or transient routes are retried from an authoritative cluster snapshot;\n- cancellation terminates route waits, MEMKV reads/publication, the recovery consumer, blocked TxnService.Start, late replica generations, and cluster-readiness waits;\n- repeated close and partial-start shutdown paths have regression coverage.\n\nThe PR's required CI and post-merge TKE check-in completed successfully. The failing merge-update-moc check is a post-merge synchronization workflow and is not an implementation-validation failure.\n\nThe remaining 2PC replay/timestamp and AUTO_INCREMENT work is intentionally outside #25951 and will continue in separate prerequisite PRs.

  5. added 3 commits that reference this issue on Sep 17, 2026
    57a8fad
    91ae103
    e846eb8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions