HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

Is it safe to initially rsync without pg_start_backup, provided you snapshot and rsync afterwards?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
withoutafterwardspg_start_backupyouinitiallyprovidedsnapshotsafeandrsync

Problem

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



?

Solution

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.

Context

StackExchange Database Administrators Q#222744, answer score: 4

Revisions (0)

No revisions yet.