Repository navigation
Store: several serving processes on one host — declaration fence, setup refusal, single audit drainer (#927) - #936
Merged
Conversation
…n fence, setup refusal, single audit drainer (#927) Schema version 5 adds store_declarations, store_servers and the audit drain lease. Each activation records its collections' declaration fingerprints; every write transaction checks them and user_version under the write lock and answers 503 storage_unavailable on a mismatch, writing nothing. Activation refuses a database on a network filesystem (Linux statfs; also for the audit database) and a live peer on another host (boot id / hostname lease), and warns once that throttles and caches are per process. Only the drain lease holder peeks and acks. Co-Authored-By: Claude Opus 5.5 <[email protected]>
jimhoyd
enabled auto-merge (squash)
September 29, 2026 17:10
… busy-timeout 503 in the cross-connection transfer race Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nt defaults to 0) Co-Authored-By: Claude Opus 5.5 <[email protected]>
jimhoyd
added a commit
that referenced
this pull request
Sep 29, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Sep 29, 2026
Merged
jimhoyd
added a commit
that referenced
this pull request
Sep 30, 2026
…ock (#1050) * One serving process per database: replace the host lease with an OS lock Owner decision: several serving processes on one database are no longer supported (they need a real database server, which URLCode does not provide), to cut owned code. The multi-process support built in #927/#936/#941/#978/#1010 goes away and is replaced by an OS-enforced server lock. - core: server-lock.ts replaces host-lease.ts. holdServerLock takes an exclusive SQLite file lock on <database>.server-lock (held by a transaction that never ends), refcounted per process so a dev reload shares it; the OS drops it when the process dies. serverLockHeld lets operator commands see a live server. refuseNetworkFilesystem stays; HostProbe keeps platform/statfs. - store: the lock is taken before the database opens; the host lease, the per-write lease check (writeGuard), the audit drain lease and the peer warning are gone. Schema 6 drops store_servers and the drain lease columns. The declaration fence stays for a reload's retiring activation and for operator commands, which now ask serverLockHeld. - auth: each activation holds the lock; the per-request renew and the temporary write triggers are gone; auth_servers is dropped. - audit: the first activation holds the lock; the per-ingest check and AuditStore.lease are gone; audit_servers is dropped on open. - tests: the multi-process harness, its CI job and the clock-skew, heartbeat, suspended-VM and trigger tests are removed. New focused tests prove a second server process is refused and a restart after SIGKILL is accepted (core, store with integrity_check after SIGKILL mid-burst, auth, audit). The disk-full harness keeps its CI job (renamed disk-full). - docs: topology sections rewritten around one serving process per database. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test: bound the server lock tests on every platform (Windows hang in #1050) test/server-lock.test.ts hung for ~10 minutes on windows-latest. Every wait on a child process is now bounded with the child's stderr in the failure, stdout is read to its end, a refused child exits only after its line is written, per-test timeouts are set, and cleanups run newest first so a child is killed before its directory is removed (Windows cannot delete a file another process holds open). After a SIGKILL the core, store, auth and audit lock tests poll (at most 10 s) for the lock to be released: Windows releases a terminated process's locks after an OS-determined delay rather than at exit. STORE.md and holdServerLock's comment document that a restart straight after a crash on Windows can be refused once. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
The store items of #927. The auth items are in #934. The Linux multi-process CI harness and the remaining docs are still open on #927.
Design
store_declarations: collection, fingerprint, schema version;store_servers: instance, host, boot id, pid, heartbeat, expiry;store_audit_drainwithholderandlease_until.BEGIN IMMEDIATE, that its fingerprint and the file'suser_versionare current. One indexed read covers HTTP writes, increments, transitions, transfers, clicks, the records export and hosttransaction().statfsrefuses NFS, SMB, SMB2, CIFS, FUSE, 9P, Ceph and AFS for both the store and audit databases. It is skipped on macOS and Windows, which is documented.Evidence (macOS, Node 26), rebased onto main after the auth change
multiprocess.test.ts(9 tests), with realnodechild processes, not threads:user_versionbump fences both;statfsrefusal and the CLI fence;drained_at;npm run verifypasses: store 182, audit 44, root 1226, plus the add-ons, proofs and ecosystem suites.npm run test:packagepasses.Limits
kill -9and integrity checks, cross-process race suites, audit exactly-once across processes, and a sign-in burst.🤖 Generated with Claude Code