You've already forked pg_probackup
mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2025-07-05 05:50:16 +02:00
minor fixes
This commit is contained in:
@ -1,24 +0,0 @@
|
|||||||
class Base(object):
|
|
||||||
def __init__(self):
|
|
||||||
self.a = 10
|
|
||||||
def func(self, arg1, arg2):
|
|
||||||
print 'Child {0}, a = {1}'.format(arg1, arg2)
|
|
||||||
|
|
||||||
|
|
||||||
class ChildA(Base):
|
|
||||||
def __init__(self):
|
|
||||||
Base.__init__(self)
|
|
||||||
b = 5
|
|
||||||
c = b + self.a
|
|
||||||
print 'Child A, a = {0}'.format(c)
|
|
||||||
|
|
||||||
|
|
||||||
class ChildB(Base):
|
|
||||||
def __init__(self):
|
|
||||||
super(ChildB, self).__init__()
|
|
||||||
b = 6
|
|
||||||
c = b + self.a
|
|
||||||
self.func('B', c)
|
|
||||||
|
|
||||||
#ChildA()
|
|
||||||
ChildB()
|
|
@ -1,15 +0,0 @@
|
|||||||
class Foo(object):
|
|
||||||
def __init__(self, *value1, **value2):
|
|
||||||
# do something with the values
|
|
||||||
print 'I think something is being called here'
|
|
||||||
# print value1, value2
|
|
||||||
|
|
||||||
|
|
||||||
class MyFoo(Foo):
|
|
||||||
def __init__(self, *args, **kwargs):
|
|
||||||
# do something else, don't care about the args
|
|
||||||
print args, kwargs
|
|
||||||
super(MyFoo, self).__init__(*args, **kwargs)
|
|
||||||
|
|
||||||
|
|
||||||
foo = MyFoo('Python', 2.7, stack='overflow', ololo='lalala')
|
|
@ -1,23 +0,0 @@
|
|||||||
class Base(object):
|
|
||||||
def __init__(self):
|
|
||||||
self.a = 10
|
|
||||||
self.b = 1
|
|
||||||
# def func(self, arg1, arg2):
|
|
||||||
# print 'Child {0}, a = {1}'.format(arg1, arg2)
|
|
||||||
|
|
||||||
|
|
||||||
class ChildA(Base):
|
|
||||||
def __init__(self):
|
|
||||||
Base.__init__(self)
|
|
||||||
self.b = self.b + 1
|
|
||||||
|
|
||||||
|
|
||||||
class ChildB(ChildA):
|
|
||||||
def __init__(self):
|
|
||||||
ChildA.__init__(self)
|
|
||||||
print 'b = {0}'.format(self.b)
|
|
||||||
# c = b + self.a
|
|
||||||
|
|
||||||
|
|
||||||
#ChildA()
|
|
||||||
ChildB()
|
|
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
pg_probackup - utility to manage backup/recovery of PostgreSQL database.
|
pg_probackup - utility to manage backup/recovery of PostgreSQL database.
|
||||||
|
|
||||||
pg_probackup help
|
pg_probackup help [COMMAND]
|
||||||
|
|
||||||
pg_probackup version
|
pg_probackup version
|
||||||
|
|
||||||
@ -21,20 +21,20 @@ pg_probackup - utility to manage backup/recovery of PostgreSQL database.
|
|||||||
[-d dbname] [-h host] [-p port] [-U username]
|
[-d dbname] [-h host] [-p port] [-U username]
|
||||||
|
|
||||||
pg_probackup restore -B backup-dir
|
pg_probackup restore -B backup-dir
|
||||||
[-D pgdata-dir] [-i backup-id]
|
[-D pgdata-dir] [-i backup-id] [--progress] [-q] [-v]
|
||||||
[--time=time|--xid=xid [--inclusive=boolean]]
|
[--time=time|--xid=xid [--inclusive=boolean]]
|
||||||
[--timeline=timeline] [-T OLDDIR=NEWDIR]
|
[--timeline=timeline] [-T OLDDIR=NEWDIR]
|
||||||
|
|
||||||
pg_probackup validate -B backup-dir
|
pg_probackup validate -B backup-dir
|
||||||
[-D pgdata-dir] [-i backup-id]
|
[-D pgdata-dir] [-i backup-id] [--progress] [-q] [-v]
|
||||||
[--time=time|--xid=xid [--inclusive=boolean]]
|
[--time=time|--xid=xid [--inclusive=boolean]]
|
||||||
[--timeline=timeline] [-T OLDDIR=NEWDIR]
|
[--timeline=timeline]
|
||||||
|
|
||||||
pg_probackup show -B backup-dir
|
pg_probackup show -B backup-dir
|
||||||
[-i backup-id]
|
[-i backup-id]
|
||||||
|
|
||||||
pg_probackup delete -B backup-dir
|
pg_probackup delete -B backup-dir
|
||||||
[--wal] [-i backup-id | --expired] [--force]
|
[--wal] [-i backup-id | --expired]
|
||||||
|
|
||||||
Read the website for details. <https://github.com/postgrespro/pg_probackup>
|
Read the website for details. <https://github.com/postgrespro/pg_probackup>
|
||||||
Report bugs to <https://github.com/postgrespro/pg_probackup/issues>.
|
Report bugs to <https://github.com/postgrespro/pg_probackup/issues>.
|
||||||
|
@ -8,10 +8,10 @@ import subprocess
|
|||||||
from sys import exit
|
from sys import exit
|
||||||
|
|
||||||
|
|
||||||
class SomeTest(ProbackupTest, unittest.TestCase):
|
class CommonArchiveDir(ProbackupTest, unittest.TestCase):
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(SomeTest, self).__init__(*args, **kwargs)
|
super(CommonArchiveDir, self).__init__(*args, **kwargs)
|
||||||
|
|
||||||
# @classmethod
|
# @classmethod
|
||||||
# def tearDownClass(cls):
|
# def tearDownClass(cls):
|
||||||
@ -19,8 +19,9 @@ class SomeTest(ProbackupTest, unittest.TestCase):
|
|||||||
|
|
||||||
def test_pgpro561(self):
|
def test_pgpro561(self):
|
||||||
"""
|
"""
|
||||||
make node with archiving, make stream backup,
|
make node with archiving, make backup,
|
||||||
get Recovery Time, try to make pitr to Recovery Time
|
restore it to node1 and node2, compare timelines
|
||||||
|
EXPECT TO FAIL
|
||||||
"""
|
"""
|
||||||
fname = self.id().split('.')[3]
|
fname = self.id().split('.')[3]
|
||||||
master = self.make_simple_node(base_dir="tmp_dirs/pgpro561/{0}/master".format(fname),
|
master = self.make_simple_node(base_dir="tmp_dirs/pgpro561/{0}/master".format(fname),
|
||||||
|
@ -8,10 +8,10 @@ import subprocess
|
|||||||
from sys import exit
|
from sys import exit
|
||||||
|
|
||||||
|
|
||||||
class SomeTest(ProbackupTest, unittest.TestCase):
|
class RecoveryWithTimeTarget(ProbackupTest, unittest.TestCase):
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(SomeTest, self).__init__(*args, **kwargs)
|
super(RecoveryWithTimeTarget, self).__init__(*args, **kwargs)
|
||||||
|
|
||||||
# @classmethod
|
# @classmethod
|
||||||
# def tearDownClass(cls):
|
# def tearDownClass(cls):
|
||||||
@ -46,7 +46,8 @@ class SomeTest(ProbackupTest, unittest.TestCase):
|
|||||||
"""
|
"""
|
||||||
make node with archiving, make stream backup,
|
make node with archiving, make stream backup,
|
||||||
get Recovery Time, validate to Recovery Time
|
get Recovery Time, validate to Recovery Time
|
||||||
Should fail. Waiting PGPRO-688
|
EXPECT VALIDATE TO FAIL
|
||||||
|
Waiting PGPRO-688
|
||||||
"""
|
"""
|
||||||
fname = self.id().split('.')[3]
|
fname = self.id().split('.')[3]
|
||||||
node = self.make_simple_node(base_dir="tmp_dirs/pgpro668/{0}".format(fname),
|
node = self.make_simple_node(base_dir="tmp_dirs/pgpro668/{0}".format(fname),
|
||||||
|
@ -294,7 +294,7 @@ class ProbackupTest(object):
|
|||||||
|
|
||||||
def run_pb(self, command):
|
def run_pb(self, command):
|
||||||
try:
|
try:
|
||||||
print [self.probackup_path] + command
|
# print [self.probackup_path] + command
|
||||||
output = subprocess.check_output(
|
output = subprocess.check_output(
|
||||||
[self.probackup_path] + command,
|
[self.probackup_path] + command,
|
||||||
stderr=subprocess.STDOUT,
|
stderr=subprocess.STDOUT,
|
||||||
|
@ -22,7 +22,7 @@ class ValidateTest(ProbackupTest, unittest.TestCase):
|
|||||||
|
|
||||||
# @unittest.skip("123")
|
# @unittest.skip("123")
|
||||||
def test_validate_time(self):
|
def test_validate_time(self):
|
||||||
"""recovery to latest from full backup"""
|
"""recovery to latest from full backup. Expect to Fail"""
|
||||||
fname = self.id().split('.')[3]
|
fname = self.id().split('.')[3]
|
||||||
node = self.make_simple_node(base_dir="tmp_dirs/validate/{0}".format(fname),
|
node = self.make_simple_node(base_dir="tmp_dirs/validate/{0}".format(fname),
|
||||||
set_archiving=True,
|
set_archiving=True,
|
||||||
@ -204,7 +204,7 @@ class ValidateTest(ProbackupTest, unittest.TestCase):
|
|||||||
|
|
||||||
# @unittest.skip("123")
|
# @unittest.skip("123")
|
||||||
def test_validate_wal_lost_segment_2(self):
|
def test_validate_wal_lost_segment_2(self):
|
||||||
"""Loose segment located between backups """
|
"""Loose segment located between backups. Expect to fail """
|
||||||
fname = self.id().split('.')[3]
|
fname = self.id().split('.')[3]
|
||||||
node = self.make_simple_node(base_dir="tmp_dirs/validate/{0}".format(fname),
|
node = self.make_simple_node(base_dir="tmp_dirs/validate/{0}".format(fname),
|
||||||
set_archiving=True,
|
set_archiving=True,
|
||||||
@ -235,7 +235,7 @@ class ValidateTest(ProbackupTest, unittest.TestCase):
|
|||||||
wals = map(int, wals)
|
wals = map(int, wals)
|
||||||
|
|
||||||
# delete last wal segment
|
# delete last wal segment
|
||||||
print os.path.join(self.backup_dir(node), "wal", '0000000' + str(max(wals)))
|
#print os.path.join(self.backup_dir(node), "wal", '0000000' + str(max(wals)))
|
||||||
os.remove(os.path.join(self.backup_dir(node), "wal", '0000000' + str(max(wals))))
|
os.remove(os.path.join(self.backup_dir(node), "wal", '0000000' + str(max(wals))))
|
||||||
|
|
||||||
# Need more accurate error message about loosing wal segment between backups
|
# Need more accurate error message about loosing wal segment between backups
|
||||||
|
Reference in New Issue
Block a user