From fb400722d672868dc71ba5a9913d2526d520848f Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 31 Oct 2026 05:22:52 +0100 Subject: remake: drop parse_metadata --- src/remake/snapshot.rs | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'src/remake') diff --git a/src/remake/snapshot.rs b/src/remake/snapshot.rs index b8c784e..b071b74 100644 --- a/src/remake/snapshot.rs +++ b/src/remake/snapshot.rs @@ -169,7 +169,13 @@ struct MetadataRecord { translation: JsonValue, } -fn parse_metadata(doc: &AutoCommit, generation: u64) -> Result { +/// Metadata of an earlier generation, as the current document holds it. Snapshots +/// carry the metadata of all earlier epochs forward (only remake records stay +/// behind), so a node many epochs behind can still find the epoch that followed its own. +pub(crate) fn read_epoch_metadata( + doc: &AutoCommit, + generation: u64, +) -> Result { let value = store::read_path(doc, &epoch_metadata_path(generation)) .map_err(|error| error.to_string())? .ok_or_else(|| format!("no epoch metadata for generation {generation}"))?; @@ -215,7 +221,7 @@ pub(crate) fn verify_document(doc: &mut AutoCommit, epoch: Epoch) -> Result Result { Ok(epoch) } -/// Metadata of an earlier generation, as the current document holds it. Snapshots -/// carry the metadata of all earlier epochs forward (only remake records stay -/// behind), so a node many epochs behind can still find the epoch that followed its own. -pub(crate) fn read_epoch_metadata( - doc: &AutoCommit, - generation: u64, -) -> Result { - parse_metadata(doc, generation) -} - /// Path of the metadata record for an epoch generation. pub(crate) fn epoch_metadata_path(generation: u64) -> Vec { meta::path(&[EPOCHS, generation.to_string().as_str()]) -- cgit v1.3.1