Skip to content

A route edit after a failed revoke leaves the link unremovable: every revoke answers link_changed #8678

Closed

Description

@lidge-jun

Problem

A removal that has claimed its retirement receipt and then failed before its commit leaves the receipt outstanding. A route edit made after that point writes the link record without looking at the receipt. From then on the stored record no longer equals the receipt's copy, and every revoke of that link answers link_changed:

  • a journalled revoke with a new operation id and a plain --force both stop in readRemovalTarget (src/server/management/link-routes.ts:444 on dev 3f5530ba8), which compares JSON.stringify(found) with JSON.stringify(receipt.link);
  • a repeat of the original operation id resumes, and its commit compares against receipt.link as well.

handleLinkRouteEdit / applyEdit (src/server/management/link-route-edit.ts:68-140) take the per-alias set and the link's job reservation, so they cannot overlap a running revoke in one runtime. They do not read the link's retirement receipt, so they run freely between a failed revoke and its retry.

Trigger

  1. ocx link revoke --link-id L --operation-id X claims its receipt, then fails (for example key_revoke_failed, a journal write failure at the record intent, link_remove_failed, or the Home stops in between).
  2. The operator runs ocx link routes add (or remove / order) on the same link.
  3. Every later revoke of L answers link_changed (409).

Consequence

No command finishes that removal. Undoing the route edit only helps if the stored record serializes byte for byte like the receipt's copy again, which key order does not guarantee (applyEdit deletes and re-adds routes).

Suggested fix

Refuse a route edit while a retirement receipt is outstanding for the link (a closed code such as link_retirement_pending, checked before the probe and again under the config mutation lock at commit), with a test that fails on dev: claim a receipt, fail the revoke, attempt a route edit, expect the refusal, then repeat the revoke and expect it to finish.

Found by the review of #8654 at a321309e7; the CLI wording there is being corrected separately. Not reproduced at runtime; derived from the code paths above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions