Skip to content

Document replicaExpiration and replicaRefreshFraction for residency tables - #746

Merged
kriszyp merged 7 commits into
mainfrom
docs/replica-expiration
Oct 24, 2026
Merged

kriszyp merged 7 commits into
mainfrom
docs/replica-expiration

Conversation

@kriszyp

@kriszyp kriszyp commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

📝 Summary

Documents the two @table arguments the local replica tier adds for tables sharded with setResidency: replicaExpiration (seconds a record fetched from a resident node is kept locally; default 3600; 0 keeps remote reads) and replicaRefreshFraction (the share of that lifetime after which a read renews it; default 0.5; 1 is fixed). The sharding page says what a replica is and is not, that setResidencyById tables keep none, and that replicateFrom: false returns a replica the node holds; the 5.4 release notes get an entry; the argument section explains the lifetime, the sweep and the renewal.

Companion to HarperFast/harper#3375 and HarperFast/harper-pro#1101 (the feature; this page should merge with them). Open PR #691 adds a row to the same @table table; whichever merges second keeps both rows.

🤖 Generated by Claude Fable 5.1; posted via @kriszyp.

Release target: main — documentation for the 5.4 replica tier

Related PRs: #691 overlaps
Complexity: simple

Review-Coverage: authored=claude; ran=gemini,cursor-composer,codex; adjudicated=domain; declined=cursor-grok,cursor-kimi,cursor-muse,muse; rounds=2; full=1 @ 5b20880

Review-Attention: skim ~2m (decisions: default-on-replicas, ship-docs-before-feature-tag) @ 5b20880

kriszyp and others added 3 commits October 21, 2026 07:19
…ables

Dispatch-Task: hp-residency-replica-tier
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JxKx7SjhcDpWXLNcydYC7g
…hor, and note the 5.4 change

Dispatch-Task: hp-residency-replica-tier
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JxKx7SjhcDpWXLNcydYC7g
Dispatch-Task: hp-residency-replica-tier
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JxKx7SjhcDpWXLNcydYC7g
@github-actions

Copy link
Copy Markdown

🚀 Preview Deployment

Your preview deployment is ready!

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

This preview will update automatically when you push new commits.

@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 adds documentation and release notes for local replicas of records fetched from other nodes in v5.4.0, introducing the new @table arguments replicaExpiration and replicaRefreshFraction. The feedback suggests avoiding the use of the <VersionBadge> component at the start of a paragraph in running prose within reference/replication/sharding.md, recommending plain text instead.

Comment thread reference/replication/sharding.md Outdated
With this approach, record metadata (including residency information) and indexed properties are replicated to all nodes, but the full record is only stored on the specified nodes.
With this approach, record metadata (including residency information) and indexed properties are replicated to all nodes, but the full record is only stored on the specified nodes, apart from the short-lived replicas described next.

