1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2025-07-16 07:14:15 +02:00

tests: compression.test_uncompressable_pages() added

This commit is contained in:
Grigory Smolkin
2019-02-28 17:06:33 +03:00
parent b2514b9a0a
commit b6c43f93d2

View File

@ -493,7 +493,7 @@ class CompressionTest(ProbackupTest, unittest.TestCase):
# Clean after yourself # Clean after yourself
self.del_test_dir(module_name, fname) self.del_test_dir(module_name, fname)
@unittest.skip("skip") # @unittest.skip("skip")
def test_uncompressable_pages(self): def test_uncompressable_pages(self):
""" """
make archive node, create table with uncompressable toast pages, make archive node, create table with uncompressable toast pages,
@ -507,53 +507,41 @@ class CompressionTest(ProbackupTest, unittest.TestCase):
set_replication=True, set_replication=True,
initdb_params=['--data-checksums'], initdb_params=['--data-checksums'],
pg_options={ pg_options={
'wal_level': 'replica', 'wal_level': 'replica'})
'max_wal_senders': '2',
'checkpoint_timeout': '30s'}
)
self.init_pb(backup_dir) self.init_pb(backup_dir)
self.add_instance(backup_dir, 'node', node) self.add_instance(backup_dir, 'node', node)
self.set_archiving(backup_dir, 'node', node) self.set_archiving(backup_dir, 'node', node)
node.slow_start() node.slow_start()
# node.safe_psql( # Full
# "postgres", self.backup_node(
# "create table t_heap as select i, " backup_dir, 'node', node,
# "repeat('1234567890abcdefghiyklmn', 1)::bytea, " options=[
# "point(0,0) from generate_series(0,1) i") '--compress-algorithm=zlib',
'--compress-level=0'])
node.safe_psql( node.pgbench_init(scale=3)
"postgres",
"create table t as select i, "
"repeat(md5(i::text),5006056) as fat_attr "
"from generate_series(0,10) i;")
self.backup_node( self.backup_node(
backup_dir, 'node', node, backup_dir, 'node', node,
backup_type='full', backup_type='delta',
options=[ options=[
'--compress']) '--compress-algorithm=zlib',
'--compress-level=0'])
pgdata = self.pgdata_content(node.data_dir)
node.cleanup() node.cleanup()
self.restore_node(backup_dir, 'node', node) self.restore_node(backup_dir, 'node', node)
# Physical comparison
if self.paranoia:
pgdata_restored = self.pgdata_content(node.data_dir)
self.compare_pgdata(pgdata, pgdata_restored)
node.slow_start() node.slow_start()
self.backup_node(
backup_dir, 'node', node,
backup_type='full',
options=[
'--compress'])
# Clean after yourself # Clean after yourself
# self.del_test_dir(module_name, fname) self.del_test_dir(module_name, fname)
# create table t as select i, repeat(md5('1234567890'), 1)::bytea, point(0,0) from generate_series(0,1) i;
# create table t_bytea_1(file oid);
# INSERT INTO t_bytea_1 (file)
# VALUES (lo_import('/home/gsmol/git/postgres/contrib/pg_probackup/tests/expected/sample.random', 24593));
# insert into t_bytea select string_agg(data,'') from pg_largeobject where pageno > 0;
#