|
|
@@ -271,16 +271,18 @@ func (sm *SnapshotManager) CompleteSnapshot(
|
|
|
|
return sm.MarkSnapshotComplete(ctx, snapshotID)
|
|
|
|
return sm.MarkSnapshotComplete(ctx, snapshotID)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ExportSnapshotMetadata exports snapshot metadata to S3
|
|
|
|
// ExportSnapshotMetadata exports snapshot metadata to the backup destination store
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// This method executes the complete snapshot metadata export process:
|
|
|
|
// This method executes the complete snapshot metadata export process:
|
|
|
|
// 1. Creates a temporary directory for working files
|
|
|
|
// 1. Creates a temporary directory for working files
|
|
|
|
// 2. Copies the main database to preserve its state
|
|
|
|
// 2. Copies the main database to preserve its state
|
|
|
|
// 3. Cleans the copy to contain only current snapshot data
|
|
|
|
// 3. Cleans the copy to contain only current snapshot data
|
|
|
|
// 4. Dumps the cleaned database to SQL
|
|
|
|
// 4. Vacuums the copy to remove the deleted data
|
|
|
|
// 5. Compresses the SQL dump with zstd
|
|
|
|
// 5. Compresses the copy with zstd
|
|
|
|
// 6. Encrypts the compressed data with age (always; recipients are required)
|
|
|
|
// 6. Encrypts the compressed copy with age (always; recipients are required)
|
|
|
|
// 7. Uploads to S3 at: snapshots/{snapshot-id}.sql.zst[.age]
|
|
|
|
// 7. Builds the blob manifest from the copy, compressed but not encrypted
|
|
|
|
|
|
|
|
// 8. Uploads the database to metadata/{remote-key}/db.zst.age
|
|
|
|
|
|
|
|
// 9. Uploads the manifest to metadata/{remote-key}/manifest.json.zst
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// The only caller (finalizeSnapshotMetadata) does not close the main database
|
|
|
|
// The only caller (finalizeSnapshotMetadata) does not close the main database
|
|
|
|
// before calling this method: the index is copied at dbPath while it is still
|
|
|
|
// before calling this method: the index is copied at dbPath while it is still
|
|
|
|