*:fix point-in-time backup

Backup process should be able to read all WALs until io.EOF to
generate a point-in-time backup.

Our WAL file is append-only. And the backup process will lock all
files before start reading, which can prevent the gc routine from
removing any files in the middle.
This commit is contained in:
Xiang Li
2015-06-12 16:06:02 -07:00
parent 219d304291
commit f59da0e453
3 changed files with 64 additions and 43 deletions

View File

@ -66,7 +66,7 @@ func handleBackup(c *cli.Context) {
}
}
w, err := wal.OpenNotInUse(srcWAL, walsnap)
w, err := wal.OpenForRead(srcWAL, walsnap)
if err != nil {
log.Fatal(err)
}