<VersionBadge type="changed" version="v5.4.0" /> A node outside a record's residency that reads the record fetches it from a resident node and keeps the result as a local replica for `replicaExpiration` seconds (default one hour), renewed by reads after `replicaRefreshFraction` of that time. The record stays where the residency function placed it: a replica is never written back, replicated onward or counted as a resident, and a resident's write turns it back into a stub so the next read fetches the new version. See the [`@table` arguments](../database/schema.md#replicaexpiration-and-replicarefreshfraction).

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.

medium

Avoid using the <VersionBadge> component at the start of a paragraph in running prose. Use plain text (e.g., 'As of vX.Y.Z') instead, reserving <VersionBadge> for standalone placement after headings.

Suggested change
<VersionBadge type="changed" version="v5.4.0" /> A node outside a record's residency that reads the record fetches it from a resident node and keeps the result as a local replica for `replicaExpiration` seconds (default one hour), renewed by reads after `replicaRefreshFraction` of that time. The record stays where the residency function placed it: a replica is never written back, replicated onward or counted as a resident, and a resident's write turns it back into a stub so the next read fetches the new version. See the [`@table` arguments](../database/schema.md#replicaexpiration-and-replicarefreshfraction).
As of v5.4.0, a node outside a record's residency that reads the record fetches it from a resident node and keeps the result as a local replica for `replicaExpiration` seconds (default one hour), renewed by reads after `replicaRefreshFraction` of that time. The record stays where the residency function placed it: a replica is never written back, replicated onward or counted as a resident, and a resident's write turns it back into a stub so the next read fetches the new version. See the [`@table` arguments](../database/schema.md#replicaexpiration-and-replicarefreshfraction).
References
  1. Avoid using the component at the start of a paragraph in running prose. Use plain text (e.g., 'As of vX.Y.Z') instead, reserving for standalone placement after headings.

LMDB remote reads remain proxy reads and never arm replica maintenance.
Match the Float schema argument and explain the sweep interval floor.

Dispatch-Task: harper-3375-audit-refs-regression
Co-Authored-By: GPT-5 Codex <noreply@openai.com>

kriszyp commented Oct 23, 2026

Copy link
Copy Markdown
Member Author

Updated this companion in fa903ea for the RocksDB-only contract in harper#3375.

  • Local replicas are RocksDB-only. LMDB continues proxying remote reads, stores no replica and never arms the replica sweep; option validation still applies.
  • replicaExpiration is a GraphQL Float. The sweep interval is a quarter of the configured lifetime with a one-second minimum.
  • Updated schema reference, sharding guidance and the v5.4 release note. Full-tree format:write and format:check pass with this repository’s pinned Prettier 3.8.1/code-guidelines 0.1.2. A site build was not run locally; this prose update adds no new links or code examples.

Keep this PR draft and coordinate publication with core #3375 and harper-pro#1101. The previous review footer covers the prior docs revision; this update has not had a separate outside-model docs review.

🤖 Generated by OpenAI Codex; posted via @kriszyp.

@github-actions

Copy link
Copy Markdown

🚀 Preview Deployment

Your preview deployment is ready!

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

This preview will update automatically when you push new commits.

@github-actions
github-actions Bot temporarily deployed to pr-746 October 23, 2026 21:23 Inactive
Reload RocksDB workers after changing replica settings; existing classes can
retain their previous values. Disabling admission does not purge old replicas.

Dispatch-Task: harper-3375-audit-refs-regression
Co-Authored-By: GPT-5 Codex <noreply@openai.com>
@github-actions
github-actions Bot temporarily deployed to pr-746 October 23, 2026 21:48 Inactive
@github-actions

Copy link
Copy Markdown

🚀 Preview Deployment

Your preview deployment is ready!

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

This preview will update automatically when you push new commits.

Dispatch-Task: harper-3375-audit-refs-regression
Co-Authored-By: GPT-5 Codex <noreply@openai.com>

kriszyp commented Oct 23, 2026

Copy link
Copy Markdown
Member Author

Updated the schema reference in 75abed5 to match the live option-propagation repair in harper#3375.

Schema rescans apply replica options to already-loaded worker classes. New lifetimes apply to subsequent admissions and renewals; existing deadlines are not rewritten. Lifetime zero stops new admissions and the sweep without purging existing replicas. The obsolete worker-reload warning is removed. Replicas remain RocksDB-only; LMDB remains proxy-only after every update.

Full-tree format:write/check passes with the pinned docs formatter. Core’s real two-worker tests pass on Node 22/24/26 and both engines. No local docs site build or separate outside-model review of this prose revision was run. Keep this companion draft and merge it with core #3375 and harper-pro#1101.

🤖 Generated by OpenAI Codex; posted via @kriszyp.

@github-actions
github-actions Bot temporarily deployed to pr-746 October 23, 2026 22:11 Inactive
@github-actions

Copy link
Copy Markdown

🚀 Preview Deployment

Your preview deployment is ready!

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

This preview will update automatically when you push new commits.

Dispatch-Task: harper-3375-audit-refs-regression
Co-Authored-By: GPT-5 Codex <noreply@openai.com>
@github-actions

Copy link
Copy Markdown

🚀 Preview Deployment

Your preview deployment is ready!

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

This preview will update automatically when you push new commits.

@kriszyp
kriszyp marked this pull request as ready for review October 24, 2026 15:35
@kriszyp
kriszyp requested a review from a team as a code owner October 24, 2026 15:35
@kriszyp
kriszyp merged commit 34b029d into main Oct 24, 2026
14 checks passed
@kriszyp
kriszyp deleted the docs/replica-expiration branch October 24, 2026 15:36

This branch was successfully deployed

1 active deployment
pr-746 — 77e65264 Deployed Oct 23, 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