Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit f532df7

Browse files
committed
Merge commit 'e78e1eb9d45f09775a78fbf1ccce6153e94c1fe6' into PGPRO10
2 parents e9d42b1 + e78e1eb commit f532df7

File tree

3 files changed

+35
-21
lines changed

3 files changed

+35
-21
lines changed

contrib/pg_probackup/src/backup.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1165,7 +1165,8 @@ pg_ptrack_support(void)
11651165
}
11661166

11671167
/* Now we support only ptrack versions upper than 1.5 */
1168-
if (strverscmp(PQgetvalue(res_db, 0, 0), "1.5") < 0)
1168+
if (strcmp(PQgetvalue(res_db, 0, 0), "1.5") != 0 &&
1169+
strcmp(PQgetvalue(res_db, 0, 0), "1.6") != 0)
11691170
{
11701171
elog(WARNING, "Update your ptrack to the version 1.5 or upper. Current version is %s", PQgetvalue(res_db, 0, 0));
11711172
PQclear(res_db);

contrib/pg_probackup/tests/archive.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ def test_pgpro434_1(self):
4444
node.cleanup()
4545

4646
self.restore_node(
47-
backup_dir, 'node', node,
48-
options=["--recovery-target-action=promote"])
47+
backup_dir, 'node', node)
4948
node.start()
5049
while node.safe_psql(
5150
"postgres",
@@ -659,8 +658,7 @@ def test_master_and_replica_concurrent_archiving(self):
659658

660659
# Settings for Replica
661660
self.restore_node(
662-
backup_dir, 'master', replica,
663-
options=['--recovery-target-action=promote'])
661+
backup_dir, 'master', replica)
664662
# CHECK PHYSICAL CORRECTNESS on REPLICA
665663
pgdata_replica = self.pgdata_content(replica.data_dir)
666664
self.compare_pgdata(pgdata_master, pgdata_replica)

contrib/pg_probackup/tests/exclude.py

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,19 @@ class ExcludeTest(ProbackupTest, unittest.TestCase):
1111
# @unittest.skip("skip")
1212
# @unittest.expectedFailure
1313
def test_exclude_temp_tables(self):
14-
"""make node without archiving, create temp table, take full backup, check that temp table not present in backup catalogue"""
14+
"""
15+
make node without archiving, create temp table, take full backup,
16+
check that temp table not present in backup catalogue
17+
"""
1518
fname = self.id().split('.')[3]
1619
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
17-
node = self.make_simple_node(base_dir="{0}/{1}/node".format(module_name, fname),
20+
node = self.make_simple_node(
21+
base_dir="{0}/{1}/node".format(module_name, fname),
1822
set_replication=True,
1923
initdb_params=['--data-checksums'],
20-
pg_options={'wal_level': 'replica', 'max_wal_senders': '2', 'shared_buffers': '1GB',
21-
"fsync": "off", 'ptrack_enable': 'on'}
24+
pg_options={
25+
'wal_level': 'replica', 'max_wal_senders': '2',
26+
'shared_buffers': '1GB', 'fsync': 'off', 'ptrack_enable': 'on'}
2227
)
2328

2429
self.init_pb(backup_dir)
@@ -28,10 +33,14 @@ def test_exclude_temp_tables(self):
2833
conn = node.connect()
2934
with node.connect("postgres") as conn:
3035

31-
conn.execute("create temp table test as select generate_series(0,50050000)::text")
36+
conn.execute(
37+
"create temp table test as "
38+
"select generate_series(0,50050000)::text")
3239
conn.commit()
3340

34-
temp_schema_name = conn.execute("SELECT nspname FROM pg_namespace WHERE oid = pg_my_temp_schema()")[0][0]
41+
temp_schema_name = conn.execute(
42+
"SELECT nspname FROM pg_namespace "
43+
"WHERE oid = pg_my_temp_schema()")[0][0]
3544
conn.commit()
3645

3746
temp_toast_schema_name = "pg_toast_" + temp_schema_name.replace("pg_", "")
@@ -60,18 +69,24 @@ def test_exclude_temp_tables(self):
6069
temp_toast_filename = os.path.basename(toast_path)
6170
temp_idx_toast_filename = os.path.basename(toast_idx_path)
6271

63-
self.backup_node(backup_dir, 'node', node, backup_type='full', options=['--stream'])
72+
self.backup_node(
73+
backup_dir, 'node', node, backup_type='full', options=['--stream'])
6474

6575
for root, dirs, files in os.walk(backup_dir):
6676
for file in files:
67-
if file in [temp_table_filename, temp_table_filename + ".1",
68-
temp_idx_filename,
69-
temp_idx_filename + ".1",
70-
temp_toast_filename,
71-
temp_toast_filename + ".1",
72-
temp_idx_toast_filename,
73-
temp_idx_toast_filename + ".1"]:
74-
self.assertEqual(1, 0, "Found temp table file in backup catalogue.\n Filepath: {0}".format(file))
77+
if file in [
78+
temp_table_filename, temp_table_filename + ".1",
79+
temp_idx_filename,
80+
temp_idx_filename + ".1",
81+
temp_toast_filename,
82+
temp_toast_filename + ".1",
83+
temp_idx_toast_filename,
84+
temp_idx_toast_filename + ".1"
85+
]:
86+
self.assertEqual(
87+
1, 0,
88+
"Found temp table file in backup catalogue.\n "
89+
"Filepath: {0}".format(file))
7590

7691
# Clean after yourself
7792
self.del_test_dir(module_name, fname)
@@ -92,7 +107,7 @@ def test_exclude_unlogged_tables_1(self):
92107
pg_options={
93108
'wal_level': 'replica',
94109
'max_wal_senders': '2',
95-
"shared_buffers": "1GB",
110+
"shared_buffers": "10MB",
96111
"fsync": "off",
97112
'ptrack_enable': 'on'}
98113
)

0 commit comments

Comments
 (0)