Skip to content

Lock file storage by default; route CLI commands before opening storage - #2132

Merged
bplatz merged 15 commits into
nextfrom
feat/storage-lock-by-default
Oct 20, 2026
Merged

bplatz merged 15 commits into
nextfrom
feat/storage-lock-by-default

Conversation

@bplatz

@bplatz bplatz commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

#2131 added a lock on file storage directories, but only the server and the Python package take it. This PR turns the lock on everywhere, for the next major. Every process that opens a file storage directory now locks it, and a second one is refused. The CLI changes most, since it opens storage on its own in many places. That turned up a routing bug, which this PR fixes on the way.

What changes

The lock is on by default (fluree-db-api, fluree-db-server)

  • Opting out: every file-backed build locks its root unless it calls without_storage_lock(), meant for a program that reads a directory another process owns.
  • Exempt automatically: a root journaled under per-process WALs (Raft nodes) or opened through a read-only nameservice takes no lock.
  • Embedded Raft nodes: the EmbeddedRaftNode::attach contract now asks for with_storage_wal_owner(<node id>), as the server already passes node-{id}. Built the way the contract used to describe, a node locked the shared payload store and a second node on it was refused. The owned log also flushes each payload before its reference is proposed, which the root's shared log does not.
  • Server: it locks when ServerConfig::owns_storage_root() says it owns its root, meaning it isn't a shared-storage peer or a Raft node. The storage_lock config field from Share one engine per storage directory in a process; lock it against other processes #2131 goes away; it was never released.

The CLI decides routing before it opens storage

  • The bug: commands that route through a running local server used to open the project's storage first, to check whether the ledger existed, and only then switch to the server. Every routed fluree query or insert ran WAL recovery and the startup sweep on the server's live storage. With the lock on, those commands would have been refused.
  • One way to find the server: a new local_server module reads server.meta.json, and target resolution checks it before anything opens storage. It also checks that the server serves this project's storage, so a server started on another --storage-path no longer captures the project's commands. The recorded path is absolute, so this works from subdirectories.
  • The lock says whether the server runs: a server that locks its storage counts as running exactly while it holds that lock, the same answer server start takes from it. A pid reused after a crash no longer captures commands; before, on Windows, every pid counted as a live Fluree server. A server that locks nothing (a connection config, a peer) keeps the pid check.
  • Precedence is unchanged: a ledger or graph source the server holds wins, then a tracked remote of that name, then the server itself.
  • --direct is one process-wide setting, like the remote timeout. That removes about twenty copies of the routing check and about forty places where the flag was passed down.
  • More commands route: create (plain, .flpack, and server-side import of --from <file>), use, and query --connection with no active ledger.

CLI commands take the lock

  • Waiting: commands run side by side, each holding the storage briefly. So a command that finds the storage held by another command waits for it, up to 30 s (FLUREE_STORAGE_LOCK_WAIT_SECS).
  • Refusal: a command that meets a running server's lock is refused at once, with what to do: drop --direct, or stop the server. This holds where the lock file cannot name its holder, too.
  • fluree memory never opens the project's storage now. In a project it keeps its ledger in memory, rebuilt from .fluree-memory/*.ttl, as mcp serve already does. Global mode keeps its on-disk ledger.
  • memory import writes the .ttl files. It used to write only the ledger cache, so imports were lost on the next rebuild from files.
  • doc ingest --entities/--model <ledger> reads ledger sources through the instance it already has open, instead of opening a second one.

Breaking changes, also in docs/operations/upgrading-from-4.2.md

  • Rust: a program that opened two instances on one directory, in one process or two, gets ApiError::StorageInUse on the second.
  • Peers next to a transaction server: an embedder running a shared-storage peer beside a transaction server opts out with without_storage_lock(). The bundled server does this for you.
  • Embedded Raft nodes: an embedder builds each node's engine with with_storage_wal_owner(<node id>), or the second node on a shared store is refused.
  • Filesystems that can't lock: a directory on such a mount no longer opens unless FLUREE_STORAGE_ALLOW_UNLOCKED=true.
  • create --from with a server running: with a local server up, fluree create --from <file> now uploads the file for a server-side import instead of importing locally, and a directory is refused.
  • Memory cache: the __memory ledger that earlier releases kept in .fluree/storage is no longer read. Memories a 4.2 memory import added are only there, so they are exported before the upgrade and imported after.

