On Wed, Feb 20, 2019 at 09:58:12AM -0800, Andre Piwoni wrote:
> Also, what do you mean that my archive command is not safe? It is straight
> from PostrgreSQL docs and other resources:
> https://www.postgresql.org/docs/10/continuous-archiving.html
> https://www.opsdash.com/blog/postgresql-wal-archiving-backup.html
The docs are not the best thing on this side... One immediate problem
one could note is that cp does not flush the segment. So if your host
crashes before the OS flushes the copied data then the WAL segment
data is lost. The flush needs to happen before the archive command
returns its status to the server.
> It seems you agree that segment created during pg_basebackup with stream
> mode, which is not marked with .done extension, would be attempted to be
> archived again. I also understand stream method during backup is default so
> changing this behavior may have an impact. If there's any free solution you
> could recommend for backup strategy please let me know.
pgBackRest and repmgr are tools mentioned on the lists.
--
Michael