Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[PGPRO-5378] fix unstable tests.replica.ReplicaTest.test_replica_arch…#420

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
kulaginm merged 17 commits intomasterfrompgpro-5378_2
Aug 12, 2021
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
17 commits
Select commitHold shift + click to select a range
90b9b57
[PGPRO-5378] fix unstable tests.replica.ReplicaTest.test_replica_arch…
kulaginmAug 11, 2021
d637c03
fix .travis.yml (check replica tests)
kulaginmAug 11, 2021
2f921ed
try to catch gdb errors in tests.replica.ReplicaTest.test_replica_pro…
kulaginmAug 11, 2021
0a1cee4
try to avoid 'Error disabling address space randomization: Operation …
kulaginmAug 11, 2021
efdb64c
try2 to avoid 'Error disabling address space randomization: Operation…
kulaginmAug 11, 2021
998b344
try3 to avoid 'Error disabling address space randomization: Operation…
kulaginmAug 11, 2021
4e7187e
try4 to avoid 'Error disabling address space randomization: Operation…
kulaginmAug 11, 2021
9ec4277
try5 to avoid 'Error disabling address space randomization: Operation…
kulaginmAug 11, 2021
c349ad1
travis: PGPROBACKUP_GDB=ON by default
kulaginmAug 11, 2021
289e511
skip backup from replica tests for 9.5
kulaginmAug 11, 2021
b71691e
travis: PGPROBACKUP_GDB=ON by default 2
kulaginmAug 11, 2021
eca0b07
skip backup from replica tests for 9.5 part 2
kulaginmAug 11, 2021
9aa60c8
try to catch test_replica_stop_lsn_null_offset error
kulaginmAug 12, 2021
e24e4f9
try 2 to catch test_replica_stop_lsn_null_offset error
kulaginmAug 12, 2021
a755f70
try 3 to catch test_replica_stop_lsn_null_offset error
kulaginmAug 12, 2021
728612f
try 4 to catch test_replica_stop_lsn_null_offset error
kulaginmAug 12, 2021
852494e
remove replica tests from travis
kulaginmAug 12, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 40 additions & 3 deletionstests/replica.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,14 +21,18 @@ def test_replica_switchover(self):
over the course of several switchovers
https://www.postgresql.org/message-id/54b059d4-2b48-13a4-6f43-95a087c92367%40postgrespro.ru
"""

fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node1 = self.make_simple_node(
base_dir=os.path.join(module_name, fname, 'node1'),
set_replication=True,
initdb_params=['--data-checksums'])

if self.get_version(node1) < self.version_to_num('9.6.0'):
self.del_test_dir(module_name, fname)
return unittest.skip(
'Skipped because backup from replica is not supported in PG 9.5')

self.init_pb(backup_dir)
self.add_instance(backup_dir, 'node1', node1)

Expand DownExpand Up@@ -287,6 +291,16 @@ def test_replica_archive_page_backup(self):

self.wait_until_replica_catch_with_master(master, replica)

master.pgbench_init(scale=5)
# Continuous making some changes on master,
# because WAL archiving on replica in idle DB in PostgreSQL is broken:
# replica will not archive the previous WAL until it receives new records in the next WAL file,
# this "lazy" archiving can be seen in src/backend/replication/walreceiver.c:XLogWalRcvWrite()
# (see !XLByteInSeg checking and XLogArchiveNotify() calling).
pgbench = master.pgbench(
stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
options=['-T', '3', '-c', '1', '--no-vacuum'])

backup_id = self.backup_node(
backup_dir, 'replica', replica,
options=[
Expand All@@ -295,6 +309,9 @@ def test_replica_archive_page_backup(self):
'--master-db=postgres',
'--master-port={0}'.format(master.port)])

pgbench.wait()
pgbench.stdout.close()

self.validate_pb(backup_dir, 'replica')
self.assertEqual(
'OK', self.show_pb(backup_dir, 'replica', backup_id)['status'])
Expand All@@ -317,8 +334,6 @@ def test_replica_archive_page_backup(self):
# Change data on master, make PAGE backup from replica,
# restore taken backup and check that restored data equal
# to original data
master.pgbench_init(scale=5)

pgbench = master.pgbench(
options=['-T', '30', '-c', '2', '--no-vacuum'])

Expand DownExpand Up@@ -535,6 +550,11 @@ def test_replica_promote(self):
start backup from replica, during backup promote replica
check that backup is failed
"""
if not self.gdb:
self.skipTest(
"Specify PGPROBACKUP_GDB and build without "
"optimizations for run this test"
)
fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
master = self.make_simple_node(
Expand DownExpand Up@@ -706,6 +726,7 @@ def test_replica_stop_lsn_null_offset(self):
output)

