Skip to main content

Module backup

Module backup 

Source
Expand description

Backup, restore, and journal recovery.

  • Backup deep-copies the source repository’s head — the super-root, so the content root and every checkpoint — into a target store, read-only on the source (no lock) and read-write on the target.
  • Restore does the same with the roles swapped: the backup is the read-only source, and its head is copied into an existing store and becomes the new head.
  • Recover-journal rebuilds journal.log when it is missing or unusable by scanning every data segment for candidate super-roots (nodes with both a root and a checkpoints child), verifying the newest one is fully traversable, and rewriting the journal with the surviving candidates oldest first — ordered by the timestamp in each segment’s info record — so the consistent head is the last line.

All three run under the target’s repository lock, so they can never race a running AEM instance, and all leave the store in a state a subsequent AEM start consumes cleanly.

Structs§

RecoveryOutcome
The outcome of a journal recovery.

Functions§

backup
Copies the source repository’s head into target_directory, overwriting the target’s head with the copied super-root. The target is created when absent.
backup_with_progress
Backs up exactly like backup, reporting the source scan and the node copy to observer.
recover_journal
Rebuilds journal.log from the segments on disk. Scans every data segment for super-root candidates, verifies the newest one is fully traversable, and rewrites the journal with the surviving candidates oldest first, so the verified head is the last (winning) line. Backs up any existing journal to journal.log.bak.NNN.
recover_journal_with_progress
Recovers exactly like recover_journal, reporting the candidate scan and the consistency probe to observer.
restore
Restores a backup into an existing store: the backup’s head is copied into target_directory and becomes the new head. The target’s earlier revisions remain in the journal until later compaction reclaims them.
restore_with_progress
Restores exactly like restore, reporting the backup scan and the node copy to observer.