1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2024-12-02 09:53:24 +02:00

fix ptrack

This commit is contained in:
sfalkon 2017-11-07 11:51:09 +03:00
parent 72aa1592c3
commit e51200032e

View File

@ -9,6 +9,10 @@ import hashlib
import re
import pwd
from distutils.version import LooseVersion
idx_ptrack = {
't_heap': {
'type': 'heap'
@ -633,12 +637,20 @@ class ProbackupTest(object):
""" Returns current user name """
return pwd.getpwuid(os.getuid())[0]
"""
def switch_wal_segment(self, node):
""" Execute pg_switch_wal/xlog() in given node"""
# Execute pg_switch_wal/xlog() in given node
if testgres.version_to_num(node.safe_psql("postgres", "show server_version")) >= testgres.version_to_num('10.0'):
node.safe_psql("postgres", "select pg_switch_wal()")
else:
node.safe_psql("postgres", "select pg_switch_xlog()")
"""
def switch_wal_segment(self, node):
if LooseVersion(testgres.get_pg_version()) < LooseVersion('10.0'):
node.safe_psql("postgres", "select pg_switch_wal()")
else:
node.safe_psql("postgres", "select pg_switch_xlog()")
def del_test_dir(self, module_name, fname):
""" Del testdir and optimistically try to del module dir"""