Repository navigation
Document Fabric load balancing, status-check, and taking an unhealthy node out of rotation - #729
Merged
dawsontoth merged 1 commit intoOct 14, 2026
Conversation
dawsontoth
force-pushed
the
docs/fabric-node-availability
branch
from
October 12, 2026 21:43
29d62b5 to
5b43cc9
Compare
dawsontoth
changed the base branch from
main
to
learn/administration-production-reliability
October 12, 2026 21:43
dawsontoth
added this pull request to stack #730
October 12, 2026 21:44
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces new documentation and guides regarding load balancing, node availability, and taking unhealthy nodes out of rotation in Harper Fabric, complete with a sample JavaScript implementation for an automated availability loop. It also updates the operations API reference to clarify that status records are persisted in the system.hdb_status table and survive restarts. Feedback on the code suggests optimizing the node-checking logic by parsing and comparing hostnames locally to avoid redundant self-requests.
Member
|
Looks to be some conflicts. |
Member
|
Otherwise great work on this. I like it! |
… node out of rotation Add a Learn guide for applications on Fabric that feed their own health into the node's availability record, which Fabric's status-check component serves to the load balancer at GET /status. It covers when to do it, six safety rules (hysteresis; never undoing Fabric's or an operator's write, tracked by the record's __updatedtime__ in a non-replicated marker table and re-read before every write; never taking the last node out; a recheck right after going out; surviving restarts; warn logging and an off switch), a generic sample component, a local drill against a throwaway Harper with the real status-check component and the CLI's harper login, and caveats, including the narrow windows a set_status without compare-and-swap leaves open. Add a Fabric page for status-check: what GET /status answers, that POST and DELETE need a super user, that the record is per node, persisted and not replicated, and how to take a node out with harper login and harper set_status, locally or from GitHub Actions with OIDC, as a role whose operations list names only set_status and get_status (v5.3.0). It warns not to deploy the @harperdb/status-check npm package on Fabric. In the set_status reference, say that set_status stores only status, that Harper core does not act on status values, and that on Fabric the availability record decides routing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dawsontoth
force-pushed
the
learn/administration-production-reliability
branch
from
October 14, 2026 01:13
cc7e165 to
cc92816
Compare
dawsontoth
force-pushed
the
docs/fabric-node-availability
branch
from
October 14, 2026 01:13
189251c to
eed055a
Compare
dawsontoth
removed this pull request from stack #730
October 14, 2026 18:44
dawsontoth
merged commit Oct 14, 2026
0f403ab
into
learn/administration-production-reliability
13 of 14 checks passed
🧹 Preview CleanupThe preview deployment for this PR has been removed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
⊙ Problem
Fabric's load balancer sends new connections to every node whose
GET /statusanswers200. That answer comes from thestatus-checkcomponent Fabric deploys, which reads the node'savailabilityrecord. So a node keeps getting traffic while its application fails, and no page covers the component or a safe way out.❓ Your call: is a guide with a sample loop warranted?
Yes: the pattern already runs in production on Fabric, and without its rules a loop can fight Fabric or take every node out. The alternatives are documenting only the manual drain, or shipping the loop as a published component so copies get fixes; both are easy to move to later.
💡 Solution
status-check, and shows how to take a node out with the Harper CLI, from a laptop or GitHub Actions with OIDC, without a super user.set_statusreference now says it stores onlystatus, and links the Fabric page.❓ Your call: fix #671's Administration page there or here?
#671's traffic-admission guide says nothing in Harper acts on
set_status, and has Fabric readers deploy the npm@harperdb/status-check, which collides with Fabric's/status. This PR only reconciles from the Fabric side. I'd scope those lines to self-managed clusters in #671; editing them in this stacked PR is the alternative.❓ Your call: are the Fabric facts right?
The pages say only what I could verify in source or on a live Harper, or was told. A Fabric owner should confirm these before the PR leaves draft.
Questions for a Fabric owner
200passes. The guide's 30 s and 60 s don't allow for it.:9925, where the CLI sends a target with no port.Availableon new nodes, and after an upgrade even when the node wasUnavailablebefore it?status-checkshow in Studio's Applications list, where a customer could remove it?server.workerIndex, which the guide uses, get an entry inreference/http/api.md?status-check-fabricREADME says table writers mayPOSTandDELETE; only super users can (a non-super user gets403). Fix it upstream?harper restartprinted "Harper is already running" and restarted nothing, andharper get_status id=availabilityon a node with no record errors after printingnull.🔧 Changes
learn/developers/taking-a-node-out-of-rotation.mdx: the guide. The rules, the sample, the drill and the caveats.fabric/load-balancing.md: thestatus-checkreference, its routes, a warning not to remove it, and the CLI and OIDC route.reference/operations-api/operations.md: two additions on top of Add production reliability guides for Harper operators #671's rewrite of this paragraph, and "Harper core" where it says Harper does not act on status values.sidebarsFabric.tsandsidebarsLearn.ts: register the two pages.✅ Verification
v5.3.2: the record's table is persisted withreplicate: false,set_statusstores only{ status },server.operation()skips authorization by default, and theset_statusrole grant first shipped inv5.3.0.status-check, including theharper loginflow and a role limited toset_status. Every drill step behaved as the guide says (details below).npm run format:checkis clean.npm run buildfails only on Add production reliability guides for Harper operators #671's ownTODOlink; with that link patched locally, it passes and every new link resolves.Live results on Harper 5.3.2
/status:404with no record,200withAvailable.DELETE:401anonymous,403non-super user,204super user. The record survived a full stop and start.operationslist isset_statusandget_statusranset_status;list_usersanddrop_userwere refused, and itsPOST /statusgot403./statusat404, it stayed in and warned once; it went out at the next look once that node returned.Availablewhile out was left alone, including across a stop and start (46 s, still failing). An operator'sUnavailablewas never undone.Unavailablewritten 0.5 s after it, and left alone one written 10 s after it./Healthrequests reached the dependency once.🤖 Generated by Claude Opus 5.5 via Claude Code; posted via @dawsontoth.
Related PRs: #671 overlaps (this PR is stacked on it; same set_status paragraph), 10 others independent
Complexity: medium
Review-Coverage: authored=claude; ran=cursor-composer,codex,gemini,cursor-muse; adjudicated=domain; declined=cursor-grok,cursor-kimi; rounds=4; full=2 @ eed055a
Review-Attention: study ~9m (decisions: do-less-alternative, ownership-by-timestamp-inference, aside-suspends-loop, health-cache-shape, app-writes-lb-record, document-external-component-contract; raised: open major) @ eed055a