Trying to think of ways to speed up slave creation without master downtime.
The normal way of doing is:
- pg_start_backup
- rsync database files
- pg_stop_backup
- rsync wal files and start slave
Since 2 can take a long time over the network, is it safe to:
- rsync
- pg_start_backup
- rsync again
- pg_stop_backup
- rsync wal files and start slave
?
Best Answer
Yes, completely safe. The subsequent rsync performed under snapshot conditions will ensure that the data is properly aligned using the delta method.
One might want to ensure that there isn't an accumulation of irrelevant data files by using the --delete option (think carefully about what you are excluding) but this is a mostly separate issue.