Repository navigation
Replicate sharded tables through database shard maps - #1116
Merged
Merged
Conversation
This was referenced Oct 24, 2026
There was a problem hiding this comment.
Code Review
This pull request implements declarative residency agreement and wire references for replication, introducing topology agreement checks, slot reference resolution, and wire encoding reframing, alongside comprehensive integration and unit tests. The review feedback focuses on improving the robustness of these new tests by avoiding optional chaining in assertions and explicitly verifying that parent objects exist before accessing their properties to prevent vacuous passes or unhandled TypeErrors.
kriszyp
force-pushed
the
feat/residency-replica-tier
branch
from
October 24, 2026 08:08
c26d2ba to
15609fe
Compare
kriszyp
force-pushed
the
feat/residency-replica-tier
branch
from
October 24, 2026 15:13
15609fe to
a704a21
Compare
kriszyp
force-pushed
the
feat/slot-residency
branch
from
October 25, 2026 15:58
0f8507f to
726b9ef
Compare
This was referenced Oct 25, 2026
kriszyp
marked this pull request as ready for review
October 26, 2026 16:24
kriszyp
marked this pull request as draft
October 26, 2026 18:48
Dispatch-Task: hp-980-slot-residency Co-Authored-By: GPT-5 Codex <noreply@openai.com>
Dispatch-Task: hp-980-slot-residency Co-Authored-By: GPT-5 Codex <noreply@openai.com>
Dispatch-Task: hp-980-slot-residency Co-Authored-By: GPT-5 Codex <noreply@openai.com>
Dispatch-Task: hp-980-slot-residency Co-Authored-By: GPT-5 Codex <noreply@openai.com>
Dispatch-Task: hp-980-slot-residency Co-Authored-By: GPT-5 Codex <noreply@openai.com>
Dispatch-Task: hp-980-slot-residency Co-Authored-By: GPT-5 Codex <noreply@openai.com>
Dispatch-Task: hp-980-slot-residency Co-Authored-By: GPT-5 Codex <noreply@openai.com>
Preserve peer errors across stale or incomplete setup, report policy conflicts separately, publish live map extensions before slot references, and refuse unknown receiver membership. Require fresh owner liveness, cache shared agreement views, and test these failures through real sender and receiver paths. Dispatch-Task: hp-980-slot-residency Co-Authored-By: GPT-5 Codex <noreply@openai.com>
Dispatch-Task: hp-980-slot-residency Co-Authored-By: GPT-5 Codex <noreply@openai.com>
Dispatch-Task: hp-980-slot-residency Co-Authored-By: GPT-5 Codex <noreply@openai.com>
This was referenced Oct 27, 2026
…lobs Validate stored owned blobs after durable copy finalization, retain the resume cursor during a hold, and permit certification after repair. Keep #1140 repair intact and remove unused projection cursor writes. Dispatch-Task: hp-980-slot-residency Co-Authored-By: GPT-5 Codex <noreply@openai.com>
Dispatch-Task: hp-980-slot-residency Co-Authored-By: GPT-5 Codex <noreply@openai.com>
This was referenced Oct 28, 2026
Report a resident's full-write head in GET_RECORD answers, so readers keep replicas only of it
#1177
Merged
…e regressions Dispatch-Task: hp-980-slot-residency Co-Authored-By: GPT-5 Codex <noreply@openai.com>
…ltext binding Dispatch-Task: hp-980-slot-residency Co-Authored-By: GPT-5 Codex <noreply@openai.com>
Dispatch-Task: hp-980-slot-residency Co-Authored-By: GPT-5 Codex <noreply@openai.com>
Exercise bootstrap recovery with supported key-derived placement and strengthen receiver completion barriers. Dispatch-Task: hp-980-slot-residency Co-Authored-By: GPT-5 Codex <noreply@openai.com>
Dispatch-Task: hp-980-slot-residency Co-Authored-By: GPT-5 Codex <noreply@openai.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Dispatch-Task: hp-980-slot-residency Co-Authored-By: GPT-5 Codex <noreply@openai.com>
Dispatch-Task: hp-980-slot-residency Co-Authored-By: GPT-5 Codex <noreply@openai.com>
…acts Model certified replica replies, retain uncertified read-through coverage, and assert failed observers detach immediately. Dispatch-Task: hp-980-slot-residency Co-Authored-By: GPT-5 Codex <noreply@openai.com>
Keeps #1177's fullWriteHead in GET_RECORD answers alongside this branch's residencySlot; the copy walk keeps this branch's copyExtendedType, which already masks FULL_WRITE_HEAD, so main's copiedFlags is dropped. Core moves from harper#3527's head to its squash merge b29241296 (adds only #3706, #3708). Dispatch-Task: pr-maint-harper-pro-1116-rebase Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017xoBA8UtKfgJoZfMDdzpyv
…closing review - Unsharded databases no longer read the shard map on every received frame: the pre-scan reads it only when a table declares residency, and latches a seen map (maps cannot be deleted). - An owned copy records a durable pending marker at COPY_START, cleared only after certification; a subscription that finds it uncertified requests a full copy, so an empty copy interrupted before certification restarts. - A subscriber's recovery bound is persisted only after send authorization, including the current hdb_nodes grant, so a denied subscriber leaves no recovery state. - The sharded pre-scan skips a refused table generation's records, as the apply loop does, instead of closing 1011 on an invalidation. - The replica-copy test asserts byte equality with the demoted stub again. Dispatch-Task: hp-1116-closing-majors Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017xoBA7buDq27rAZLsiCHKj
The per-frame declaration scan was linear in the database's table count. Cache only the negative verdict, cleared by the updateTable listener the admission cache already uses and by a TABLE_FIXED_STRUCTURE; a positive scan exits at the first declared table, so a drop needs no invalidation. Dispatch-Task: hp-1116-closing-majors Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017xoBA7buDq27rAZLsiCHKj
This was referenced Oct 28, 2026
kriszyp
marked this pull request as ready for review
October 28, 2026 15:10
kriszyp
added a commit
that referenced
this pull request
Oct 28, 2026
Combines origin-floor checkpoints with main's sharding work (#1116): - seqUpdateEndTxn keeps the projection early return and queues the commit confirmation of a drained release beside the floor/route-state handling. - buildOriginCursorVector takes `admits` before `floorOnly`, keeping main's signature; the checkpoint callbacks follow it. - The relocated SUBSCRIPTION_UPDATE sender carries the include-cursor and bare-origin handling. - A sharding projection copy marks no route state (its end_txn publishes none) and keeps the copy cursor and owned-copy marker semantics main defined. - core is pinned to harper main 27a6f6f36, which contains the merged copy-bound admission (harper#3649) and harper#3686. Dispatch-Task: hp-1092-repin-main-20261028 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017xoBA9NugSVmQfPsr7FeW2
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
Operations and replication workers cannot rely on application residency hooks to enforce record ownership. Owners also need complete recovery sources before resuming sharded writes.
🤔 Scope and recovery contract
The bounded contract is intentional: owned snapshots require a certified co-owner or complete backup. A node that loses its origin audit must use a fresh root and new name for snapshot recovery. Same-name recovery requires its complete original audit. A missing frozen start holds the whole database stream, including ordinary tables; stop all database writes and preserve unique local data before replacing the root.
💡 Solution
Support primary-key hashing only; refuse
byandslotFromwith #1178. Use the persisted@shardedpolicy and database map on every thread. Negotiate placement and recovery capability, certify initial owner baselines, and expose recovery holds incluster_status. Keep retired-origin logs relayable after membership removal.All three PRs remain draft; the closing scope is prepared for Kris to promote after CI and review.
Refs #980 and #436.
Depends-on: harper#3527
Companions: core #3527, docs #753.
⚖️ Alternatives
Public gate and retained experimental coverage
Supported scope: primary-key hashing only. Schema load refuses
byandslotFromwith P1/v5.4 concurrent-move design #1178. The retained implementation is behind the undocumented test-onlyreplication.experimentalAttributeSlotsswitch; actual attribute placement additionally requires nativeusesAbortMarkersand enabledstorage.rocks.transactionLogAbortMarkers. Markers do not solve ordinary concurrent moves. Round22/23 regressions remain issue-linked skips; the explicit legacy diagnostic reproduces the owner wipe on 2.12.0. No serialization or compensating re-save is introduced.Architecture alternatives and framing
Application callbacks cannot enforce placement on every thread. Recomputing ownership when configuration changes would move data without a migration. The installed map stays authoritative; slot moves and incarnation-based recovery remain separate work.
Framing-Verdict: chosen-approach-sound for the original architecture and core closing admission gate (17fab807b032). The final Pro planning reviewer proposed further failed-source inventory optimization (9550f6f252c4, better-alternative-exists). The implementation adopts bounded blob settlement, watchdog renewal and owned-only failure tracking. A capped per-key failure inventory is deferred: only an actual owned failure invalidates the scan; successful live traffic retains the completed proof. This author scope ruling is distinct from reviewer clearance. Targeted implementation review and its limitations are recorded below.
Retained contracts and review rulings
🤔 Complete shared history
A sharded database must retain a complete origin prefix, including ordinary-table transactions. A permanent apply error holds delivery until repaired. Missing frozen starts refuse the whole stream; local acknowledgments still mean local durability. Preserve unique ordinary writes before replacing the root. Arbitrary stale backups and new-root inheritance remain outside the approved recovery contract.
🤔 Evidence and activation fences
Cache only complete negative prior-origin evidence. An unavailable member keeps admission closed and triggers bounded retries. Existing-owner certification keeps its map fence while collecting proof; moving proof outside it would need another authority fence. This cold recovery cost is accepted to prevent a known replacement from certifying itself.
🤔 Reconnect availability
A below-issuance peer cursor waits briefly for older reservations, then refuses only that subscription until the closed floor catches up. Independent writers remain ready. A genuinely future cursor retains the durable recovery hold; clock skew or an authenticated bad cursor can prolong it. The highest committed key still cannot prove an earlier prefix closed.
🤔 Projection restart and point-read costs
Projection recovery deliberately restarts its non-owner walk; its separate completion marker never certifies owned origins. Sequence and frame commits omit redundant flushes; completion publication keeps its durability barrier. The unread projection cursor has been removed. Remote point reads also reconstruct frozen-start evidence before authorizing an owner response. #1121 records both costs; do not add a new resume protocol or stale-authority cache without measuring and preserving invalidation.
🤔 Test cleanup checks
Temporary roots pass through
stopAndTeardownNodestoteardownHarper, which removesdataRootDirafter stopping the node. Scalar configuration restores accept undefined. If a fixture’s initial module import fails, Mocha retains the original setup failure alongside any secondary teardown error.🤔 Remaining review limits
Closed-continuation tests were checked by removing the actual guards: both mutants fail. Earlier broad reviews reported trace/input limits; the closing review is targeted to group (a) repairs. This is not fresh whole-feature coverage. Brief compatibility comments remain.
🤔 Placement overhead
Placement validation and per-peer encoding add work. Pro #1121 tracks measured and still-unmeasured optimization work; this PR makes no zero-overhead claim.
🤔 Review depth
Review limitations are detailed below. The owner limited this closing batch to introduced correctness and required invariants; the remaining root causes are filed below.
Closing review classification — correctness repairs and filed deferrals
Closing review classification
All original 61 core, 64 Pro and 17 docs findings and targeted additions are classified below. The 48 group(b) root-cause issues retain priority/effort/type/parent and Review-Deferral markers. Attribute moves are unavailable publicly and tracked in P1/v5.4 #1178. Only targeted delta reviews were requested.
d08dacea0a75,e11f0afa6ffac9a22b0acc08,71fcfdf4e367,5f72a22d756a231d22b5691a,f84015c7bbb6,f2476772f79e5f9ab790c4da,2ea50c90065d,41608bda4551,4a35b52a2ff2,ccf51ca668ea,4399824535e6,177f1e87c350,65b8bafa4bd6,8507e0aa571b7f700aa51b65,9271cb3498d9d31b8a6bf7a4,928590eeefc5,6564f91f74ad,8c031a860027,7e2708d531301f63404554ac,e1cc6a71e52f,ed7513b9e61b03931ac171b9,c28f8c0c1f48,d73aaea06456,e15f99beec15d1bf6fa407a7,b0308353f80c,464473449148de00e9453145,bc879b0fc7f2,67ab738c8452,b0b2309370c6,171c2e12c320a2106a5273ba,7a6175f56276,3332e121bd29,2502542a9c82,e3f5b1a168c2,220bb4607cc4,049e6b6f04a6,c617c2ebee4b,eaead4d3791cc87a1fc96024,dd1d061a2cdb,c43607abe67a,0d6039d3b957,dba44b67b104d7f9f5e17cd5,d7dff86b04f13aa663632940,ead3f513eb35,5de8cd976ec7,940a8bae0a19,ed5d02096333,3a9255072048,827efff12e79,ee89c62149c5,890a280751b628c4c1137978,faa4f5d8edc5,5f3a066ea90a,56f44186d21c,16e614891103259f11e7ebf7,46633ce1fa85,34e2ed97f9ea362311b5b0c2c92591f49d5a,d1473de22beb,4f913bc24ef2f03d892c931df24170806c6c,2729b9d65fc8,7413e4bf79b7,c65a0edf4bc8,296fb5c5c49a79b036c0e635,b806a7b670b6,7ce810571c2db6d58bb58890fe0666935cce,f1b7d8e8bff6,7a4fc941e8b2,c1c75dae87bf21bfcb76aaee2676a11a36f3,40d95f432124,37a329713c7e,2474456aa33e,4c57133499240921aec60494,ad082d4bf1f6271be31344ab,0c5bb3089eb2,724aef02bb08,617254a6e786edd6598980b4,1e5a0de8ef0c,ac1cd68a3936,903679324d6f,5ec511d08c03,1ff8b5916ebbe489942aa72a,dd866273d655,3c8bc5a58907c676b787b0ab,837d03c38113,af6dab02b66a3881670257c20b0506e63f05,b0a8a01db1edfecd77f1649c,c2d5c264fbd8,3bfa2a5dfa91a7c27fda57bb,8304b7c6def7,314b285ca385,8dc6c2eac9ce,f67769120b980f1febdbcc1e,795551d183b00798040a08b3,903b0d4daeb264916b1c6e79,1d23c2db74f8,0115bd042ad6,89ef798441ef88a12bcaf874,40cf98321118,b3ad4eef21def2a2e2eca947,a643b6b77b5fe85ee8f7c761,aa8246b72638,153deeb4a98b,6ebff25a9bd1,8198df475e36,515b35fe0778,c6e50ddfdaa5,bfb82d873f1c,0cfe7f229e32,801e846c7e20,845b7f66194f92851a9d60357989328a1464,d156359ae8b6,2bee1bd6cfea,2a36f8e47e6f,d2cd6905d973,1a45579ad7036a333cf67182,c19df687257560302b3469f4,b25db39385e494eb3020d6da0aa847518e69,236d2aca8282,05fde5b867a86023c031ab85ae8406f1b840,a7d8cf54bc2dbbfe6d75bc77389141547e45f5e8a7cb4317,349f87e33376,daa3ceb63491,30fef8cf100b,825cd30bcc74,3d0079dda160,a4ceaf0e7935a59e3c86a674,0b0002fca1d4a8c85b56b9b3,5b8acf33e644ca3f0675072b,a00453f25016,43a3811e8a6b,bffb3e786fbc12b155edfbaee2cd859b21ae,68c9d5e35b37f66e1e4396a8,ef69bacff12e,e6d8d8a3bbd9,ac4238cd55d6,e08ed8068c6f4826f528b8afTargeted closing rulings
f66e1e4396a8,ef69bacff12ee6d8d8a3bbd9,ac4238cd55d6220bb4607cc4,049e6b6f04a6c617c2ebee4b,eaead4d3791cc65a0edf4bc8,296fb5c5c49a4f913bc24ef2e08ed8068c6fdba44b67b104e15f99beec158507e0aa571b890a280751b616e6148911037f700aa51b657ce810571c2d6ebff25a9bd12a36f8e47e6f,d2cd6905d973,1a45579ad703515b35fe0778,c6e50ddfdaa5bfb82d873f1c,0cfe7f229e32801e846c7e20,845b7f66194f4c5713349924b3ad4eef21de5ec511d08c03,1ff8b5916ebb4826f528b8afFinal delta test-coverage nit
lost-asia/lost-europeFinal outside-review claims about an uncaught optional watcher rejection and a live projection-cursor writer are refuted by
core/config/shardingConfiguration.ts(the returned promise has a reporting catch) and the absence of any productionshardingProjectionCursorwriter/reader. Historical metadata already written by older branch snapshots is inert. The incomplete-walk and bounded-settlement follow-up is #1167, not the unrelated #1177/#1178 numbers in the Cursor text. These are author evidence rulings, not new owner decisions.Closing-major rounds (
e6981556,ccc86ed8)Two full rounds (codex, gemini, cursor-composer, domain adjudication) resolved all four majors and the follow-up per-frame table-scan minor. Their other open findings are outside these hunks and are listed, not fixed, per the scope ruling: the owned-blob repair checkpoint that excludes the incomplete row (
replicationConnection.ts:4303, major, earlierbab61b0023c6), baseline publication re-certifying a revoked owned copy (shardingBootstrap.ts:874, major), the generation stamp race (residencyTopology.ts:91), unbound user-databaseDB_SCHEMAfiltering (:5920), lazy value decoding in the owned-blob walk (:4237), the recovery listener left after forced retirement (:5380), and fixture narration nits. The CLI's framing recheck, raised by theshardingBootstrap.tsmajor, was not run for the same reason.CI policy repair
resources/residencyPolicy.tsresources/residencyMaps.tsinframing_paths. CI main Node26 passed on main but failed on188d7f557; the focused workflow-format suite is now49/49.| Retained attribute-policy suite fails the public gate | (a) Test setup fixed on2728a8757: RED40 failures on66f17ee82; enable the private switch within the suite and skip actual attribute cases without native marker capability. Public/key checks run now:21 pass/41 pending in both modes;53 policy cases pass with a capability stub. |
| Replica wire and failed-startup fixtures lag core main contracts | (a) Tests fixed ondc9aa9ab: RED two selected failures on6dd2af0f;GREEN20 across both files. Certified fixture supplies full-write-head; uncertified reply is returned uncached. Live sender support stays in Pro#1177. Watcher rejection must detach all listeners. |
🔧 Changes
Product behavior, admission, and recovery walkthrough
Product and architecture tour
Map and policy agreement
Initialization and conversion operations install immutable maps, compare legacy placement, and capture explicit existing-owner assertions. Authenticated schema setup authorizes map/policy publication before records. Conflicts hold durable progress. Recovery capability level requires the current evidence format before sharded writers resume. Cluster diagnostics exposes missing agreement and recovery sources.
Map and policy agreement flow
The arrows show the admission order.
flowchart LR A[Authenticated peer] --> B[Map and policy agreement] B --> C[Baseline and origin admission] C --> D[Record placement]Placement and compatible records
Slot references bind a slot to map version and digest; compatibility encoding strips native slot headers for earlier peers. Owner reads resolve current owners. Confirmation deadlines bound explicit and automatic acknowledgment waits. Shared source authority publishes worker-visible state. Within the unsupported private attribute experiment, application
localOnlymoves away from the writer are refused before native submission because they cannot deliver the body. Other local-only writes need no confirmation; internal copy/replication apply remains exempt. Replicable non-owner attribute transitions require a connected new owner and durable acknowledgment; a failure after commit can be an uncertain outcome. Earlier-peer delivery support does not authorize activation with an incompatible sharding writer. The core companion supplies policy, storage, and transaction admission.Baseline, origin history, and recovery
Bootstrap coordinator establishes a durable all-member initial witness before enabling origins. Private bootstrap RPC runs over authenticated member connections. Frozen starts bind each native root to its originating name; inheritance cannot borrow another root's start. Shared issuance holds records copy/resume bounds before writes and prevents stale worker readiness. Source certificates require complete owned data and a durable frozen start, independent of a temporary clock hold.
Lost-history diagnosis refuses a reused name with prior admission evidence. Status names complete-backup/new-name remedies, and source subscriptions close before retention can force a copy loop. Complete stopped-node backups preserve the original audit; arbitrary stale backups do not satisfy that contract. New-name admission needs explicit negative prior-origin evidence from current members. Co-owner failover includes unavailable origins on existing co-owner streams. Removing the old node does not discard retained audit logs. Whole-shard loss needs a complete backup. Incarnation-based identity remains #1123.
Copy and replay boundaries
Subscription replacement gives each subscription its own replay buffers and progress. Owned copies require a certified same-shard source, and keep a durable pending marker until certified, so an interrupted copy, even an empty one, is requested again. Projection copies have separate completion state and never credit owned progress. Snapshot rows cannot certify per-origin maxima; native copy anchors use the physical source log. Self-origin copy rows preserve issuance bounds before application. The baseline sentinel drains preceding writes before its owned-blob walk. A completed clean walk waits for a fixed blob set and survives subsequent successful live work; cursor removal still waits for drain. A replacement pass invalidates old callbacks before clone revocation can yield. Initial inbound handshakes persist authenticated frozen starts before setup continues. The replication design and root design index record the invariants.
Native topology and recovery evidence
Four-node placement tests cover operations/pool parity, key hashing, cold reads, PATCH/DELETE, and topology disagreement. Private attribute fixtures require native markers and skip on 2.12.0. Their component configuration, schema, local evidence resources expose actual stored state.
Recovery tests exercise fresh bootstrap, co-owner failover, visible source loss, name reuse refusal, old/new-origin convergence after rename, and complete-backup restoration with pool off/on. Quarantine tests check both declaration orders and repair/restart behavior using the component config, root-level evidence.
Conversion tests assert every existing owner's completeness before waiting for sharded replication. They verify no movement, missing/mismatched assertions, and optional previous-binary downgrade/re-upgrade. Conversion configuration, legacy schema, legacy placement and inspection reproduce last-digit placement. Declarative activation is RocksDB-only.
Focused boundary tests
The focused tests cover negotiation, real socket admission and blob routing, schema authorization, slot encoding, uncertified replica answers, configuration, bounded RPC, durable bootstrap transitions, worker issuance holds, native reservations and reconnect admission, name/start evidence, source eligibility.
Replay and confirmation regressions exercise owner acknowledgment, failed frame holds, origin cursors, send-loop scheduling, RPC reply failure, cancelled and replaced subscriptions.
Interrupted copies and rolling declarations
Copy repair uses merged #1140's shared resolver unchanged. The sharded readiness gate checks owned stored blobs after durable copy completion, including rows skipped by a resumed cursor and repairs whose source returns ENOENT. A hold revokes readiness and retains the copy cursor; ordinary completion or repair rechecks the stored row before certification. The check runs outside the commit callback and generic bootstrap certificate helper. A completed walk waits for a fixed set of in-flight blobs, while newer blob-less or successful-blob commits no longer discard it. An owned source failure behind the iterator invalidates the proof; cursor removal retains its zero-work gates. The unused projection cursor is removed, preserving projection flush and completion state. Declaration agreement lets a local directive resolve the peer-policy cycle while map/config checks and live admission remain enforced. Fresh-name recovery verifies owned blob bytes immediately after readiness.
Integrated core dependency
The full-text dependency and locked platform packages use 0.7.0, matching the integrated core's required binding contract. Pro's release bundle reads this lockfile. RocksDB remains pinned to 2.12.0; abort-marker enablement remains separate.
Retry and QA regression fixtures
integrationTests/cluster/experimentalSharding.mjs, integrationTests/cluster/fixture-sharding-rolling/config.yaml, integrationTests/cluster/fixture-sharding-rolling/resources.js, integrationTests/cluster/fixture-sharding-rolling/schema.graphql, integrationTests/cluster/shardingRollingDeclaration.test.mjs, unitTests/replication/concurrentSlotMoves.test.mjs, unitTests/replication/fixtures/concurrentMoves/round22-stub-fallback-hook.cjs, unitTests/replication/fixtures/concurrentMoves/round22-stub-native-helper.cjs, unitTests/replication/fixtures/concurrentMoves/round22-stub-replication.cjs, unitTests/replication/fixtures/concurrentMoves/round23-no-retry-native-helper.cjs, unitTests/replication/fixtures/concurrentMoves/round23-no-retry-replication.cjs, unitTests/replication/fixtures/slotRetryReplication.cjs, unitTests/replication/shardingAbortMarkers.test.mjs. These cover marker-gated abort/replay/replication, interrupted cursorless copies, and per-node declaration reloads. Native marker probes skip unsupported bindings; the explicit legacy-failure mode is intentionally red on 2.12.0.
✅ Verification
The closing-major fixes are at
ccc86ed8:unitTests/replicationpasses 1621 with 14 pending, and the replica-copy check asserts byte equality with the demoted stub again. On an unsharded database with 100 tables, the per-frame gate drops from a 1,115 ns map read to a 5.4 ns cached check (turbo off, median of five 1M-call batches). Pro main, including #1177'sfullWriteHead, is merged in at1ce9bab4.corenow points at core #3527's merge on harper main (b29241296). Locally on1ce9bab4,residencyReplicaspasses 9/9 anddeclarativeResidencypasses 7 with 5 issue-linked skips. Those are the two suites that timed out on Node 26 cluster shards 5/6 and 1/6.🤔 Closing review's four majors: fixed here
Fixed per Kris's ruling; each regression fails on
1ce9bab4:Earlier published-head CI and merge order
At
dc9aa9ab, cluster shard 1/6 and shard 5/6 timed out waiting for replicas. Core requiresfullWriteHead === stub.version, and that Pro responder did not send the field. #1177 supplies it, and it is now merged in.The earlier owner-approved receipt exception for
dc9aa9abis retired: headccc86ed8has its own full-round receipt.Merge order: core #3527 and Pro #1177 are merged. This PR and documentation #753 stay draft until promotion.
Build, typecheck, required lint and targeted functional checks pass. Full integration is delegated to CI.
RED→GREEN evidence, native limits and QA
Build, typecheck and required lint pass. The post-main targeted batch passes 138 tests with 11 pending. The new round14 receiver regression fails on
1b5016ce, then passes for blob-less traffic and successful blob delivery while the live native commit is held; the certificate appears without discarding the completed walk, and the persisted copy cursor remains until commit drain. A source-ENOENT behind the iterator still withholds certification. The ownership-lookup failure regression is RED onb952a389and GREEN after cleanup is protected; the blob settles without an in-flight leak. Negative assertions now wait for walk completion or the persisted recovery hold. Supported bootstrap and restart-quarantine integration fixtures use verified key hashes without experimental skips; CI will execute these full scenarios.Merged #1140's copy repair is unchanged. F-1020 tests cover the interrupted first copy, source-ENOENT, checkpoint reconnect and persisted cursor; the published
323bf0cfailed the rebuilt repair/readiness cases. F-1021 covers B-first/A-second live declaration. The current key-derived round23 controls preserve the complete owner through real RocksDB sender/receiver and independent reopen. Attribute round22/23 probes remain issue-linked skips;HARPER_TEST_ATTRIBUTE_MOVE_LEGACY_RED=1intentionally reproduces both ordinary-concurrency owner wipes on 2.12.0.CI fixture corrections are RED on
6dd2af0f(two selected failures) and GREEN ondc9aa9ab(20 tests across the replica-wire and watcher files). Synthetic certified replies now include the full-write-head required by core main. A new negative case proves an uncertified reply returns its body without caching; the live sender field now comes from merged Pro #1177. Failed-startup tests now assert listener detachment.Fulltext 0.7.0 matches current core; RocksDB remains 2.12.0. Full integration runs in CI on the pushed heads. No benchmark lock or full local integration suite was used for this closing batch. Optional strict whole-tree lint has pre-existing warnings; required lint and changed-file formatting pass.
Final runtime targeted review: Claude, Gemini, Cursor Composer and domain adjudication completed on
95cd9f32; the cleanup, barriers, CI skips and lockfile findings were resolved. The redundant region loop is fixture hygiene under #1151; it exercises a database-wide refusal before owner routing. The broader incomplete-walk proposal stays author-classified group(b) under #1167. Subsequent core pins and replica/watcher test corrections have no new independent receipt; production code is unchanged. The tool requests a closing full round; the owner explicitly forbids one, so none will run. Earlier trace bookkeeping is retained, not claimed discharged.PR QA: Does a late shard owner killed during its empty owned copy's certification come back certified? — queued @ ccc86ed, qa-pr-harper-pro-1116-ccc86ed
🤖 Generated by OpenAI Codex; posted via @kriszyp.
Release target: v5.4 — new declarative cluster-placement surface for the next minor release
Complexity: complicated
Related PRs: #554 overlaps, #717 overlaps, #995 overlaps, #1054 overlaps, #1092 overlaps, #1131 overlaps, #815 overlaps, #1101 overlaps, #1112 overlaps, #1133 overlaps, #1140 overlaps, #1177 overlaps
Review deferral receipts
Deferred findings
1d1518092d8c3710major performance —replication/replicationConnection.ts— Residency heartbeat affects ordinary sending subscriptions — filed Reduce repeated declarative placement checks and sender bookkeeping #112172a06948797a6e07major reliability —replication/replicationConnection.ts— Incomplete owned-blob walks can repeatedly hold or reconnect — NOT FILEDc07750f66d5120fdmajor performance —replication/knownNodes.ts— Confirmation timeout cache retains per-waiter configuration reads — filed Measure configuration reads per confirmation waiter #11740a7544e3e122413cmajor performance —replication/residencyTopology.ts— Non-owner writes rebuild replication recipients — filed Measure recipient lookup and allocation on non-owner sharded writes #11582fda9a27a323578bmajor performance —replication/replicationConnection.ts— Mapped database frames incur a second decode pass — filed Measure the admission predecode pass on mapped database frames #11636eb764a1e8fde5c6major performance —replication/replicationConnection.ts— Unbound frames allocate database table scans — filed Measure per-frame table discovery on unbound legacy replication links #1159dc9d1534e325351cmajor performance —replication/replicationConnection.ts— Sharded point reads reconstruct bootstrap readiness — filed Measure bootstrap catalog reads on sharded GET_RECORD requests #1161c638e978c47969b3major performance —replication/residencyWire.ts— Per-record per-peer reference construction and header encoding — filed Reduce repeated declarative placement checks and sender bookkeeping #1121fa1239694ff06b06major reliability —replication/replicationConnection.ts— Database-wide permanent failure hold wedges unrelated tables — filed Define recovery options for a poisoned plain-table frame in sharded history #11609379f0883f02d130major reliability —replication/replicationConnection.ts— Missing sharding origin start stops ordinary-table delivery — filed Define independent plain-table recovery when a sharded origin start is missing #1171🤔 defer this PR's major performance finding
1d1518092d8c3710(Residency heartbeat affects ordinary sending subscriptions) to #1121 instead of fixing it here?🤔 defer this PR's major reliability finding
72a06948797a6e07(Incomplete owned-blob walks can repeatedly hold or reconnect) to a separate issue instead of fixing it here?🤔 defer this PR's major performance finding
c07750f66d5120fd(Confirmation timeout cache retains per-waiter configuration reads) to #1174 instead of fixing it here?🤔 defer this PR's major performance finding
0a7544e3e122413c(Non-owner writes rebuild replication recipients) to #1158 instead of fixing it here?🤔 defer this PR's major performance finding
2fda9a27a323578b(Mapped database frames incur a second decode pass) to #1163 instead of fixing it here?🤔 defer this PR's major performance finding
6eb764a1e8fde5c6(Unbound frames allocate database table scans) to #1159 instead of fixing it here?🤔 defer this PR's major performance finding
dc9d1534e325351c(Sharded point reads reconstruct bootstrap readiness) to #1161 instead of fixing it here?🤔 defer this PR's major performance finding
c638e978c47969b3(Per-record per-peer reference construction and header encoding) to #1121 instead of fixing it here?🤔 defer this PR's major reliability finding
fa1239694ff06b06(Database-wide permanent failure hold wedges unrelated tables) to #1160 instead of fixing it here?🤔 defer this PR's major reliability finding
9379f0883f02d130(Missing sharding origin start stops ordinary-table delivery) to #1171 instead of fixing it here?Review-Coverage: authored=claude; ran=cursor-composer,gemini,codex,cursor-grok; late=cursor-grok:adjudicated; adjudicated=domain; declined=muse; rounds=19; full=10 @ ccc86ed
Review-Attention: deep ~375m (critical: clusterStatus.ts, knownNodes.ts +12; sensitive: package-lock.json; decisions: do-less-alternative, attribute-slots-behind-test-switch, whole-stream-hold-on-placement-error, sharding-confirmation-timeout-30s, operator-assertion-as-trust, deferred-1d151809, deferred-72a06948, deferred-c07750f6, deferred-0a7544e3, deferred-2fda9a27, deferred-6eb764a1, deferred-dc9d1534, deferred-c638e978, deferred-fa123969, deferred-9379f088; raised: degraded review) @ ccc86ed