mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2025-03-23 22:00:49 +02:00
Merge branch 'master' into stable
This commit is contained in:
commit
e78e1eb9d4
@ -1165,7 +1165,8 @@ pg_ptrack_support(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Now we support only ptrack versions upper than 1.5 */
|
/* Now we support only ptrack versions upper than 1.5 */
|
||||||
if (strverscmp(PQgetvalue(res_db, 0, 0), "1.5") < 0)
|
if (strcmp(PQgetvalue(res_db, 0, 0), "1.5") != 0 &&
|
||||||
|
strcmp(PQgetvalue(res_db, 0, 0), "1.6") != 0)
|
||||||
{
|
{
|
||||||
elog(WARNING, "Update your ptrack to the version 1.5 or upper. Current version is %s", PQgetvalue(res_db, 0, 0));
|
elog(WARNING, "Update your ptrack to the version 1.5 or upper. Current version is %s", PQgetvalue(res_db, 0, 0));
|
||||||
PQclear(res_db);
|
PQclear(res_db);
|
||||||
|
@ -44,8 +44,7 @@ class ArchiveTest(ProbackupTest, unittest.TestCase):
|
|||||||
node.cleanup()
|
node.cleanup()
|
||||||
|
|
||||||
self.restore_node(
|
self.restore_node(
|
||||||
backup_dir, 'node', node,
|
backup_dir, 'node', node)
|
||||||
options=["--recovery-target-action=promote"])
|
|
||||||
node.start()
|
node.start()
|
||||||
while node.safe_psql(
|
while node.safe_psql(
|
||||||
"postgres",
|
"postgres",
|
||||||
@ -659,8 +658,7 @@ class ArchiveTest(ProbackupTest, unittest.TestCase):
|
|||||||
|
|
||||||
# Settings for Replica
|
# Settings for Replica
|
||||||
self.restore_node(
|
self.restore_node(
|
||||||
backup_dir, 'master', replica,
|
backup_dir, 'master', replica)
|
||||||
options=['--recovery-target-action=promote'])
|
|
||||||
# CHECK PHYSICAL CORRECTNESS on REPLICA
|
# CHECK PHYSICAL CORRECTNESS on REPLICA
|
||||||
pgdata_replica = self.pgdata_content(replica.data_dir)
|
pgdata_replica = self.pgdata_content(replica.data_dir)
|
||||||
self.compare_pgdata(pgdata_master, pgdata_replica)
|
self.compare_pgdata(pgdata_master, pgdata_replica)
|
||||||
|
@ -11,14 +11,19 @@ class ExcludeTest(ProbackupTest, unittest.TestCase):
|
|||||||
# @unittest.skip("skip")
|
# @unittest.skip("skip")
|
||||||
# @unittest.expectedFailure
|
# @unittest.expectedFailure
|
||||||
def test_exclude_temp_tables(self):
|
def test_exclude_temp_tables(self):
|
||||||
"""make node without archiving, create temp table, take full backup, check that temp table not present in backup catalogue"""
|
"""
|
||||||
|
make node without archiving, create temp table, take full backup,
|
||||||
|
check that temp table not present in backup catalogue
|
||||||
|
"""
|
||||||
fname = self.id().split('.')[3]
|
fname = self.id().split('.')[3]
|
||||||
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
|
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
|
||||||
node = self.make_simple_node(base_dir="{0}/{1}/node".format(module_name, fname),
|
node = self.make_simple_node(
|
||||||
|
base_dir="{0}/{1}/node".format(module_name, fname),
|
||||||
set_replication=True,
|
set_replication=True,
|
||||||
initdb_params=['--data-checksums'],
|
initdb_params=['--data-checksums'],
|
||||||
pg_options={'wal_level': 'replica', 'max_wal_senders': '2', 'shared_buffers': '1GB',
|
pg_options={
|
||||||
"fsync": "off", 'ptrack_enable': 'on'}
|
'wal_level': 'replica', 'max_wal_senders': '2',
|
||||||
|
'shared_buffers': '1GB', 'fsync': 'off', 'ptrack_enable': 'on'}
|
||||||
)
|
)
|
||||||
|
|
||||||
self.init_pb(backup_dir)
|
self.init_pb(backup_dir)
|
||||||
@ -28,10 +33,14 @@ class ExcludeTest(ProbackupTest, unittest.TestCase):
|
|||||||
conn = node.connect()
|
conn = node.connect()
|
||||||
with node.connect("postgres") as conn:
|
with node.connect("postgres") as conn:
|
||||||
|
|
||||||
conn.execute("create temp table test as select generate_series(0,50050000)::text")
|
conn.execute(
|
||||||
|
"create temp table test as "
|
||||||
|
"select generate_series(0,50050000)::text")
|
||||||
conn.commit()
|
conn.commit()
|
||||||
|
|
||||||
temp_schema_name = conn.execute("SELECT nspname FROM pg_namespace WHERE oid = pg_my_temp_schema()")[0][0]
|
temp_schema_name = conn.execute(
|
||||||
|
"SELECT nspname FROM pg_namespace "
|
||||||
|
"WHERE oid = pg_my_temp_schema()")[0][0]
|
||||||
conn.commit()
|
conn.commit()
|
||||||
|
|
||||||
temp_toast_schema_name = "pg_toast_" + temp_schema_name.replace("pg_", "")
|
temp_toast_schema_name = "pg_toast_" + temp_schema_name.replace("pg_", "")
|
||||||
@ -60,18 +69,24 @@ class ExcludeTest(ProbackupTest, unittest.TestCase):
|
|||||||
temp_toast_filename = os.path.basename(toast_path)
|
temp_toast_filename = os.path.basename(toast_path)
|
||||||
temp_idx_toast_filename = os.path.basename(toast_idx_path)
|
temp_idx_toast_filename = os.path.basename(toast_idx_path)
|
||||||
|
|
||||||
self.backup_node(backup_dir, 'node', node, backup_type='full', options=['--stream'])
|
self.backup_node(
|
||||||
|
backup_dir, 'node', node, backup_type='full', options=['--stream'])
|
||||||
|
|
||||||
for root, dirs, files in os.walk(backup_dir):
|
for root, dirs, files in os.walk(backup_dir):
|
||||||
for file in files:
|
for file in files:
|
||||||
if file in [temp_table_filename, temp_table_filename + ".1",
|
if file in [
|
||||||
temp_idx_filename,
|
temp_table_filename, temp_table_filename + ".1",
|
||||||
temp_idx_filename + ".1",
|
temp_idx_filename,
|
||||||
temp_toast_filename,
|
temp_idx_filename + ".1",
|
||||||
temp_toast_filename + ".1",
|
temp_toast_filename,
|
||||||
temp_idx_toast_filename,
|
temp_toast_filename + ".1",
|
||||||
temp_idx_toast_filename + ".1"]:
|
temp_idx_toast_filename,
|
||||||
self.assertEqual(1, 0, "Found temp table file in backup catalogue.\n Filepath: {0}".format(file))
|
temp_idx_toast_filename + ".1"
|
||||||
|
]:
|
||||||
|
self.assertEqual(
|
||||||
|
1, 0,
|
||||||
|
"Found temp table file in backup catalogue.\n "
|
||||||
|
"Filepath: {0}".format(file))
|
||||||
|
|
||||||
# Clean after yourself
|
# Clean after yourself
|
||||||
self.del_test_dir(module_name, fname)
|
self.del_test_dir(module_name, fname)
|
||||||
@ -92,7 +107,7 @@ class ExcludeTest(ProbackupTest, unittest.TestCase):
|
|||||||
pg_options={
|
pg_options={
|
||||||
'wal_level': 'replica',
|
'wal_level': 'replica',
|
||||||
'max_wal_senders': '2',
|
'max_wal_senders': '2',
|
||||||
"shared_buffers": "1GB",
|
"shared_buffers": "10MB",
|
||||||
"fsync": "off",
|
"fsync": "off",
|
||||||
'ptrack_enable': 'on'}
|
'ptrack_enable': 'on'}
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user