"Masao Fujii" <fujii(dot)masao(at)oss(dot)ntt(dot)co(dot)jp> writes:
> The cause of the problem is that pg_stop_backup creates two *.ready files.
> One file is created by pg_stop_backup > RemoveOldBackupHistory >
> XLogArchiveIsDone > XLogArchiveNotify.
> Another is created by pg_stop_backup > XLogArchiveNotify.
Oooh, good catch. The cleanest solution would be to modify
RemoveOldBackupHistory so that it explicitly skips the current entry.
But I'm strongly tempted to just remove the code in pg_stop_backup,
and document that RemoveOldBackupHistory gets the job done (perhaps
renaming it).
regards, tom lane