feat(replication): LOCAL_ONLY record-metadata flag for non-replicating writes - #1239
Merged
Merged
Conversation
…ating writes Adds a generic record-metadata bit (LOCAL_ONLY = 0x8000, bit 15, confirmed unused in the metadata bitmap and audit extendedType space) that marks a write as local-only: persisted on this node but never forwarded to replication peers. The flag rides the record metadata header AND the audit entry's extendedType so the replication send path can skip it via a pure bitmask test on the already- available metadataFlags/extendedType integer — no record value decode is added to the throughput-critical send path. Threaded from a per-write `localOnly` option through recordUpdater into the encoder. Supports the v4->v5 bridge fix in harper-pro #246. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
This was referenced Jun 10, 2026
Closed
Contributor
|
Reviewed; no blockers found. |
Member
Author
|
(there was a harper-pro approval) |
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.
Summary
Adds a generic record-metadata bit —
LOCAL_ONLY = 0x8000(resources/auditStore.ts) — that marks a write as node-local: persisted here, never forwarded to replication peers. Internal primitive (no publicput/patchsurface yet — see Notes); used by harper-pro to fix the v4→v5 bridge leak (harper-pro#246).How it works
RecordEncoder.recordUpdater: on the internallocalOnlywrite option, sets the bit on both the persisted record metadata header (metadataInNextEncoding) and the audit entry'sextendedType.Table.ts: threadslocalOnlyfrom the write options intorecordUpdater.LOCAL_ONLYrecords via a pure bitmask test on the already-availablemetadataFlags/extendedTypeinteger — no record value decode is added to the throughput-critical send path (the harper-pro side does the skipping; this PR just defines + sets the bit).What to check
0x8000(bit 15): confirmed unused in the record-metadata bitmap and the auditextendedTypespace (tops out at0x4000; framing is0xc0000000), sits below the action byte, and round-trips through the always-32-bit metadata encode/decode. Verified by review againstauditStore.ts+RecordEncoder.ts.Notes
LOCAL_ONLYis intentionally internal-only for now. A public API (per-write option and/or table-level config) is deferred to a planned residency-scoped metadata visibility feature, where this becomes the residency = {self} case. Tracked in the harper-pro follow-up issue.🤖 Generated with Claude Opus 4.7 (implementation by Claude Sonnet 4.6).