Not covered

These commands still open storage directly, so while a server runs they are refused with a message that says why: index, verify, config set-origins, graphql, track add, materialize, doc, and clone/pull/push/fetch/publish. Routing them is follow-up work; the docs list them.

Follow-up: #2151

#2131 and this PR together complete #2040. This PR's base is next, so no closing keyword fires here; the Fixes line for #2040 belongs in the next→main PR.

Tests

Each new regression test fails with its fix reverted.

  • fluree-db-api storage_lock_tests:
  • fluree-db-consensus/tests/it_embedded_node.rs: two nodes built per the embedding contract open one payload store.
  • fluree-db-cli/tests/server_routing.rs, against a real fluree server run:
    • create, use and insert go through the server; this test also reproduces the original bug of routed commands opening storage first;
    • a server on other storage isn't routed to;
    • a command that meets the server's lock is told why at once;
    • a connection query with no active ledger is routed;
    • a relative server storage path is routed to from a subdirectory;
    • a graph source on the server wins over a tracked remote of its name.
  • fluree-db-cli local_server::tests:
    • a server is found while it holds the storage;
    • a server whose storage is free is gone, though its pid lives and reads as a Fluree server's;
    • a server whose storage another process holds is gone;
    • a server that doesn't lock its storage is found by its pid;
    • looking for a server doesn't create the storage.
  • fluree-db-cli commands::server::tests: a server records the root it locks as an absolute path, and start recognizes that root under another spelling.
  • fluree-db-cli context::tests:
    • a command waits for storage another process lets go of; the holder is a child process;
    • with no wait, a held storage is refused at once.
  • fluree-db-memory: an import lands in the files a fresh store rebuilds from, and isn't imported twice.
  • Existing tests that open a second instance on one directory, standing in for a second process or a fresh view of what's on disk, now open it with without_storage_lock(). The server's in-process restart tests wait for the first instance's background tasks to let go of the root.

Brings the storage lock, the shared instance and their Python and server
uses onto next, ahead of #2131 reaching next through main. Resolved:
next's file builds run the nameservice migration before build_file; the
lock taken in open_file_storage still comes first. Both branches counted
a new ApiError variant, so every_variant now expects 49.
A routed command opened the project's storage before routing: target
resolution built a local instance to check that the ledger existed there,
and only then did the per-command `try_server_route` swap it for the
running server. Every `fluree query` or `insert` with a server up ran WAL
recovery and the startup sweep on the server's live storage just to look
up one ledger. Routing was also stitched together per command: about
twenty sites repeated `if direct { mode } else { try_server_route(..) }`,
`--direct` was threaded through some forty dispatch calls, and three
copies of the `server.meta.json` reader and pid checks had drifted apart.
None checked that the server serves this project's storage, so a server
started on another `--storage-path` captured the project's commands.

`local_server` now holds the one reader: a live Fluree server whose
recorded storage matches the CLI's own. Target resolution consults it
first, before any storage opens. A server's ledger routes to the server,
a name it lacks still resolves to a tracked remote, and otherwise the
server answers. `--direct` is a process-wide setting, like the remote
timeout, so the per-command plumbing goes.

`create` and `use` used to open the storage directly even with a server
running. Both now go through it: `create` reuses its `--remote` paths
(plain, `.flpack`, server-side source import) against the local server
and makes the new ledger the active one, as a local create does, and
`use` asks the server whether the ledger exists.
`fluree doc ingest --entities <ledger>` (and `--model <ledger>`) opened a
second instance on the project's storage to read the source ledger, while
the instance holding the target ledger was still open. Two instances on
one storage are not coordinated, and once the storage is locked against a
second open, the second is refused outright.

`Opened::open` now takes the command's open instance and reads a ledger
source through it, building one only when the command has none.
Short-lived `fluree memory` commands kept their ledger cache in the
project's `.fluree/storage`. They opened that storage beside a running
server, and AI agents that start several memory commands at once had them
all open it together. The reasons given for a file-backed cache, `import`
and the `init` legacy migration, no longer hold: `init` is deprecated and
its migration is gone, and `import` writes the `.ttl` files like any add.

