File System: Difference between revisions
No edit summary |
Wikiservice (talk | contribs) (Refresh MemCP documentation: accuracy, operational guidance, performance profile and maintained API reference) |
||
| Line 1: | Line 1: | ||
<!-- Copyright (C) 2026 Carl-Philip Haensch --> | |||
<!-- SPDX-License-Identifier: GPL-3.0-or-later --> | |||
= File System Persistence = | |||
The local backend stores every database in a subdirectory below <code>-data</code>. It is the simplest persistent backend and is appropriate when one MemCP process owns the writable data directory. | |||
* schema.json | == On-disk layout == | ||
* | |||
* | * <code>schema.json</code> is the authoritative database schema and names the published table/shard generation. | ||
* <code>schema.json.old</code> is a rescue link to the previous committed schema generation and is read when the live schema is missing or empty. | |||
* <code><shard-uuid>-<column></code> stores a serialized main column. Long column names are replaced in filenames by a stable hash. | |||
* <code><shard-uuid>.log</code> is the WAL for <code>safe</code> and <code>logged</code> shards. | |||
* <code>blob/aa/bb/<hash></code> stores content-addressed large values below fan-out directories. | |||
Schema publication writes a same-directory temporary file, optionally fsyncs it, then atomically renames it into place. For durable writes, the directory is synchronized afterwards. A rebuild writes new immutable column files before <code>schema.json</code> makes that generation authoritative; obsolete files are removed only after publication. | |||
== Backup and recovery == | |||
For a simple offline backup, stop MemCP cleanly and copy the complete data directory, including schema generations, column files, WALs and blobs. Do not copy only <code>schema.json</code>. A live filesystem snapshot must preserve a mutually consistent point in time; test restore and WAL replay with the actual filesystem and ENGINE modes. | |||
Never let two independent MemCP processes write the same directory. A shared filesystem does not provide cluster ownership, invalidation or fencing. The planned multi-node design uses explicit coordination and RADOS; see [[Cluster Monitor]]. | |||
See [[Storage Backends]], [[Persistency and Performance Guarantees]] and [[Deployment]]. | |||
Latest revision as of 11:59, 28 August 2026
File System Persistence
The local backend stores every database in a subdirectory below -data. It is the simplest persistent backend and is appropriate when one MemCP process owns the writable data directory.
On-disk layout
schema.jsonis the authoritative database schema and names the published table/shard generation.schema.json.oldis a rescue link to the previous committed schema generation and is read when the live schema is missing or empty.<shard-uuid>-<column>stores a serialized main column. Long column names are replaced in filenames by a stable hash.<shard-uuid>.logis the WAL forsafeandloggedshards.blob/aa/bb/<hash>stores content-addressed large values below fan-out directories.
Schema publication writes a same-directory temporary file, optionally fsyncs it, then atomically renames it into place. For durable writes, the directory is synchronized afterwards. A rebuild writes new immutable column files before schema.json makes that generation authoritative; obsolete files are removed only after publication.
Backup and recovery
For a simple offline backup, stop MemCP cleanly and copy the complete data directory, including schema generations, column files, WALs and blobs. Do not copy only schema.json. A live filesystem snapshot must preserve a mutually consistent point in time; test restore and WAL replay with the actual filesystem and ENGINE modes.
Never let two independent MemCP processes write the same directory. A shared filesystem does not provide cluster ownership, invalidation or fencing. The planned multi-node design uses explicit coordination and RADOS; see Cluster Monitor.
See Storage Backends, Persistency and Performance Guarantees and Deployment.