BACKUP SEAL

Since 1.1.0OtherKiviDB command

Syntax

BACKUP SEAL

Ends the backup BACKUP START began: it stops collecting writes, flushes them to disk as appendonly.aof.N.incr.aof, and writes the manifest, appendonly.aof.manifest. The backup now holds the dataset as it is at this moment: restored, it has every write made before the seal and none made after. Use it once you want the backup to end; on a cluster, start a backup on each node in turn, then seal them together.

The snapshot must be written first: while BACKUP STATUS says snapshotting, the seal is refused; wait for incrementing and try again. Once sealed, the state is sealed with an end_time, BACKUP LIST lists the three files, and no other backup can start until BACKUP CLEANUP, or backup-sealed-ttl seconds after the seal, deletes it. To restore it, start a server with --preload-file aof:<path to the manifest> (Persistence).

Reply

  • OK.
  • ERR the base snapshot is still being written; try again while the state is snapshotting.
  • ERR no backup is in progress when there is none to seal: none was started, or it is sealed, failed or aborted already.
  • ERR the backup is already being sealed if another connection is sealing it.
  • ERR could not seal the backup: ... if the files cannot be written; the backup is then failed.

Examples

> BACKUP START
OK
> BACKUP SEAL
(error) ERR the base snapshot is still being written; try again
> BACKUP STATUS
1) "state"
2) "incrementing"
...
> SET afterstart yes
OK
> BACKUP SEAL
OK
> BACKUP STATUS
1) "state"
2) "sealed"
3) "error"
4) ""
5) "start_time"
6) "1794254839"
7) "end_time"
8) "1794254842"
> BACKUP SEAL
(error) ERR no backup is in progress