Permalink
Browse files

Make cmd_standby cleanup pg_xlog dir on base backup while using strea…

…ming replication.
  • Loading branch information...
1 parent 58ea004 commit 688c0187f5753489286c32317fb6e1d89c984d40 @soulhunter soulhunter committed Jun 12, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 cmd_standby
View
5 cmd_standby
@@ -365,6 +365,11 @@ def base_backup_func():
if debug == 'on':
print "DEBUG: " + row
row = row.rstrip('\n')
+ # Before, doing the rsync, make sure we cleanup pg_xlog for streaming replication
+ if use_streaming_replication:
+ if debug == 'on':
+ print "DEBUG: cleaning up " + row + "/pg_xlog/ directory before rsync"
+ os.system("rm -rf " + row + "/pg_xlog/*")
retval = system("%s%s/ %s/" % (copy_dirs,row,row))
if retval:
print

0 comments on commit 688c018

Please sign in to comment.