mirror of
https://github.com/zebrajr/postgres.git
synced 2025-12-07 12:20:31 +01:00
This complies with the perlcritic policy Subroutines::RequireFinalReturn, which is a severity 4 policy. Since we only currently check at severity level 5, the policy is raised to that level until we move to level 4 or lower, so that any new infringements will be caught. A small cosmetic piece of tidying of the pgperlcritic script is included. Mike Blackwell Discussion: https://postgr.es/m/CAESHdJpfFm_9wQnQ3koY3c91FoRQsO-fh02za9R3OEMndOn84A@mail.gmail.com
64 lines
1.3 KiB
Perl
64 lines
1.3 KiB
Perl
use strict;
|
|
use warnings;
|
|
use TestLib;
|
|
use Test::More tests => 6;
|
|
|
|
use RewindTest;
|
|
|
|
sub run_test
|
|
{
|
|
my $test_mode = shift;
|
|
|
|
RewindTest::setup_cluster($test_mode, ['-g']);
|
|
RewindTest::start_master();
|
|
|
|
# Create a database in master.
|
|
master_psql('CREATE DATABASE inmaster');
|
|
|
|
RewindTest::create_standby($test_mode);
|
|
|
|
# Create another database, the creation is replicated to the standby
|
|
master_psql('CREATE DATABASE beforepromotion');
|
|
|
|
RewindTest::promote_standby();
|
|
|
|
# Create databases in the old master and the new promoted standby.
|
|
master_psql('CREATE DATABASE master_afterpromotion');
|
|
standby_psql('CREATE DATABASE standby_afterpromotion');
|
|
|
|
# The clusters are now diverged.
|
|
|
|
RewindTest::run_pg_rewind($test_mode);
|
|
|
|
# Check that the correct databases are present after pg_rewind.
|
|
check_query(
|
|
'SELECT datname FROM pg_database ORDER BY 1',
|
|
qq(beforepromotion
|
|
inmaster
|
|
postgres
|
|
standby_afterpromotion
|
|
template0
|
|
template1
|
|
),
|
|
'database names');
|
|
|
|
# Permissions on PGDATA should have group permissions
|
|
SKIP:
|
|
{
|
|
skip "unix-style permissions not supported on Windows", 1
|
|
if ($windows_os);
|
|
|
|
ok(check_mode_recursive($node_master->data_dir(), 0750, 0640),
|
|
'check PGDATA permissions');
|
|
}
|
|
|
|
RewindTest::clean_rewind_test();
|
|
return;
|
|
}
|
|
|
|
# Run the test in both modes.
|
|
run_test('local');
|
|
run_test('remote');
|
|
|
|
exit(0);
|