In a project, the commands now use the same process-private, in-memory
ledger as `mcp serve`, rebuilt from `.fluree-memory/*.ttl`. They never
open the project's storage. Global mode has no `.ttl` files and the ledger
is the store, so it stays on disk.
A file storage directory is used by one process at a time, but only the
server and the Python package took its lock, and only when asked: a Rust
program, a CLI command or a second Rust instance could still open a
directory another process held, with uncoordinated caches, indexing and
sweeps.

Every file-backed build now locks its root. `without_storage_lock()` opts
out, for a reader of a root another process owns. A root journaled under
per-process WALs (Raft) or opened through a read-only nameservice takes
none. `with_storage_lock()` stays as the default it now is.

The server locks whenever `ServerConfig::owns_storage_root()` says it owns
its root: not a shared-storage peer, not a Raft node. The `storage_lock`
config field the CLI used to set is gone.

CLI commands take the lock like any other open. Commands run side by side,
each holding the storage briefly, so one that finds it held waits for it:
up to 30 s, FLUREE_STORAGE_LOCK_WAIT_SECS. A command that meets a running
server is refused at once, with what to do: drop `--direct`, or stop the
server for a command that does not go through one yet.

Tests that opened a second instance on one directory, as a stand-in for a
second process or a fresh view of what is on disk, now open it unlocked.
The server's restart tests wait for the first instance's background tasks
to let go of the root, as a restart in one process must.
`MemoryStore::import` wrote only to the ledger, while the `.ttl` files are
the store and the ledger a cache rebuilt from them. An import reported
success and was then lost: at once now that CLI memory commands keep the
ledger in memory, and at the next rebuild from files before that.

Each imported memory is now spliced into its scope's file, under the same
locks and in the same order as `add`, then committed to the cache, and the
file watermark updated. A memory whose id the store already holds is
skipped rather than written twice, and the count says how many were added.
Three gaps in sending commands through the local server:

- A name the server held as a graph source, not a ledger, resolved to a
  tracked remote of that name once a server was running, where it had
  resolved to the graph source before. The server is now asked for a graph
  source before a tracked remote is considered.
- `query --connection` with no active ledger fell back to opening the
  storage directly, so it met a running server's lock. The fallback now
  follows the server too.
- `server.meta.json` recorded the storage path as given, so a server started
  with a relative `--storage-path` was not recognized from a subdirectory.
  The path is recorded absolute.

The routed-command list in the CLI docs named `index`, which opens storage
directly; the routed command is `reindex`.
Brings the fix that holds the root lock through a cancelled build's WAL
replay. On next a build also migrates the nameservice after replay, and
that writes the store too, so the task that holds the lock runs both.
@bplatz bplatz added blocked breaking-change Backwards-incompatible change; drives the Breaking Changes release-notes section labels Oct 17, 2026

@aaj3f aaj3f left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bplatz yes to the lock by default, and I think routing before anything opens storage is a real find: with a server up, every routed query/insert was running WAL recovery and the startup sweep on the server's live storage just to look up a ledger. Two headline notes.

(1) The Raft exemption is keyed on a WAL owner. That's how fluree-db-server wires its nodes, but the repo's documented embedding contract (fluree-db-consensus/src/raft/embedded.rs:146-153, and the docs on build_client_with_nameservice itself) builds a Raft node through build_client_with_nameservice(ReadWrite(..)) with no WAL owner. Those nodes now lock the shared store and the second one is refused, while the upgrade note says Raft nodes take no lock. Our own standalone embedding in solo follows that contract: members share one store, and a remote-mount change rebuilds the client in-process beside the live one. I reproduced both shapes failing with StorageInUse. So I'd want the contract and the note fixed here, and we'll adapt solo on its next bump to next.

(2) A design question more than a recommendation. #2131 made the lock the oracle for server start because a recorded pid lies after a crash, but local_server::find still decides "a server serves this storage" from pid liveness and a cmdline substring (both of which answer true on Windows). Now that every open takes the lock, the lock could answer that exactly. Merge order is as the body says: #2131 to main, main into next, then this.

Full review below:


✅ Approving to unblock you — with 1 thing that needs to be addressed before this merges.

This is a big, careful change, @bplatz, and the routing refactor alone is worth it: one local_server reader instead of three drifted copies, --direct as one process-wide setting, and a storage-path check, so a server on another --storage-path no longer captures the project's commands. I also like that fluree memory stops opening the project's storage. That retires the "the CLI answered from a stale materialized ledger" trap, and import finally writes the .ttl files that are the actual store. The two merges only adapt #2131 to next: the second generalizes recover_holding into holding_root so the nameservice migrate() on next also runs under the lock. #2131's semantics are otherwise unchanged, and the first merge's conflict resolution keeps both sides.

Must address before merge:

  1. A Raft node built the way fluree-db-consensus's embedding contract says locks the shared store, so the second node is refused (fluree-db-api/src/lib.rs:3525; the contract is at fluree-db-consensus/src/raft/embedded.rs:146-153). The exemption only recognizes a WAL owner or a read-only nameservice, and EmbeddedRaftNode::attach's documented build (build_client_with_nameservice(ReadWrite(..)), the shape it_embedded_node.rs tests) is neither. I reproduced the second build failing with StorageInUse. The upgrade note (docs/operations/upgrading-from-4.2.md:70) and storage.md both say Raft nodes take no lock. My suggested fix (inline) is to make the contract say "build with with_storage_wal_owner(<node id>)", which FileStorage::with_wal_owner's own docs say is what makes a payload durable before its reference is proposed, and which also exempts the lock. The alternative is to exempt a caller-supplied ReadWrite nameservice. Either way, the note should be true for the documented path.

Worth folding in:

  • fluree-db-cli/src/local_server.rs:60: route by the lock rather than by pid liveness + a cmdline substring. The pid check is older than this PR, but this PR routes more commands (create, use, query --connection) through it, so now's the time to fix it.
  • docs/operations/upgrading-from-4.2.md:62: three upgrade-day surprises the note doesn't mention. Every open on a can't-lock filesystem now fails unless FLUREE_STORAGE_ALLOW_UNLOCKED=true. create --from uploads to a running server instead of importing locally, and a directory is refused. Memories that only ever reached the old __memory ledger (a 4.2 memory import) need exporting before the upgrade.
  • On "Not covered": routing index, verify, doc, graphql, track add, materialize, config set-origins and the copy commands is genuinely separate work, since several need server endpoints that don't exist. But those commands ran (unsafely) beside a server in 4.2 and are refused in the next major, so I'd track them against the next → main release rather than the general backlog. That's your call as the person cutting the major.

Adherence to repo commitments:

  • Patterns/abstractions: ✔ One local_server module and one process-wide --direct replace about twenty copies of the routing check. create reuses its --remote paths for the local server, and the lock stays in FlureeBuilder with an explicit without_storage_lock() escape. ⚠️ The Raft exemption doesn't match the consensus crate's documented embedding (must 1).
  • Performance (speed first, memory second): ✔ No engine hot path. The lock is taken once per open. The CLI's wait loop retries every 100 ms and does nothing before the lock is held (lock_storage_root runs before the sweep). A routed command now makes one or two small HTTP calls (exists plus graph-source list) instead of running WAL recovery and a sweep, which is a net win. No performance-degradation risk.
  • Deployment targets: ⚠️ Every native embedder that opens file storage is affected. CI covers fluree-db-server, the CLI and Python. The embedded-Raft host (solo's standalone members, and solo's in-process client rebuild) has no CI here and breaks on its next bump (must 1, plus a solo-side change). solo's Lambdas use S3 and are unaffected. wasm32 is unaffected (native only).
  • Testing: ✔ server_routing.rs drives a real fluree server run, and its create/use/insert test doubles as the regression for the open-before-route bug, since the lock would refuse an early open. When I disabled the early route in resolve_query_target, create_and_use_go_through_the_server went red with "this command does not go through a server yet". context::tests uses a child process as the holder, and the memory import test rebuilds from files. ⚠️ No test builds two nodes per the embedded contract on one store.
  • Conventions: ✔ The commits are well factored, with the ! on the breaking one, and the bodies explain why. The breaking changes are listed in upgrading-from-4.2.md (gaps above).

Verified locally at 31fa5da11 (details in the inline comments): fluree-db-api storage_lock_tests + shared::tests (12/12 by name), fluree-db-cli context::tests (both new tests) and all 6 of tests/server_routing.rs against a real fluree server run, and fluree-db-memory's import test, all green by name. The routing mutation above went red and was restored. I also confirmed that neither merge changes #2131's code beyond adapting it to next, and probed both embedding shapes (since reverted).

Approving so this isn't held up on review, but please get the Raft contract/note fix in before it merges. The rest I'd rather see folded in now than lost in the backlog, and I'm happy to talk any of it through.

Comment thread fluree-db-api/src/lib.rs
.ok_or_else(|| ApiError::config("File storage requires filePath"))?
.clone();

let read_only = matches!(&nameservice, Some(NameServiceMode::ReadOnly(_)));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Must address before merge: a Raft node built the way fluree-db-consensus's embedding contract says now locks the shared store, so the second node is refused, while the upgrade note says Raft nodes take no lock.

This line and lock_storage_root (:2347) exempt exactly two shapes: a WAL owner and a read-only nameservice. fluree-db-server's Raft wiring passes a WAL owner (node-{id}), so it's covered. But EmbeddedRaftNode::attach's contract (fluree-db-consensus/src/raft/embedded.rs:146-153) tells an embedder to build with build_client_with_nameservice(NameServiceMode::ReadWrite(integration.nameservice())) and never mentions a WAL owner, while its module docs (:21-24) have followers writing blobs to "the shared store". build_client_with_nameservice's own docs (fluree-db-api/src/lib.rs:3408-3413) say it's "most notably" for the Raft state machine. it_embedded_node.rs tests exactly that shape, one node per directory, so CI never sees a second one.

I added a throwaway test beside builds_journaling_under_their_own_wal_take_no_lock that builds two clients on one directory with build_client_with_nameservice(ReadWrite(Arc::new(MemoryNameService::new()))). The second failed with StorageInUse. Across processes on a store that locks across hosts, it's the "in use by another Fluree process" variant. Our standalone embedding in solo follows this contract (members sharing one --store-dir), so its second member would refuse to boot once it bumps onto next. The upgrade note (docs/operations/upgrading-from-4.2.md:70) and storage.md both say "Raft nodes ... take no lock".

Two ways to make the note true for the documented path:

  • (my preference) Make the contract say "build with with_storage_wal_owner(<node id>)", as fluree-db-server does, and add an embedder line to the upgrade note. FileStorage::with_wal_owner's docs say an owned log is what makes "a payload durable before its reference is proposed" (the head that would otherwise flush on its behalf lives in Raft), so the owner looks right for an embedded node on its own merits, and it already exempts it from the lock. it_embedded_node.rs could build that way, plus a second node on the same data_dir.
  • Treat a caller-supplied ReadWrite nameservice as shared on purpose (no lock), since that's what the method says it's for. It's broader, though: it would also unlock a single-process embedder that passes its own nameservice.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 555a80e

