Skip to content

Document stuck base copies, purge-bound retention copies and unnamed origins for 5.4 - #791

Merged
kriszyp merged 6 commits into
mainfrom
docs/stuck-base-copies
Nov 3, 2026
Merged

kriszyp merged 6 commits into
mainfrom
docs/stuck-base-copies

Conversation

@kriszyp

@kriszyp kriszyp commented Nov 3, 2026 •

Copy link
Copy Markdown
Member
Kyle paints a field-guide page of dog-team signs, one team running at the relay gate, one resting under a back-at-sundown clock and one turned back, while two dogs sniff and Bari cheers by the fire

⊙ Problem

Stop forcing base copies that never finish (harper-pro#1249) changes three undocumented replication behaviors for 5.4. cluster_status gains a stuckCopy field with no schema here. The overview and Learn pages still say any position older than a peer's retained history forces a base copy, which 5.4 no longer does for idle databases.

🤔 Should this land here, while the pages may move?

Yes, for now. The 5.4 replication and cluster_status pages are still in this repo. Move the Harper Pro reference pages into docs/ (harper-pro#1237) and Assemble the v5 reference from harper and harper-pro (#788) are open. Whichever merges first, this text must reach harper-pro's docs/ too.

💡 Solution

  • Stuck Copies documents stuckCopy: its fields, the retrying, held and refused states, the fixed hold schedule, how it clears and what it logs.
  • When a Peer Forces a Base Copy states when purged history forces a copy, including the exceptions.
  • Rows From Unnamed Origins documents unnamed-origin-<id>@<node name>.
  • The release notes and related pages link to these.

🔧 Changes

🤔 Exact numbers and name format are published

The page states the 5 attempts, 60-second first hold, 15-minute ceiling, 60-second quiet period, 64-name cap and the name escaping. Operators can alert on them. Any later tuning in harper-pro then needs a docs change.

✅ Verification

  • Each claim checked against harper-pro fix/base-copy-liveness @ cd77935 (copyStall.ts, clusterStatus.ts, unnamedOrigins.ts, replicationConnection.ts) and harper fix/base-copy-liveness-core @ 2e99e52 (auditStore.ts, audit-retention.md). stuckCopy reporting matches harper-pro's unnamedOriginCopy and shardedIdleRetention integration tests.
  • npm run build (broken links fail it), format:check, lint, typecheck and test:examples pass.
  • PR QA: skipped @ 33a9412 — documentation repo, prose only.

Refs HarperFast/harper-pro#1249

Depends-on: HarperFast/harper-pro#1249
Depends-on: HarperFast/harper#3958

🤖 Generated with Claude Code

— Claude Opus 5.5

Related PRs: #788 overlaps (removes these pages and assembles them from harper and harper-pro)
Complexity: easy

Origin — the dispatch brief this PR was written from

Companion docs PR for HarperFast/harper-pro#1249 (draft, milestone v5.4). Update the Harper Pro 5.4 replication reference and the cluster_status reference for the behavior below. Read the harper-pro PR description and its replication/DESIGN.md notes 26, 34 and 35 to verify each claim against the code before writing.

Document the replication behavior changes in harper-pro PR HarperFast/harper-pro#1249 (milestone v5.4), for the 5.4 replication / cluster_status reference pages.

  1. cluster_status gains a per-database-socket field stuckCopy, present only while a base copy from that peer is stuck, omitted otherwise:
    { state: 'retrying' | 'held' | 'refused', reason: string, count: number, since: ISO time, retryAt?: ISO time }.
    • retrying: the copy restarted from the same position at least twice without durable progress.
    • held: after 5 such attempts (fixed; no setting) the receiver stops reconnecting to that peer for a hold that starts at 60 s and doubles per failed attempt up to 15 minutes; retryAt is when it tries again.
    • refused: this node owns sharding slots and refused a full copy from a peer that is not a complete co-owner ("Owned sharding slots require a complete co-owner or backup restore"); reconnects are held the same way. It clears once a later connection stays open a minute without a refusal.
      Each state change logs one line (warn for retrying/refused, error for held, info when it clears).
  2. Retention-forced base copies: a node no longer forces a full copy on a peer whose resume point is older than logging.auditRetention when the node simply wrote nothing to that database since (an idle or never-written transaction log). A copy is still forced when a prune removed history the peer had not received. After upgrading, a log that was already empty may force one more copy per stale peer.
  3. Rows written by an origin with no node name (data migrated from v4, or a removed node) now copy and replicate: the sending node names that origin unnamed-origin-<id>@<node name> on the wire. Operators may see such names in logs and in a receiver's node id mapping.

Public-safe: no customer names. Link the harper-pro PR.

Acceptance

A draft PR on HarperFast/documentation that documents the stuckCopy cluster_status field, the retention-copy behavior change and unnamed-origin naming, cross-linked to harper-pro#1249; cross-model reviewed per the engineering guidelines; no customer names; no settings that do not exist in the code.

Dispatch: task docs-harper-pro-1249-base-copy-liveness · queued by task:harper-pro-base-copy-liveness · ran by claude/opus/xhigh · worker kzyp-xps-1

Ready-For-Promotion: 33a9412 urgency=normal late=none

Review-Coverage: authored=claude; ran=gemini,cursor-composer,codex; adjudicated=domain; declined=cursor-grok,muse; rounds=6; full=1 @ 33a9412

Review-Attention: skim ~2m (decisions: fixed-constants-as-contract, origin-name-encoding-public, purge-bound-detail-level) @ 33a9412

kriszyp and others added 4 commits November 3, 2026 07:38
…origins for 5.4

Companion to HarperFast/harper-pro#1249: the cluster_status stuckCopy field
(retrying, held, refused), the per-log purge-bound rule that stops idle
databases from forcing base copies, and unnamed-origin-<id>@<node> naming.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Dispatch-Task: docs-harper-pro-1249-base-copy-liveness
Name the reporting node for reverse copies, count refusal-reason changes as
log transitions, scope `held` to one database, and list manual
delete_transaction_logs_before purges among the conservative copy cases.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Dispatch-Task: docs-harper-pro-1249-base-copy-liveness
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Dispatch-Task: docs-harper-pro-1249-base-copy-liveness
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Dispatch-Task: docs-harper-pro-1249-base-copy-liveness
@kriszyp kriszyp added this to the v5.4 milestone Nov 3, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the documentation for version 5.4.0, detailing changes to replication behavior such as when a peer forces a base copy, handling rows from unnamed origins, and the introduction of the stuckCopy status in cluster_status. The review feedback suggests several improvements to readability and clarity, including splitting a long warning sentence in transaction.md into distinct sentences, correcting awkward phrasing in the replication guides, and replacing mid-sentence <VersionBadge> components with plain text as per the repository's guidelines.

Comment thread reference/database/transaction.md Resolved
@github-actions
github-actions Bot temporarily deployed to pr-791 November 3, 2026 15:13 Inactive
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

🚀 Preview Deployment

Your preview deployment is ready!

🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-791

This preview will update automatically when you push new commits.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Dispatch-Task: docs-harper-pro-1249-base-copy-liveness
@github-actions
github-actions Bot temporarily deployed to pr-791 November 3, 2026 15:23 Inactive
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

🚀 Preview Deployment

Your preview deployment is ready!

🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-791

This preview will update automatically when you push new commits.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Dispatch-Task: docs-harper-pro-1249-base-copy-liveness
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

🚀 Preview Deployment

Your preview deployment is ready!

🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-791

This preview will update automatically when you push new commits.

@kriszyp
kriszyp marked this pull request as ready for review November 3, 2026 15:30
@kriszyp
kriszyp requested a review from a team as a code owner November 3, 2026 15:30
@kriszyp
kriszyp merged commit 97b1f1c into main Nov 3, 2026
13 of 14 checks passed
@kriszyp
kriszyp deleted the docs/stuck-base-copies branch November 3, 2026 15:30
kriszyp added a commit to HarperFast/harper that referenced this pull request Nov 5, 2026
…origins for 5.4 (HarperFast/documentation#791)

* Document stuck base copies, purge-bound retention copies and unnamed origins for 5.4

Companion to HarperFast/harper-pro#1249: the cluster_status stuckCopy field
(retrying, held, refused), the per-log purge-bound rule that stops idle
databases from forcing base copies, and unnamed-origin-<id>@<node> naming.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Dispatch-Task: docs-harper-pro-1249-base-copy-liveness

* Tighten stuck-copy and purge-copy wording from review

Name the reporting node for reverse copies, count refusal-reason changes as
log transitions, scope `held` to one database, and list manual
delete_transaction_logs_before purges among the conservative copy cases.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Dispatch-Task: docs-harper-pro-1249-base-copy-liveness

* Describe the manual-purge copy point as at most the given timestamp

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Dispatch-Task: docs-harper-pro-1249-base-copy-liveness

* Point the Learn copy statements at the 5.4 base-copy rule

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Dispatch-Task: docs-harper-pro-1249-base-copy-liveness

* Smooth the purged-history wording and split the purge warning

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Dispatch-Task: docs-harper-pro-1249-base-copy-liveness

* Link the health-checks returning-node note to the 5.4 base-copy rule

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Dispatch-Task: docs-harper-pro-1249-base-copy-liveness

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
kriszyp added a commit to HarperFast/harper-pro that referenced this pull request Nov 5, 2026
…origins for 5.4 (HarperFast/documentation#791)

* Document stuck base copies, purge-bound retention copies and unnamed origins for 5.4

Companion to #1249: the cluster_status stuckCopy field
(retrying, held, refused), the per-log purge-bound rule that stops idle
databases from forcing base copies, and unnamed-origin-<id>@<node> naming.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Dispatch-Task: docs-harper-pro-1249-base-copy-liveness

* Tighten stuck-copy and purge-copy wording from review

Name the reporting node for reverse copies, count refusal-reason changes as
log transitions, scope `held` to one database, and list manual
delete_transaction_logs_before purges among the conservative copy cases.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Dispatch-Task: docs-harper-pro-1249-base-copy-liveness

* Describe the manual-purge copy point as at most the given timestamp

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Dispatch-Task: docs-harper-pro-1249-base-copy-liveness

* Point the Learn copy statements at the 5.4 base-copy rule

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Dispatch-Task: docs-harper-pro-1249-base-copy-liveness

* Smooth the purged-history wording and split the purge warning

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Dispatch-Task: docs-harper-pro-1249-base-copy-liveness

* Link the health-checks returning-node note to the 5.4 base-copy rule

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Dispatch-Task: docs-harper-pro-1249-base-copy-liveness

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>

This branch was successfully deployed

1 active deployment
pr-791 — 33a94126 Deployed Nov 3, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant