Skip to content

Commit

Permalink
Make cmd_standby cleanup pg_xlog dir on base backup while using strea…
Browse files Browse the repository at this point in the history
…ming replication.
  • Loading branch information
soulhunter committed Jun 12, 2012
1 parent 58ea004 commit 688c018
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd_standby
Expand Up @@ -365,6 +365,11 @@ def base_backup_func():
if debug == 'on': if debug == 'on':
print "DEBUG: " + row print "DEBUG: " + row
row = row.rstrip('\n') 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)) retval = system("%s%s/ %s/" % (copy_dirs,row,row))
if retval: if retval:
print print
Expand Down

0 comments on commit 688c018

Please sign in to comment.