Comment thread fluree-db-cli/src/local_server.rs Outdated
/// server, and serves the storage this CLI would open.
pub fn find(dirs: &FlureeDir) -> Option<Self> {
let meta = read_meta(dirs.data_dir())?;
if !is_process_alive(meta.pid) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Optional: this decides "a server serves this storage" from pid liveness and a cmdline substring, the same signal #2131 just retired for server start, and the lock could answer it exactly.

This is more of a question than a suggestion. is_process_alive and is_fluree_process both return true on non-unix, and on unix is_fluree_process matches any command line containing both "fluree" and "server". So when a server is killed (crash, OOM, power) and leaves server.meta.json behind, every command on Windows routes to the dead address and fails until --direct or a manual delete. With this PR, create, use and query --connection are in that set too. The check itself predates this PR (it's the old try_server_route), so it isn't yours, but this PR is now the one place it lives. I don't have a Windows box to confirm it, but it follows from the #[cfg(not(unix))] arms.

Now that every open takes the lock, a RootLock::acquire probe on the project's storage answers this directly. If it succeeds, nothing (server or otherwise) holds the storage, so run directly. If it returns Held and there's a live server.meta.json (where readable, holder == meta.pid, which is the identity open_waiting already uses), route. Anything else falls through to the wait in open_waiting. That's the same reasoning as #2131's already_running. It's minor, but if you agree it's right, I'd rather see it folded in now than lost in the backlog.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 5d0a7e1

One change from the sketch: the lock answers only for a server whose server.meta.json records the root it locks. A connection-config server or a peer never locks the project's storage, so a free root would have stopped routing to it; those keep the pid check. A root opened unprotected under FLUREE_STORAGE_ALLOW_UNLOCKED also falls back to the pid, in start too.

[Iceberg](../graph-sources/iceberg.md#where-policies-live-the-model-ledger)).
- **Key rotation covers dropped ledgers**, so retiring a key never leaves a
restorable ledger unreadable.
- **One process per storage directory.** Every process that opens a file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Optional: three upgrade-day surprises this note doesn't mention yet.

  • Filesystems that can't lock. On 4.2, a directory on such a mount opened fine. Now every open of it fails (server, CLI, Python, Rust) until FLUREE_STORAGE_ALLOW_UNLOCKED=true is set. The error says so, and storage.md covers it, but the upgrade note is where an operator will look first.
  • create --from with a server running. It now uploads the file for a server-side import, and a directory is refused ("takes a single file", in run_remote_source_import), where 4.2 imported both locally. The PR body lists this as breaking, but the note only says that create now goes through the server.
  • Memories that only reached the old __memory ledger. A 4.2 fluree memory import wrote only to that ledger (the bug f0fa2e2 fixes), and this release no longer reads it. So anyone who imported on 4.2 should run fluree memory export > memories.json before upgrading and fluree memory import memories.json after, which now writes the .ttl files.

Each is one line. I recognize they're minor, but I'd rather see them in this PR than lost in the backlog.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 01fd975

next now carries #2131 through main, so its commits drop out of this
branch's diff. Resolved:

- error.rs: next's count of 50 covers StorageInUse and next's own
  ConfigUnavailable.
- lib.rs: build_async keeps holding_root, so the nameservice migration
  runs under the lock as well as WAL replay.
- server.rs: ServerMeta lives in local_server; it gains #2131's
  locked_root there, and recorded_server reads it through read_meta.
`EmbeddedRaftNode::attach` told an embedder to build its engine with
`build_client_with_nameservice(ReadWrite(..))` and nothing more. Built that
way on file storage, the engine locks the store, so with the lock on by
default a second node on the shared payload store is refused with
`StorageInUse`, while the upgrade note says Raft nodes take no lock. It also
journals under the root's own log, which does not flush each payload before
its reference is proposed.

The contract now asks for `with_storage_wal_owner(<node id>)`, as
`fluree-db-server` passes `node-{id}`: the node journals under a log of its
own, which flushes every payload, and takes no lock. The raft-clusters
guide and the upgrade note say so, the embedded-node tests build that way,
and a new test builds two nodes on one store.
Routing decided that a server was running from its recorded pid: alive,
and a command line naming "fluree" and "server". A pid outlives a crash
once the system reuses it, and on Windows both checks answer yes, so after
a crash every command routed to a dead address until `--direct` or a manual
delete. This branch routes more commands that way (`create`, `use`, `query
--connection`).

A server that locks its storage records the root in `server.meta.json`,
and now counts as running exactly while that root is held by it, the
answer `start` already takes from the lock. A server that locks nothing (a
connection config, a peer, one `restart` launched) keeps the pid check.
The probe never creates the storage it asks about, and a root opened
unprotected under FLUREE_STORAGE_ALLOW_UNLOCKED falls back to the pid,
which `start` now does too: `RootLock::is_locked` tells such an open apart.

A command that meets the lock of a server found this way is refused at
once, also where the lock file cannot name its holder, instead of waiting
out the 30 seconds. The recorded root is absolute, and `start` compares it
by what it resolves to, so a `start` from another directory or under
another spelling sees the same root.
A directory on a filesystem that cannot lock no longer opens without
FLUREE_STORAGE_ALLOW_UNLOCKED. `fluree create --from` with a local server
running uploads the file for the server to import and refuses a directory.
Memories a 4.2 `fluree memory import` wrote reached only the `__memory`
ledger, which this release no longer reads, so they are exported before the
upgrade and imported after.
On Linux CI the process the routing tests spawn as a stand-in Fluree
server did not yet read as one right after `spawn`, and the fixture's
check failed before the test ran. It now waits up to 5 s for it.
Tests that next and main brought in open a file directory again while an
instance on it is still alive, to read what is on disk cold: a key
rotation's fresh reader, the delete-survives-index-build fresh views, and
the reloads of the stored-facts, temporal-precision and multi-op update
tests. With the lock on by default the second open is refused, so they
open it with `without_storage_lock()`, as this branch's other such tests do.
@bplatz
bplatz merged commit f7cc792 into next Oct 20, 2026
19 checks passed
@bplatz
bplatz deleted the feat/storage-lock-by-default branch October 20, 2026 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked breaking-change Backwards-incompatible change; drives the Breaking Changes release-notes section

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants