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

Commite7d0cf4

Browse files
committed
Allow TAP tests to force checksums off when calling init()
TAP tests can write $node->init(no_data_checksums => 1);to initialize a cluster explicitly without checksums. Currently, thisis the default, but this change allows running all tests withchecksums enabled, like PG_TEST_INITDB_EXTRA_OPTS=--data-checksums meson test ...And this also prepares the tests for when we switch the default tochecksums enabled.The pg_checksums tests need to disable checksums so it can test itsown functionality of enabling checksums. The amcheck/pg_amcheck testsneed to disable checksums because they manually introduce corruptionthat they want to detect, but with checksums enabled, the checksumverification will fail before they even get to their work.Author: Greg Sabino Mullane <greg@turnstep.com>Reviewed-by: Nathan Bossart <nathandbossart@gmail.com>Reviewed-by: Peter Eisentraut <peter@eisentraut.org>Discussion:https://www.postgresql.org/message-id/flat/CAKAnmmKwiMHik5AHmBEdf5vqzbOBbcwEPHo4-PioWeAbzwcTOQ@mail.gmail.com
1 parent199ad00 commite7d0cf4

File tree

5 files changed

+12
-4
lines changed

5 files changed

+12
-4
lines changed

‎contrib/amcheck/t/001_verify_heapam.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# Test set-up
1616
#
1717
$node = PostgreSQL::Test::Cluster->new('test');
18-
$node->init;
18+
$node->init(no_data_checksums=> 1);
1919
$node->append_conf('postgresql.conf','autovacuum=off');
2020
$node->start;
2121
$node->safe_psql('postgres',q(CREATE EXTENSION amcheck));

‎src/bin/pg_amcheck/t/003_check.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ ()
120120

121121
# Test set-up
122122
$node = PostgreSQL::Test::Cluster->new('test');
123-
$node->init;
123+
$node->init(no_data_checksums=> 1);
124124
$node->append_conf('postgresql.conf','autovacuum=off');
125125
$node->start;
126126
$port =$node->port;

‎src/bin/pg_amcheck/t/004_verify_heapam.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ sub write_tuple
181181
# autovacuum workers visiting the table could crash the backend.
182182
# Disable autovacuum so that won't happen.
183183
my$node = PostgreSQL::Test::Cluster->new('test');
184-
$node->init;
184+
$node->init(no_data_checksums=> 1);
185185
$node->append_conf('postgresql.conf','autovacuum=off');
186186
$node->append_conf('postgresql.conf','max_prepared_transactions=10');
187187

‎src/bin/pg_checksums/t/002_actions.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ sub check_relation_corruption
8888

8989
# Initialize node with checksums disabled.
9090
my$node = PostgreSQL::Test::Cluster->new('node_checksum');
91-
$node->init();
91+
$node->init(no_data_checksums=> 1);
9292
my$pgdata =$node->data_dir;
9393

9494
# Control file should know that checksums are disabled.

‎src/test/perl/PostgreSQL/Test/Cluster.pm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,8 @@ On Windows, we use SSPI authentication to ensure the same (by pg_regress
586586
WAL archiving can be enabled on this node by passing the keyword parameter
587587
has_archiving => 1. This is disabled by default.
588588
589+
Data checksums can be forced off by passing no_data_checksums => 1.
590+
589591
postgresql.conf can be set up for replication by passing the keyword
590592
parameter allows_streaming => 'logical' or 'physical' (passing 1 will also
591593
suffice for physical replication) depending on type of replication that
@@ -618,6 +620,12 @@ sub init
618620
push @{$params{extra} }, shellwords($initdb_extra_opts_env);
619621
}
620622

623+
# This should override user-supplied initdb options.
624+
if ($params{no_data_checksums})
625+
{
626+
push @{$params{extra} },'--no-data-checksums';
627+
}
628+
621629
mkdir$self->backup_dir;
622630
mkdir$self->archive_dir;
623631

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp