MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / change_store

Method change_store

libatomic/src/daemon/state.rs:254–264  ·  view source on GitHub ↗

The redb-native change/provenance store (atomic.redb — the merged database) for this request — opened by path WITHOUT opening the repository handle. redb refuses a second concurrent handle on the same file, so the journal-port handlers open, use, and drop this sequentially under the gate (the same open/close-per-op discipline #230's orchestrator applies).

(&self)

Source from the content-addressed store, hash-verified

252 /// sequentially under the gate (the same open/close-per-op discipline
253 /// #230's orchestrator applies).
254 pub fn change_store(&self) -> Result<RedbChangeStore, Status> {
255 let dot_dir = Repository::canonical_dot_dir(&self.root).map_err(repository_error)?;
256 let path = atomic_repository::ensure_database(&dot_dir)
257 .map_err(|error| domain_status(ErrorCode::Repository, error.to_string()))?;
258 RedbChangeStore::open_existing_wait(&path, database_open_wait()).map_err(|error| {
259 domain_status(
260 ErrorCode::ProvenanceStore,
261 format!("failed to open {}: {error}", path.display()),
262 )
263 })
264 }
265}
266
267/// Shared adapter for service paths that already own a repository handle.

Callers 15

publish_provenanceMethod · 0.45
append_hook_log_implFunction · 0.45
load_hook_log_implFunction · 0.45
check_turn_scopeFunction · 0.45
reserve_turn_implFunction · 0.45
append_envelopes_implFunction · 0.45
prepare_checkpoint_implFunction · 0.45
update_turn_implFunction · 0.45
get_turn_implFunction · 0.45

Calls 3

ensure_databaseFunction · 0.85
domain_statusFunction · 0.85
database_open_waitFunction · 0.85

Tested by

no test coverage detected