Skip to content

Own-origin recovery: a lost log tail on a sharded table is not recovered from peers #1400

Description

@kriszyp

Follow-up from Recover a node's own writes from its peers after it loses its log tail, and hold record locks until then (#1383).

What happens: after an OS restart a node asks its peers for the writes it originated (own-origin recovery). On a table with a residency policy (sharding), the receiver applies its own residency rows only from a snapshot copy and closes the link on one sent live (Sharded self-origin recovery requires a valid snapshot, replication/replicationConnection.ts). The recovery pass therefore leaves those rows out, and record locks on such a table do not wait for recovery. A lost transaction-log tail on a sharded table is not restored from peers.

What a fix needs: admit a node's own residency rows inside the recovery pass, or route them through a snapshot-style apply. Either changes the sharding rule "self-origin sharded copy rows always use snapshot apply" in replication/DESIGN.md, so it needs its own design review. Once it lands, ownLineage should hold sharded tables again.

Coverage to add with it: a database holding both an ordinary table and a sharded table, where the ordinary table's own writes come back and the sharded table's do too.

Review-Deferral: 1808ab78e425eccd severity=minor category=test-coverage

— Claude Opus 5.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Fields

    Priority

    P2

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions