Skip to content

Commit 738013f

Browse files
committed
Merge branch 'master' into issue_106
2 parents b6e97e4 + 535e417 commit 738013f

File tree

3 files changed

+54
-9
lines changed

3 files changed

+54
-9
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ Regardless of the chosen backup type, all backups taken with `pg_probackup` supp
5858
### Linux Installation
5959
```shell
6060
#DEB Ubuntu|Debian Packages
61-
echo "deb [arch=amd64] http://repo.postgrespro.ru/pg_probackup/deb/ $(lsb_release -cs) main-$(lsb_release -cs)" > /etc/apt/sources.list.d/pg_probackup.list
62-
wget -O - http://repo.postgrespro.ru/pg_probackup/keys/GPG-KEY-PG_PROBACKUP | apt-key add - && apt-get update
63-
apt-get install pg-probackup-{11,10,9.6,9.5}
64-
apt-get install pg-probackup-{11,10,9.6,9.5}-dbg
61+
sudo echo "deb [arch=amd64] http://repo.postgrespro.ru/pg_probackup/deb/ $(lsb_release -cs) main-$(lsb_release -cs)" > /etc/apt/sources.list.d/pg_probackup.list
62+
sudo wget -O - http://repo.postgrespro.ru/pg_probackup/keys/GPG-KEY-PG_PROBACKUP | sudo apt-key add - && sudo apt-get update
63+
sudo apt-get install pg-probackup-{11,10,9.6,9.5}
64+
sudo apt-get install pg-probackup-{11,10,9.6,9.5}-dbg
6565

6666
#DEB-SRC Packages
67-
echo "deb-src [arch=amd64] http://repo.postgrespro.ru/pg_probackup/deb/ $(lsb_release -cs) main-$(lsb_release -cs)" >>\
67+
sudo echo "deb-src [arch=amd64] http://repo.postgrespro.ru/pg_probackup/deb/ $(lsb_release -cs) main-$(lsb_release -cs)" >>\
6868
/etc/apt/sources.list.d/pg_probackup.list
69-
apt-get source pg-probackup-{11,10,9.6,9.5}
69+
sudo apt-get source pg-probackup-{11,10,9.6,9.5}
7070

7171
#RPM Centos Packages
7272
rpm -ivh http://repo.postgrespro.ru/pg_probackup/keys/pg_probackup-repo-centos.noarch.rpm
@@ -112,7 +112,7 @@ gen_probackup_project.pl C:\path_to_postgresql_source_tree
112112

113113
## Documentation
114114

115-
Currently the latest documentation can be found at [github](https://postgrespro.github.io/pg_probackup)
115+
Currently the latest documentation can be found at [github](https://postgrespro.github.io/pg_probackup).
116116
Slightly outdated documentation can be found at [Postgres Pro Enterprise documentation](https://postgrespro.com/docs/postgrespro/current/app-pgprobackup).
117117

118118
## License

src/backup.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2493,7 +2493,6 @@ StreamLog(void *arg)
24932493
stream_arg->startpos -= stream_arg->startpos % instance_config.xlog_seg_size;
24942494

24952495
/* Initialize timeout */
2496-
stream_stop_timeout = 0;
24972496
stream_stop_begin = 0;
24982497

24992498
#if PG_VERSION_NUM >= 100000

tests/retention.py

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
22
import unittest
33
from datetime import datetime, timedelta
4-
from .helpers.ptrack_helpers import ProbackupTest
4+
from .helpers.ptrack_helpers import ProbackupTest, ProbackupException
55
from time import sleep
66

77

@@ -1459,3 +1459,49 @@ def test_retention_redundancy_overlapping_chains(self):
14591459

14601460
# Clean after yourself
14611461
self.del_test_dir(module_name, fname)
1462+
1463+
def test_agressive_retention_window_purge(self):
1464+
"""
1465+
https://github.com/postgrespro/pg_probackup/issues/106
1466+
"""
1467+
fname = self.id().split('.')[3]
1468+
node = self.make_simple_node(
1469+
base_dir=os.path.join(module_name, fname, 'node'),
1470+
initdb_params=['--data-checksums'])
1471+
1472+
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
1473+
self.init_pb(backup_dir)
1474+
self.add_instance(backup_dir, 'node', node)
1475+
node.slow_start()
1476+
1477+
# Make ERROR incremental backup
1478+
try:
1479+
self.backup_node(backup_dir, 'node', node, backup_type='page')
1480+
# we should die here because exception is what we expect to happen
1481+
self.assertEqual(
1482+
1, 0,
1483+
"Expecting Error because page backup should not be possible "
1484+
"without valid full backup.\n Output: {0} \n CMD: {1}".format(
1485+
repr(self.output), self.cmd))
1486+
except ProbackupException as e:
1487+
self.assertIn(
1488+
"ERROR: Valid backup on current timeline 1 is not found. "
1489+
"Create new FULL backup before an incremental one.",
1490+
e.message,
1491+
"\n Unexpected Error Message: {0}\n CMD: {1}".format(
1492+
repr(e.message), self.cmd))
1493+
1494+
page_id = self.show_pb(backup_dir, 'node')[0]['id']
1495+
1496+
sleep(1)
1497+
1498+
# Make FULL backup
1499+
self.backup_node(
1500+
backup_dir, 'node', node,
1501+
options=['--delete-expired', '--retention-window=1', '--stream'])
1502+
1503+
# Check number of backups
1504+
self.assertEqual(len(self.show_pb(backup_dir, 'node')), 2)
1505+
1506+
# Clean after yourself
1507+
self.del_test_dir(module_name, fname)

0 commit comments

Comments
 (0)