checksums-fixes.patch
text/x-patch
Filename: checksums-fixes.patch
Type: text/x-patch
Part: 0
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: unified
| File | + | − |
|---|---|---|
| src/test/modules/Makefile | 1 | 0 |
| src/test/modules/test_checksums/Makefile | 12 | 8 |
| src/test/modules/test_checksums/t/006_concurrent_pgbench.pl | 22 | 9 |
diff --git a/src/test/modules/Makefile b/src/test/modules/Makefile
index 903a8ac151a..c8f2747b261 100644
--- a/src/test/modules/Makefile
+++ b/src/test/modules/Makefile
@@ -17,6 +17,7 @@ SUBDIRS = \
test_aio \
test_binaryheap \
test_bloomfilter \
+ test_checksums \
test_copy_callbacks \
test_custom_rmgrs \
test_ddl_deparse \
diff --git a/src/test/modules/test_checksums/Makefile b/src/test/modules/test_checksums/Makefile
index b9136bb513f..a5b6259a728 100644
--- a/src/test/modules/test_checksums/Makefile
+++ b/src/test/modules/test_checksums/Makefile
@@ -9,28 +9,32 @@
#
#-------------------------------------------------------------------------
-subdir = src/test/checksum
-top_builddir = ../../..
-include $(top_builddir)/src/Makefile.global
-
EXTRA_INSTALL = src/test/modules/injection_points
export enable_injection_points
MODULE_big = test_checksums
OBJS = \
- $(WIN32RES)
+ $(WIN32RES) \
test_checksums.o
PGFILEDESC = "test_checksums - test code for data checksums"
EXTENSION = test_checksums
DATA = test_checksums--1.0.sql
+ifdef USE_PGXS
+PG_CONFIG = pg_config
+PGXS := $(shell $(PG_CONFIG) --pgxs)
+include $(PGXS)
+else
+subdir = src/test/modules/test_checksums
+top_builddir = ../../../..
+include $(top_builddir)/src/Makefile.global
+include $(top_srcdir)/contrib/contrib-global.mk
+endif
+
check:
$(prove_check)
installcheck:
$(prove_installcheck)
-
-clean distclean maintainer-clean:
- rm -rf tmp_check
diff --git a/src/test/modules/test_checksums/t/006_concurrent_pgbench.pl b/src/test/modules/test_checksums/t/006_concurrent_pgbench.pl
index 630abee9c63..364225933ca 100644
--- a/src/test/modules/test_checksums/t/006_concurrent_pgbench.pl
+++ b/src/test/modules/test_checksums/t/006_concurrent_pgbench.pl
@@ -36,21 +36,31 @@ if (!$ENV{PG_TEST_EXTRA} || $ENV{PG_TEST_EXTRA} !~ /\bchecksum_extended\b/)
plan skip_all => 'Extended tests not enabled';
}
-if ($ENV{enable_injection_points} ne 'yes')
+# Start a pgbench run in the background against the server specified via the
+# port passed as parameter
+sub background_ro_pgbench
{
- plan skip_all => 'Injection points not supported by this build';
+ my ($port, $readonly, $stdin, $stdout, $stderr) = @_;
+
+ my $pgbench_primary = IPC::Run::start(
+ [
+ 'pgbench', '-p', $port, '-S',
+ '-T', '600', '-c', '10', 'postgres'
+ ],
+ '<' => \$stdin,
+ '>' => \$stdout,
+ '2>' => \$stderr,
+ IPC::Run::timer($PostgreSQL::Test::Utils::timeout_default));
}
-# Start a pgbench run in the background against the server specified via the
-# port passed as parameter
-sub background_pgbench
+sub background_rw_pgbench
{
my ($port, $readonly, $stdin, $stdout, $stderr) = @_;
my $pgbench_primary = IPC::Run::start(
[
- 'pgbench', '-p', $port, ($readonly == 1 ? '-S' : ''),
- '-T', '600', '-c', '10', '-q', 'postgres'
+ 'pgbench', '-p', $port,
+ '-T', '600', '-c', '10', 'postgres'
],
'<' => \$stdin,
'>' => \$stdout,
@@ -141,6 +151,7 @@ for (my $i = 1; $i <= 100; $i++)
# they are caught up and in sync.
$node_primary = PostgreSQL::Test::Cluster->new('main');
$node_primary->init(allows_streaming => 1, no_data_checksums => 1);
+$node_primary->append_conf('postgresql.conf', "max_connections = 30");
$node_primary->start;
$node_primary->safe_psql('postgres', 'CREATE EXTENSION test_checksums;');
# Create some content to have un-checksummed data in the cluster
@@ -177,15 +188,17 @@ for (my $i = 0; $i < $TEST_ITERATIONS; $i++)
# Start a pgbench in the background against the primary
my ($pgb_primary_stdin, $pgb_primary_stdout, $pgb_primary_stderr) =
('', '', '');
- background_pgbench($node_primary->port, 0, $pgb_primary_stdin,
+ background_rw_pgbench($node_primary->port, 0, $pgb_primary_stdin,
$pgb_primary_stdout, $pgb_primary_stderr);
# Start a select-only pgbench in the background on the standby
my ($pgb_standby_1_stdin, $pgb_standby_1_stdout,
$pgb_standby_1_stderr)
= ('', '', '');
- background_pgbench($node_standby_1->port, 1, $pgb_standby_1_stdin,
+ background_ro_pgbench($node_standby_1->port, 1, $pgb_standby_1_stdin,
$pgb_standby_1_stdout, $pgb_standby_1_stderr);
+
+ $pgbench_running = 1;
}
$node_primary->safe_psql('postgres', "UPDATE t SET a = a + 1;");