1.12. Storage Backends & Engine Design
1.12.1. Pluggable state backends (design, 2026-10-08)
Where meshnode keeps its state, what the state actually needs, and what it would take to offer PostgreSQL as an option beside the SQLite default.
Read-only census first; nothing here is built yet. Measured at meshnode 28c9170 / core 5f3454b.
Two decisions are settled (owner, 2026-10-08) and the design below assumes them rather than arguing them:
One node per database. A database is never shared between nodes. The goal is operational - run a node against SQLite or a managed SQL server - not distributional. This is load-bearing: the grant ledger assumes a single writer and
accountingis per-peer-per-window, not per-cluster. Section 5a says how the storage layer should enforce it rather than trust it.Two backends, and only two: SQLite is the default, PostgreSQL is optional. CockroachDB is out of scope - with one node per database it would buy managed resilience, not distribution, which is not the use case. The dialect seam below is what would make it a later addition rather than a rewrite, and section 5 records the one thing that would have to come with it.
etcd is out of scope. The census below is why: it is a good home for thirty of the tables and a bad one for three, and splitting the storage layer in two to accommodate a backend nobody needs would be the expensive half of this work. Every backend in scope speaks SQL. The keyed/queryable division is still real and still worth knowing - it decides which SQL features each tier needs - but it no longer decides the architecture.
1.12.1.1. 1. What persists today
/var/lib/<instance>/
keys.json node_sk, seeds written once, read at start
config.json the node's own config operator-writable, `live` keys re-read on tick
descriptor.json the mined descriptor rewritten when endpoints change
status.json last published status written every tick
accounts.sqlite 10 tables the grant/window ledger
events.sqlite 5 tables events, tags, tombstones, origin, bridge_cursor
blobs.sqlite 2 tables + blobs/ content-addressed files on disk
blob_replicas.sqlite 2 tables
cashu_wallet.sqlite 5 tables
(and per-compartment: mediation, nsite, settlement, gossip, updates)
SQL surface, counted:
152 execute sites, 63 CREATE TABLE statements, 21 modules
13 stores subclass one base class, fleetmesh_node/sqlitestore.py:54 BaseSqliteStore
BaseSqliteStore is already the seam: a subclass declares its DDL in
SCHEMA and its upgrade steps in MIGRATIONS keyed by PRAGMA user_version, and the base applies both in one transaction on open. It also
owns the RLock, the cursor finalisation, and the PRAGMAs. So the thirteen
stores do not each manage a connection - they share one implementation that
happens to be SQLite-only.
AccountStore accounts.py meters, receipts, chain, evaluated,
findings, seen_wraps, awaiting_acks,
reports_seen, strain, handovers
GrantStore grants.py grants, history, pending, seeds
NodeStore eventstore.py events, tags, tombstones, origin,
bridge_cursor (+ core's SqliteStore)
BlobMetadataStore blobstore.py blobs, meta
ReplicaStore blob_replication/ wants, replicas
IntakeStore blob_wire/intake.py replicas_in, intake_day
ProofStore fetch_pricing/ cashu_proofs, cashu_taken, account_proofs
PriceStore fetch_pricing/ blob_prices, fetch_allowance
SeenStore gossip_wire/mesh.py seen
RosterStore gossip_wire/mesh.py rosters
MediationStore mediation/store.py leaves, keylist, inbox
SettlementStore settlement/store.py escrows, spent_proofs
UpdateStore updates/store.py kv, seen, revoked
1.12.1.2. 2. The division, and what it still decides
Read the primary keys, not the table count. Of roughly 33 tables, 30 are addressed by their primary key or a prefix of it and nothing else:
meters PK (peer, epoch, side) get by key; scan by (peer, epoch)
receipts PK (peer, epoch, seq) scan by (peer, epoch)
evaluated PK (peer, epoch) get; scan a range of epoch
chain PK (peer, epoch)
grants/history (peer, direction) get latest; scan history
seen_wraps PK wid exists?; expire by age
strain PK (peer, shard, transport, kind)
blobs PK sha256 get; delete
cashu_* PK y exists?; insert-if-absent
inbox PK msg_id + scan by recipient_key
... and twenty more of the same shape
These need: get, put, delete, scan(prefix), range(ordered suffix),
compare-and-set, and expiry. That is a keyed store, and it is
implementable on any of the backends in scope without changing a caller,
and would have been implementable on a plain ordered key-value store too -
which is the shape of the argument section 2 settles.
Three tables are not that shape: events + tags + tombstones. They carry the only real query in the system:
SELECT json FROM events WHERE <filter> ORDER BY created_at DESC, id ASC
EXISTS (SELECT 1 FROM tags WHERE tags.id = events.id
AND tags.name = ? AND <in_clause>) -- store.py:574
'%s IN (SELECT value FROM json_each(?))' -- store.py:53
A NIP-01 filter is a secondary-index query with arbitrary tag predicates, an
ordered scan, and a limit. Plus negentropy reconciliation over (created_at, id), which is a range fingerprint.
So there are two tiers. With etcd out of scope they do not need two interfaces - both run on SQL - but the division still tells you where the work is:
the keyed thirty need only
get,put,delete,scan(prefix),range, upsert and delete-by-age. Portable across SQL dialects almost mechanically; the only per-dialect question is the upsert spelling.the queryable three need secondary-index lookups with arbitrary tag predicates, ordered scans with a limit, and a range fingerprint. This is where a second backend is genuinely re-implemented rather than re-spelled, and it is where PostgreSQL is better than SQLite rather than merely different:
jsonbwith a GIN index subsumes the wholetagstable and thejson_eachtrick at store.py:53.
For the record of why etcd was dropped: it serves the keyed thirty well -
leases fit seen_wraps and the _expire paths exactly, CAS fits the grant
boundary - and cannot serve the three at all, with a 1.5 MB value cap and no
secondary index, against an event store where nyc3 alone holds ~40k events in
600-850 MB.
1.12.1.3. 3. The good news: the hard tier is already abstracted
core/fleetmesh_core/wire/interfaces.py:215 MeshStoreProtocol is already a
backend-neutral contract for the event tier, stated in filters and ranges with
no SQL in the signatures:
get_event, has_event, insert_event, enumerate_range, items_range,
fingerprint_range, newest_matching
fleetmesh_node/interfaces.py:153 EventStoreProtocol adds the provenance half
(note_origin, origin_of, any_replicated, fingerprint_range). Both are
@runtime_checkable.
So a PostgreSQL event store is a new class that satisfies MeshStoreProtocol
and is chosen by config. Nothing above it has to change. The protocol was
written for this and has never had a second implementation to prove it - which
is the one thing worth saying about it: an interface with one implementation is
a hypothesis, not a contract.
Settled, 2026-10-08. The hypothesis held. core/fleetmesh_core/storage/store_postgres.py
satisfies MeshStoreProtocol with no change to the protocol and no change to
anything above it. Section 11 records what it cost and what it bought.
1.12.1.4. 4. What is actually SQLite-specific
Counted, so the work can be sized rather than guessed:
180 `?` placeholders 16 modules mechanical (paramstyle shim)
27 INSERT OR REPLACE 10 modules -> ON CONFLICT DO UPDATE
11 INSERT OR IGNORE 9 modules -> ON CONFLICT DO NOTHING
23 PRAGMA 2 modules already localised in the base
8 rowid / last_insert_rowid 4 modules needs RETURNING or a real key
6 sqlite3.Row / sqlite3.Error 3 modules leaks the driver into callers
2 WITHOUT ROWID 2 modules drop; it is an optimisation
2 json_each / json_extract 1 module the only genuinely hard spot
No ATTACH, no AUTOINCREMENT, no BEGIN IMMEDIATE, no sqlite date
functions anywhere in non-test code - checked, because an earlier draft of
this census reported an ATTACH that turned out to be the word “attach” in a
comment in accounting.py.
The shape of this is encouraging: the driver leaks into 3 modules, the PRAGMAs
into 2, and the one query that needs real thought lives in one function
(store.py:in_clause, :53). Everything else is dialect, not architecture.
1.12.1.5. 5. Per-backend fit
SQLite default, both tiers. The only one that needs no operator and
the only one where the database is a file the node owns
outright. Stays the default and stays supported.
PostgreSQL optional, both tiers. `jsonb` with a GIN index subsumes the
`tags` table and the `json_each` clause outright, so the event
tier gets better rather than merely ported. It is also the one
that proves the protocols: an interface with one
implementation is a hypothesis.
Optional means optional, in the convention this repo already uses for
wasmtime: a pinned requirements-postgres.txt, a driver imported lazily, a
node without it refusing a postgres:// URL by name rather than failing at
import, and FLEETMESH_REQUIRE_POSTGRES=1 in CI so a missing driver cannot
turn the suite green by skipping it.
Not in scope, and what it would cost later: CockroachDB is postgres-wire, so the dialect would mostly be the Postgres one, but it is SERIALIZABLE - a transaction can be told to retry with 40001, and no retry loop exists at any of the 152 execute sites. That is a control-flow change, not a dialect one, and it is the single thing that would have to come with it.
One thing the matrix hides:
A remote backend moves writes off the local disk and onto the network.
budget/receipts.py:81 puts the meter before the receipt message leaves -
a synchronous write on the message path. Against SQLite that is an fsync;
against Postgres it is a round trip. Every per-message write site needs a
declared durability class before it can run remote.
And one thing that makes this much easier than it looks: the node already
serialises every database access through one connection behind a reentrant
lock (sqlitestore.py:83 threading.RLock, check_same_thread=False, and a
with self._lock around each of the access methods). Keeping that model for
Postgres means one connection, no concurrency at the database, and therefore
no deadlocks and no serialization failures to retry. It also means step 4 of
the plan is provably behaviour-preserving, because the concurrency semantics
do not change at all. The cost is no parallelism inside a node, which is what
it has today. A connection pool would be a later decision with its own
tripwires, and it is the point at which retryable transactions start to
matter even on Postgres.
1.12.1.6. 5a. One node per database has to be enforced, not assumed
The decision makes a silent corruption possible that SQLite made impossible.
A file in /var/lib/<instance> cannot accidentally be shared; a connection
string can be pasted twice. Two nodes against one database would both write
meters, grants and evaluated for their own peers, under primary keys that
do not include the node - meters is (peer, epoch, side), grants is
(peer, direction) - so the rows would interleave, each node would read the
other’s accounting as its own, and the ladder would price windows that never
happened. Nothing in the schema would complain.
So the storage layer should claim ownership on open and refuse to start otherwise:
an `owner` row carrying the node's pubkey and a lease it renews on the
tick; `open()` takes it if free or held by this node, and refuses with a
named error if another pubkey holds a live lease. A stale lease - a node
that died - is takeable after it expires, which is also what makes a
restart work.
This is cheap, it belongs in the base rather than in thirteen stores, and it is exactly the class of runtime check the rest of this document argues for: the failure it prevents is one that otherwise reports healthy while producing nonsense.
1.12.1.7. 6. The interaction with I15 that must not be designed away
I15 (audit-2026-10-07-4-issues.md) is a durability bug: a counter is taken in memory when a session opens and persisted only at a tick, at session end, or on a receipt, so a session in flight at a restart is lost, the node’s own guard then reads a short meter, and the peer prices the difference as a lie. The fix wants the increment to become durable sooner.
A remote backend wants synchronous writes to be fewer.
These pull opposite ways, and resolving it by hand per call site is how this class of bug gets reintroduced. The resolution belongs in the interface: each keyed namespace declares what it needs, and the backend honours it or refuses to be configured for that namespace.
durability=commit the write is durable before the call returns
(meters at session open, grants, keys, spent_proofs)
durability=window may be batched, must be durable before the window
closes or a receipt citing it leaves
(bytes_in/out, sync_ranges counters)
durability=cache may be lost; rebuildable from elsewhere
(seen, rosters, nsite manifests, bridge_cursor?)
With that declared, a local SQLite backend can honour commit with an fsync,
a remote backend can honour it with a synchronous round trip and batch the
window class, and - the point - I15’s defect becomes expressible as a wrong
annotation rather than an invisible race. bridge_cursor is marked with a
question mark deliberately: I6 found its write silently swallowed, and whether
it is cache or window is a correctness question nobody has answered.
1.12.1.8. 7. Proposed shape
With etcd gone, this is one seam widened, not a new abstraction invented.
BaseSqliteStore already owns the connection, the lock, the cursor
finalisation, the PRAGMAs and the declarative SCHEMA/MIGRATIONS. Split it
along the line that already exists inside it:
None of these files exist yet; the paths are proposed, not current:
storage/base.py (new) BaseStore - everything that is not dialect:
the lock, transactions (with a retry policy),
schema application by version, the ownership
lease (5a), durability classes (6)
storage/dialect.py (new) the small surface that differs: placeholder
style, upsert spelling, the type map, the
error taxonomy, the connect/PRAGMA step
storage/sqlite.py (new) today's behaviour, unchanged
storage/postgres.py (new) later; one class, and the event-tier query
rewritten to jsonb + GIN rather than ported
The thirteen stores keep their names, their callers and their declarations.
They stop importing sqlite3 and stop writing ? and INSERT OR REPLACE
directly; the dialect renders both. MeshStoreProtocol stays as it is and
gains its second implementation, which is what turns it from a hypothesis into
a contract.
Config, through the existing live key machinery - one database per node, so
one URL:
"storage": { "url": "sqlite:///var/lib/mesh-fra" }
"storage": { "url": "postgres://meshnode@db.internal/mesh_fra" }
A per-namespace override is deliberately not proposed. One node, one database: splitting the ledger from the event store across two servers doubles the failure modes and buys nothing the decision in the header asked for.
1.12.1.9. 8. How it gets verified, which is the part that usually gets skipped
The project’s own answer to “does a second implementation agree” is a
conformance vector set - core/vectors/ holds 25 of them, and meshctl conform speaks them on stdin/stdout. Storage should use the same machinery
rather than invent a test strategy:
a. a new storage-ops vector file beside the 25 in core/vectors/ -
a sequence of store operations with
expected results, including the awkward ones: CAS under contention,
expiry at a boundary, a scan that must not see a half-written batch,
ordering of equal sort keys. Every backend runs it; a backend that fails
one is not a backend.
b. a storage-events vector file - filters, ranges and fingerprints
against a fixed event set, so fingerprint_range provably agrees across
backends. Negentropy reconciliation between two different backends is
the real test, and it is also the first thing a second implementation
would break.
c. A durability suite that kills the process. This is the tripwire I15 did
not have: open a session, SIGKILL, restart, assert the counter matches
what the peer measured. It needs a real process boundary, which no suite
in the tree currently crosses - test_multinode_integration.py has no
Popen/subprocess/fork and test_restart.py restarts a node with
nothing in flight.
d. A runtime check, in the node rather than in CI: storage reports its
backend, its per-namespace durability class, and whether the last
commit-class write was acknowledged. meshctl watch classifies by key,
so this becomes a trouble line when a backend silently degrades - the
class of failure that let the mesh sit pinned at its ceiling for 55 hours
while watch said ok.
1.12.1.10. 9. Order of work
1. Durability classes named and annotated per store, on today's SQLite.
No new backend. This is also the I15 fix, and it is what makes the rest
safe to attempt.
2. The storage conformance vectors (8a, 8b) run against SQLite. Red on
anything today's base class gets wrong.
3. The process-boundary durability suite (8c). It will find more than I15.
4. Split `BaseSqliteStore` into `BaseStore` + a SQLite dialect. The 13
stores move with no behaviour change, proven by the vectors from 2.
5. The ownership lease (5a), with its refusal tested. Needed before a
networked backend, and harmless on SQLite.
6. PostgreSQL: one dialect class, the event query rewritten to jsonb +
GIN, and the optional-dependency plumbing. Both tiers against the
vectors, and negentropy reconciled between a SQLite node and a
Postgres one.
Steps 1-3 are worth doing even if no second backend is ever built: they are the tests and runtime checks this state-keeping does not currently have, and step 1 fixes a live defect. Nothing before step 4 changes a caller, and nothing before step 6 needs a server.
1.12.1.11. 10. Settled, and what is still open
Settled 2026-10-08 (see the header): one node per database; SQLite the default and PostgreSQL the only option; CockroachDB and etcd out of scope; no per-namespace split.
Still open, and none of it blocks steps 1-4:
The local disk does not go away.
keys.json,descriptor.json,config.jsonandblobs/are files, and the descriptor is mined locally. A Postgres-backed node still has a state directory. Worth deciding whetherblobs/content should ever move into the database - the metadata is already a table and the bytes are already on disk, which is probably the right split, but it is a decision rather than an accident.Which stores are
cache. Section 6 proposes three durability classes. Annotating thirteen stores means thirteen judgements, two of which are already known to be contentious:bridge_cursor, whose write I6 found silently swallowed, andseen/rosters, which are rebuildable but whose loss re-floods a topic.~~Whether
eventsand the ledger share one schema.~~ Settled 2026-10-08.PostgresStore(url, schema=...)takes a schema name and defaults topublic, so one URL does not have to mean one namespace. The event tier can sit beside the state tier’s forty-four tables in one database without either knowing about the other, and a later split costs a config line rather than a migration.
1.12.1.12. 11. The event tier on PostgreSQL, as built
Written 2026-10-08. core/fleetmesh_core/storage/store_postgres.py, 250 lines.
1.12.1.12.1. It is not a port of SqliteStore
SqliteStore keeps a second table. SQLite has no indexable way into a JSON
array, so every single-letter tag becomes a row in tags, read back through
EXISTS (SELECT 1 FROM tags WHERE tags.id = events.id AND ...). That costs an
extra write on every insert, an _index_tags call beside every _put, a
_backfill_tags sweep on every open, and a subquery per tag name at read time.
PostgreSQL indexes the array directly:
json -> 'tags' @> '[["t","bristol"]]'
One predicate, GIN-indexable with jsonb_path_ops. NIP-01’s semantics fall
out of the shape rather than being assembled: values within a name OR, because
each value is its own containment test; names AND, because the tests are
joined with AND. So there is no tag table, no secondary write, no backfill.
That is the whole reason to write a second backend rather than translate the
first one.
1.12.1.12.2. Three things that had to be checked, not assumed
The fingerprint is safe over jsonb. This was the one real worry, because
jsonb does not preserve key order, whitespace or duplicate keys, and a
fingerprint over stored bytes would diverge from SQLite’s immediately.
It does not: fingerprint_range calls
replication.fingerprint(self.enumerate_range(...)), and enumerate_range
returns event ids. An id is a hex string and created_at an integer, so
both round-trip exactly, and the fingerprint never reads the stored document at
all. Key order does not matter to a reader either, because crypto.canonical
sorts keys itself - a dict read back out of jsonb canonicalises to the bytes
it was written from. So no separate canonical-TEXT column is needed, and the
jsonb column is both the document and the index.
Containment is looser than tag matching, and that is allowed. jsonb
array containment is unordered and subset-based, so the predicate for
#t=bristol also admits a tag written ["bristol","t"] - name and value
swapped. That is not a defect, because MeshStore._narrow says narrowing
“may return a superset and must never return less” and matches decides
membership afterwards. It also admits ["t","bristol","extra"], which NIP-01
wants. Both directions are asserted, with the swapped tag named as the case
that separates them: _narrow returns it, enumerate_range does not.
_by_author_kind is the opposite: exact, not a superset. Its two callers
read a value off every answer rather than re-filtering. _deleted_by_coordinate
asks for this author’s kind 5s and reads an a tag off each, so an answer of
some other kind that happened to name the coordinate would read as a deletion.
Mutation testing found this: dropping AND kind = %s was invisible to both
suites until a case was written for it.
1.12.1.12.3. Verification
core/tests/test_store.py gained PostgreSQL as a third backend, which was a
two-line change because the suite already took factories. It runs every
membership assertion against it and, more usefully, the existing
“every backend agrees, whatever order it was fed” check - 100 seeded shuffles
of a 15-event history, three backends, one fingerprint. 195 assertions pass.
fleetmesh.org/scripts/check-vectors.py runs the published store vectors
against it too: 8 ranges over 15 events, 3 backends agree.
core/tests/test_store_postgres.py holds the 35 assertions that are specific
to this backend, because the conformance suite by design cannot make them:
the superset/exact pair above, with the adversarial tags named;
that the GIN index is actually reached, read off
_where’s own output rather than a hand-written query, with no planner coercion - on a 4,000-row fixture a selective tag goes toevents_tagsand a narrow time range goes toevents_created_at, which is the planner choosing correctly between them. An index that is never used is a control reporting healthy while doing nothing, and replacing a whole table with one index is only worth anything if the index is used;the same for
events_author_kind, which supersession runs on every replaceable insert - the O(store)-per-insert path section 3 records as a real incident;a randomised differential against
SqliteStore: 300 filters over a 120-event corpus built to be adversarial (values that are also names, repeated names, three-element tags, one-element tags, three authors to a timestamp), identical enumerations and identical fingerprints, plus 120 filters at three caps throughnewest_matching, which this backend overrides to order on the index instead of sorting in Python;that
MeshStoreProtocolhas a second implementation, which is what turns it from a hypothesis into a contract.
1.12.1.12.4. The suites were mutation-tested, and two of them were wrong
Eleven deliberate defects were introduced one at a time and each suite asked whether it noticed. The first pass caught six of eleven. The misses were the useful part:
a hand-written
EXPLAINpasses while the store stops using the index. Narrowing is allowed to be over-broad, so nothing else in either suite noticed when the containment predicate was simply not emitted. The plan is now read off_where’s output, and the clause is asserted to carry the predicate at all.TRUNCATEis not a clean fixture. It leaves the tables and indexes a previous version of the code created, so removing the GIN index fromSCHEMAwent undetected - the index was still in the database from an earlier run. The helper now drops the schema.every corpus timestamp was distinct, so
ORDER BY created_at DESC, id ASCagreed with the sorting backend by luck and dropping theidtiebreak changed nothing. Three events now share each timestamp.
After those three fixes all eleven are caught, by one suite or the other, with
a clean division: the conformance suite catches membership defects on any
backend (a broken _tombstoned_by fails 6 of its assertions), and this suite
catches the PostgreSQL-specific ones.
Two mutations are deliberately not caught, and that is the right answer:
dropping return None on an empty value list, and weakening _put’s upsert
to DO NOTHING. Both are reachable only as performance or as defence - no path
in the base re-puts a stored id, because insert_event answers duplicate
first and supersession drops before it puts - and both are commented in the
code as such rather than left looking load-bearing.
1.12.1.12.5. Two notes on the cost
tests/test_store.py runs in 0.1s without a server and 2.0s with one, so the
whole conformance suite is still cheap enough to run on every change.
test_unplug.py strips FLEETMESH_POSTGRES_URL from the environment it hands
its children. A database server is reached over TCP, so a child told to use
this backend would reach the network - correctly, and that file exists to
prove nothing does. The claim it makes is about the protocol, which needs no
host, not about infrastructure an operator provides.
1.12.1.12.6. CI
Both repositories gained a postgres-live job with a postgres:16 service,
in the shape mint-live already used: the pinned driver from a
requirements-postgres.txt, FLEETMESH_REQUIRE_POSTGRES=1 so a skip becomes
a failure, and a wait loop because services start in parallel with the job.
core runs the conformance and PostgreSQL suites; meshnode runs the dialect
suite, whose live half had never run in CI at all - it was written with the
skip convention and nothing ever set the variable.
1.12.1.13. 12. The locator, and what a live switchover still needs
Written 2026-10-08. fleetmesh_node/storage/locator.py, 120 lines, 40 assertions in
fleetmesh_node/tests/test_storage_locator.py.
Section 4 counted what was SQLite-specific and the dialect layer answered it.
What was left is smaller and more boring: the tree’s remaining tie to SQLite is
not SQL at all, it is os.path.join(directory, name + '.sqlite') written out
at every store site. A dialect cannot help with that, because the decision is
made before any SQL exists.
Locator is the one object that answers where a store lives:
loc = Locator.from_config(directory) # the default
loc = Locator.from_config(directory, url='postgresql://...')
store = loc.open(grants.GrantStore, 'grants')
On SQLite target('grants') is the path the site computed before - asserted
name by name for all ten store names in use, so adopting the locator is a
refactor and not a migration. On PostgreSQL every store gets the same URL,
which is what “one node per database” means in practice; the forty-four table
names do not collide, and the schema version is already keyed per store
rather than per database - the defect that taught us so is at
fleetmesh_node/storage/postgres.py:218.
Three decisions worth stating:
An unrecognised URL scheme is refused by name.
mysql://,cockroachdb://,etcd://, and a bare path are all errors. The alternative - treating an unknown string as a filename - produces a node running happily on SQLite while an operator believes it is on a server, which is the exact shape of defect this work exists to stop.describe()reports which backend is live, for the health block, with the connection string reduced to host and database. A connection string carries a password, and a password must not reach a health block, a log or a receipt. Six assertions cover the redaction, including an@inside the password andsslpasswordin the query string.PostgresDialectis now registered inDIALECTSwhether or not psycopg is installed. Constructing one imports nothing, and itserrors()answers with an empty tuple rather than raising, sostore_errors()- which everyexceptin the tree catches - stays correct on a SQLite-only host. That path is tested by replacing the driver lookup with one that refuses.
1.12.1.13.1. What is still needed, counted
The locator is the mechanism and nothing in the boot path uses it yet, which is deliberate: switching the node over touches the path a live node starts on, and a mistake there is an outage rather than a failing test. The sites, so the work can be sized rather than guessed:
where |
sites |
shape |
|---|---|---|
|
4 |
the node’s own stores: events, grants, accounts, blobs |
|
1 |
|
compartment |
8 |
gossip (2), fetch_pricing (2), updates, mediation, blob_wire, blob_replication |
self-computed paths |
3 |
|
CLI read paths |
3 |
|
config |
1 |
a |
The CLI row is the one with a real decision in it rather than plumbing.
meshnode health and the peering commands currently open the state files
directly and read them read-only, which has no meaning against a server the
node holds a lease on. Either they go through the locator and take the
read-only connection, or they refuse by name on a server backend. The lease
(section 5a) is what makes that answerable, and it already exists.
Until that row is done, a PostgreSQL node is exercised by its suites and its CI job but is not something to put on a mesh host.