Skip to main content

Module physical

Module physical 

Source
Expand description

Physical storage design primitives for RedDB’s deterministic on-disk layout.

Re-exports§

pub use self::shm::provision_shm;
pub use self::shm::read_shm_header;
pub use self::shm::set_shm_provisioning_enabled;
pub use self::shm::shm_path_for;
pub use self::shm::shm_provisioning_enabled;
pub use self::shm::ShmHandle;
pub use self::shm::ShmHeader;
pub use self::shm::ShmProvisionState;
pub use self::shm::SHM_FILE_SIZE;
pub use self::shm::SHM_HEADER_SIZE;
pub use self::shm::SHM_MAGIC;
pub use self::shm::SHM_VERSION;

Modules§

shm
<data>.shm shared-memory file substrate (gh-475).

Structs§

BlockReference
CollectionContract
DeclaredColumnContract
ExportDescriptor
GridLayout
ManifestEvent
ManifestPointers
PhysicalAnalyticsJob
PhysicalGraphProjection
PhysicalIndexState
PhysicalLayout
PhysicalMetadataFile
PhysicalTreeDefinition
SnapshotDescriptor
SuperblockHeader
WalPolicy

Enums§

ArtifactState
Canonical artifact lifecycle states.
CompactionPolicy
ContractOrigin
ManifestEventKind
PhysicalMetadataSource

Constants§

DEFAULT_GRID_BLOCK_SIZE
DEFAULT_MANIFEST_EVENT_HISTORY
DEFAULT_METADATA_JOURNAL_RETENTION
Retention applied when the seq-N catalog journal is enabled at the Max tier. See seqn_journal_retention.
DEFAULT_PAGE_SIZE
DEFAULT_SUPERBLOCK_COPIES
OPT_IN_METADATA_JOURNAL_RETENTION
Retention applied when the seq-N catalog journal is opt-in enabled outside of the Max tier — keeps forensics surface minimal on lower tiers.
PHYSICAL_METADATA_BINARY_EXTENSION
PHYSICAL_METADATA_PROTOCOL_VERSION

Functions§

fold_dwb_into_wal_enabled
Whether the pager should fold DWB into WAL (no <data>-dwb sidecar). Reads still tolerate the legacy sidecar so existing databases keep working through the flag flip.
fold_pager_meta_enabled
Whether the pager should fold metadata into page 1 only and skip the <data>-meta sidecar shadow. Reads still tolerate the sidecar so existing databases keep working through the flag flip.
meta_json_sidecar_enabled
Whether new metadata writes should additionally emit the JSON sidecar. Defaults to false; opt-in via set_meta_json_sidecar_enabled or the REDDB_META_JSON_SIDECAR=1 env var (escape hatch for ad-hoc debugging of a non-Max instance). Reads always tolerate either JSON or binary.
seqn_journal_enabled
Whether new metadata saves should also emit a seq-N journal entry.
seqn_journal_retention
Resolved retention bound for the seq-N journal. Falls back to env REDDB_SEQN_JOURNAL_RETENTION, then to OPT_IN_METADATA_JOURNAL_RETENTION (4) — the conservative off-tier baseline.
set_fold_dwb_into_wal_enabled
Process-wide opt-in for folding the double-write buffer into the WAL via full-page-image (FPI) records. When enabled, the pager does not open or write <data>-dwb; recovery rebuilds torn pages from FPI records replayed before normal redo. Defaults off.
set_fold_pager_meta_enabled
Process-wide opt-in for folding pager metadata (page 1) into the datafile without an adjacent <data>-meta shadow. When enabled, the corruption- recovery shadow at <data>-meta is not written; readers trust page 1 (plus its overflow chain) as the single source of truth. Defaults off.
set_meta_json_sidecar_enabled
Process-wide opt-in for the legacy <data>.meta.json sidecar. Call once at startup after resolving the active [StorageLayout].
set_seqn_journal_enabled
Process-wide opt-in for the seq-N catalog journal (<data>.meta.rdbx.seq-N snapshot trail). Defaults off so non-Max tiers don’t accumulate forensic artifacts. Tier wiring should call this with true for Max. Escape hatch: REDDB_SEQN_JOURNAL=1.
set_seqn_journal_retention
Process-wide retention for the seq-N catalog journal. Tier wiring should call this with DEFAULT_METADATA_JOURNAL_RETENTION (32) for Max and OPT_IN_METADATA_JOURNAL_RETENTION (4) for opt-in non-Max use. 0 resets to defaults (env or off-tier baseline).