Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3088f4f

Browse files
committed
tests: some more of ptrack fixes
1 parent dff482a commit 3088f4f

File tree

2 files changed

+3
-24
lines changed

2 files changed

+3
-24
lines changed

tests/ptrack_truncate.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def test_ptrack_truncate(self):
6060
# Make full backup to clean every ptrack
6161
self.backup_node(
6262
backup_dir, 'node', node, options=['-j10', '--stream'])
63+
6364
for i in idx_ptrack:
6465
idx_ptrack[i]['ptrack'] = self.get_ptrack_bits_per_page_for_fork(
6566
node, idx_ptrack[i]['path'], [idx_ptrack[i]['old_size']])
@@ -100,6 +101,7 @@ def test_ptrack_truncate_replica(self):
100101
replica.start()
101102

102103
# Create table and indexes
104+
self.create_tblspace_in_node(master, 'somedata')
103105
master.safe_psql(
104106
"postgres",
105107
"create sequence t_seq; create table t_heap tablespace somedata "
@@ -114,9 +116,6 @@ def test_ptrack_truncate_replica(self):
114116
i, idx_ptrack[i]['relation'],
115117
idx_ptrack[i]['type'], idx_ptrack[i]['column']))
116118

117-
replica.safe_psql('postgres', 'truncate t_heap')
118-
replica.safe_psql('postgres', 'checkpoint')
119-
120119
# Sync master and replica
121120
lsn = master.safe_psql(
122121
'postgres', 'SELECT pg_catalog.pg_current_wal_lsn()').rstrip()
@@ -143,9 +142,7 @@ def test_ptrack_truncate_replica(self):
143142
replica, idx_ptrack[i]['path'], [idx_ptrack[i]['old_size']])
144143
self.check_ptrack_clean(idx_ptrack[i], idx_ptrack[i]['old_size'])
145144

146-
# Delete some rows, vacuum it and make checkpoint
147-
master.safe_psql('postgres', 'delete from t_heap where id%2 = 1')
148-
master.safe_psql('postgres', 'vacuum t_heap')
145+
master.safe_psql('postgres', 'truncate t_heap')
149146
master.safe_psql('postgres', 'checkpoint')
150147

151148
# Sync master and replica

tests/ptrack_vacuum_bits_visibility.py

-18
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,6 @@ def test_ptrack_vacuum_bits_visibility(self):
4747

4848
node.safe_psql('postgres', 'checkpoint')
4949

50-
# Sync master and replica
51-
lsn = master.safe_psql(
52-
'postgres', 'SELECT pg_catalog.pg_current_wal_lsn()').rstrip()
53-
replica.poll_query_until(
54-
"postgres",
55-
"SELECT '{0}'::pg_lsn <= pg_last_wal_replay_lsn()".format(
56-
lsn))
57-
replica.safe_psql('postgres', 'checkpoint')
58-
5950
for i in idx_ptrack:
6051
# get size of heap and indexes. size calculated in pages
6152
idx_ptrack[i]['old_size'] = self.get_fork_size(node, i)
@@ -71,15 +62,6 @@ def test_ptrack_vacuum_bits_visibility(self):
7162
node.safe_psql('postgres', 'vacuum t_heap')
7263
node.safe_psql('postgres', 'checkpoint')
7364

74-
# Sync master and replica
75-
lsn = master.safe_psql(
76-
'postgres', 'SELECT pg_catalog.pg_current_wal_lsn()').rstrip()
77-
replica.poll_query_until(
78-
"postgres",
79-
"SELECT '{0}'::pg_lsn <= pg_last_wal_replay_lsn()".format(
80-
lsn))
81-
replica.safe_psql('postgres', 'checkpoint')
82-
8365
# CHECK PTRACK SANITY
8466
success = True
8567
for i in idx_ptrack:

0 commit comments

Comments
 (0)