Remove the dataset RwLock
The dataset is shared as Arc<RwLock<Store>> (SharedDataset), but the lock protects nothing that Oxigraph does not already guarantee.
Why it is unnecessary:
oxigraph::store::StoreisClone(a handle to shared storage) and thread-safe. Its in-memory backend gives each query a consistent snapshot while writes proceed.- Watch-mode reloads already mutate the store in place under a read guard (
watcher::reload), relying on that guarantee rather than on the lock. - The only write-lock acquisition is
reload_datasetinsrc/lib.rs, which swaps in a freshly loaded store. It runs only during initial load (both--no-watchand watch mode viaDirectoryWatcher::start_with_patterns), beforeStartupGateis marked ready. - HTTP and MCP queries wait on
StartupGatebefore taking the read lock, so once a query reaches the lock no writer can exist. Acquisition never blocks; it only adds poisoning error paths and a lock-wait boundary that has to be reasoned about.
Proposal:
Have the initial load publish its finished Store through the startup gate (for example a OnceLock<Store>, or a gate that carries the store on Ready), and give queries and the watcher a Store clone instead of a lock guard.
Acceptance:
- Remove
RwLockfromSharedDatasetand allread()/write()call sites inserver.rs,mcp.rs,watcher.rsandlib.rs, together with their lock-poisoning error handling. - Preserve startup behaviour: queries wait until the initial load finishes and receive the existing error if it fails.
- Existing HTTP, MCP and watcher tests pass; reload visibility tests still observe in-place updates.
This also removes the lock-wait boundary from the query-timeout design in https://github.com/iolanta-tech/sparqld/issues/27.