# Clean after yourself
gdb_checkpointer.kill()
self.del_test_dir(module_name, fname)

# @unittest.skip("skip")
Expand DownExpand Up@@ -1085,6 +1106,7 @@ def test_replica_toast(self):
self.compare_pgdata(pgdata, pgdata_restored)

# Clean after yourself
gdb_checkpointer.kill()
self.del_test_dir(module_name, fname)

# @unittest.skip("skip")
Expand DownExpand Up@@ -1313,6 +1335,11 @@ def test_replica_promote_archive_delta(self):
'checkpoint_timeout': '30s',
'archive_timeout': '30s'})

if self.get_version(node1) < self.version_to_num('9.6.0'):
self.del_test_dir(module_name, fname)
return unittest.skip(
'Skipped because backup from replica is not supported in PG 9.5')

self.init_pb(backup_dir)
self.add_instance(backup_dir, 'node', node1)
self.set_config(
Expand DownExpand Up@@ -1433,6 +1460,11 @@ def test_replica_promote_archive_page(self):
'checkpoint_timeout': '30s',
'archive_timeout': '30s'})

if self.get_version(node1) < self.version_to_num('9.6.0'):
self.del_test_dir(module_name, fname)
return unittest.skip(
'Skipped because backup from replica is not supported in PG 9.5')

self.init_pb(backup_dir)
self.add_instance(backup_dir, 'node', node1)
self.set_archiving(backup_dir, 'node', node1)
Expand DownExpand Up@@ -1550,6 +1582,11 @@ def test_parent_choosing(self):
set_replication=True,
initdb_params=['--data-checksums'])

if self.get_version(master) < self.version_to_num('9.6.0'):
self.del_test_dir(module_name, fname)
return unittest.skip(
'Skipped because backup from replica is not supported in PG 9.5')

self.init_pb(backup_dir)
self.add_instance(backup_dir, 'master', master)

Expand Down
1 change: 1 addition & 0 deletionstravis/Dockerfile.in
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,6 +10,7 @@ RUN python3 -m pip install virtualenv

# Environment
ENV PG_MAJOR=${PG_VERSION} PG_BRANCH=${PG_BRANCH}
ENV PGPROBACKUP_GDB=${PGPROBACKUP_GDB}
ENV LANG=C.UTF-8 PGHOME=/pg/testdir/pgbin

# Make directories
Expand Down
19 changes: 17 additions & 2 deletionstravis/docker-compose.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,17 @@
tests:
build: .
version: "3.7"
services:
tests:
build:
context: .

cap_add:
- SYS_PTRACE

security_opt:
- seccomp=unconfined

# don't work
#sysctls:
# kernel.yama.ptrace_scope: 0
privileged: true

6 changes: 6 additions & 0 deletionstravis/make_dockerfile.sh
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -14,12 +14,18 @@ if [ -z ${MODE+x} ]; then
MODE=basic
fi

if [ -z ${PGPROBACKUP_GDB+x} ]; then
PGPROBACKUP_GDB=ON
fi

echo PG_VERSION=${PG_VERSION}
echo PG_BRANCH=${PG_BRANCH}
echo MODE=${MODE}
echo PGPROBACKUP_GDB=${PGPROBACKUP_GDB}

sed \
-e 's/${PG_VERSION}/'${PG_VERSION}/g \
-e 's/${PG_BRANCH}/'${PG_BRANCH}/g \
-e 's/${MODE}/'${MODE}/g \
-e 's/${PGPROBACKUP_GDB}/'${PGPROBACKUP_GDB}/g \
Dockerfile.in > Dockerfile
6 changes: 6 additions & 0 deletionstravis/run_tests.sh
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -65,6 +65,12 @@ which pg_config
echo "############### pg_config:"
pg_config

# Show kernel parameters
echo "############### kernel params:"
cat /proc/sys/kernel/yama/ptrace_scope
sudo sysctl kernel.yama.ptrace_scope=0
cat /proc/sys/kernel/yama/ptrace_scope

# Build and install pg_probackup (using PG_CPPFLAGS and SHLIB_LINK for gcov)
echo "############### Compiling and installing pg_probackup:"
# make USE_PGXS=1 PG_CPPFLAGS="-coverage" SHLIB_LINK="-coverage" top_srcdir=$CUSTOM_PG_SRC install
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp