You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2026-05-22 10:15:16 +02:00
Remove double spaces from comments and documentation.
Double spaces have fallen out of favor in recent years because they no longer contribute to readability. We have been using single spaces and editing related paragraphs for some time, but now it seems best to update the remaining instances to avoid churn in unrelated commits and to make it clearer what spacing contributors should use.
This commit is contained in:
@@ -25,7 +25,7 @@ use constant BUILD_AUTO_H => 'build.au
|
||||
push @EXPORT, qw(BUILD_AUTO_H);
|
||||
|
||||
####################################################################################################################################
|
||||
# Save contents to a file if the file is missing or the contents are different. This saves write IO and prevents the timestamp from
|
||||
# Save contents to a file if the file is missing or the contents are different. This saves write IO and prevents the timestamp from
|
||||
# changing.
|
||||
####################################################################################################################################
|
||||
sub buildPutDiffers
|
||||
|
||||
@@ -457,8 +457,8 @@ sub coverageGenerate
|
||||
$strFile = substr($strLine, 3);
|
||||
$rhCoverage->{$strFile} = undef;
|
||||
|
||||
# Generate a random anchor so new reports will not show links as already followed. This is also an easy way
|
||||
# to create valid, disambiguos links.
|
||||
# Generate a random anchor so new reports will not show links as already followed. This is also an easy way to
|
||||
# create valid, disambiguos links.
|
||||
$rhCoverage->{$strFile}{anchor} = sha1_hex(rand(16));
|
||||
}
|
||||
# Mark functions as initially covered
|
||||
|
||||
@@ -100,7 +100,7 @@ sub read
|
||||
$iRemainingSize -= $iReadSize;
|
||||
}
|
||||
|
||||
# If this is a blocking read then loop until all bytes have been read, else error. If not blocking read until the request size
|
||||
# If this is a blocking read then loop until all bytes have been read, else error. If not blocking read until the request size
|
||||
# has been met or EOF.
|
||||
my $fTimeStart = gettimeofday();
|
||||
my $fRemaining = $self->timeout();
|
||||
@@ -264,7 +264,7 @@ sub handleReadSet
|
||||
$self->{oReadSelect} = IO::Select->new();
|
||||
$self->{oReadSelect}->add($self->handleRead());
|
||||
|
||||
# Check if the read handle has a pending method. This should be checked before can_read for SSL sockets.
|
||||
# Check if the read handle has a pending method. This should be checked before can_read for SSL sockets.
|
||||
$self->{bPending} = defined($fhRead) && $fhRead->can('pending') ? true : false;
|
||||
}
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ sub testListGet
|
||||
# Skip this test if it is performance and no performance is specified
|
||||
next if ($bNoPerformance && $hTest->{&TESTDEF_TYPE} eq TESTDEF_PERFORMANCE);
|
||||
|
||||
# Skip this test if it is not C and vm=none. Perl tests require Docker which is not supported.
|
||||
# Skip this test if it is not C and vm=none. Perl tests require Docker which is not supported.
|
||||
next if ($strVm eq VM_NONE && !$hTest->{&TESTDEF_C});
|
||||
|
||||
# Skip this test if a container is required and vm=none.
|
||||
@@ -128,7 +128,7 @@ sub testListGet
|
||||
($strDbVersion ne 'all' &&
|
||||
$strDbVersion eq ${$$oyVm{$strTestOS}{&VM_DB_TEST}}[$iDbVersionIdx]))
|
||||
{
|
||||
# Individual tests will be each be run in a separate container. This is the default.
|
||||
# Individual tests will be each be run in a separate container. This is the default.
|
||||
my $bTestIndividual =
|
||||
!defined($hTest->{&TESTDEF_INDIVIDUAL}) || $hTest->{&TESTDEF_INDIVIDUAL} ? true : false;
|
||||
|
||||
|
||||
@@ -35,8 +35,8 @@ use constant BOGUS => 'bogus';
|
||||
push @EXPORT, qw(BOGUS);
|
||||
|
||||
####################################################################################################################################
|
||||
# The current test run that is executing. Only a single run should ever occur in a process to prevent various cleanup issues from
|
||||
# affecting the next run. Of course multiple subtests can be executed in a single run.
|
||||
# The current test run that is executing. Only a single run should ever occur in a process to prevent various cleanup issues from
|
||||
# affecting the next run. Of course multiple subtests can be executed in a single run.
|
||||
####################################################################################################################################
|
||||
my $oTestRun;
|
||||
my $oStorage;
|
||||
|
||||
@@ -697,7 +697,7 @@ sub owner
|
||||
my $iUserId;
|
||||
my $iGroupId;
|
||||
|
||||
# If the user or group is not defined then get it by stat'ing the file. This is because the chown function requires that
|
||||
# If the user or group is not defined then get it by stat'ing the file. This is because the chown function requires that
|
||||
# both user and group be set.
|
||||
my $oStat = $self->info($strFilePath);
|
||||
|
||||
|
||||
@@ -344,7 +344,7 @@ sub vmValid
|
||||
push @EXPORT, qw(vmValid);
|
||||
|
||||
####################################################################################################################################
|
||||
# Which vm to use for the test matrix. If one of the standard four, then use that, else use VM4.
|
||||
# Which vm to use for the test matrix. If one of the standard four, then use that, else use VM4.
|
||||
####################################################################################################################################
|
||||
sub vmTest
|
||||
{
|
||||
|
||||
@@ -464,7 +464,7 @@ sub backupEnd
|
||||
}
|
||||
}
|
||||
}
|
||||
# Else there should not be a tablespace directory at all. This is only valid for storage that supports links.
|
||||
# Else there should not be a tablespace directory at all. This is only valid for storage that supports links.
|
||||
elsif (storageRepo()->capability(STORAGE_CAPABILITY_LINK) &&
|
||||
storageTest()->pathExists(
|
||||
$self->repoBackupPath("${strBackup}/" . MANIFEST_TARGET_PGDATA . '/' . DB_PATH_PGTBLSPC)))
|
||||
@@ -1258,7 +1258,7 @@ sub configCreate
|
||||
$oParamHash{$strStanza}{'pg256-host-key-file'} = testRunGet()->basePath() . HOST_CLIENT_KEY;
|
||||
}
|
||||
|
||||
# Only test explicit ports on the backup server. This is so locally configured ports are also tested.
|
||||
# Only test explicit ports on the backup server. This is so locally configured ports are also tested.
|
||||
if (!$self->synthetic() && $self->nameTest(HOST_BACKUP))
|
||||
{
|
||||
$oParamHash{$strStanza}{"pg256-port"} = $oHostDb2->pgPort();
|
||||
@@ -1371,8 +1371,8 @@ sub configUpdate
|
||||
####################################################################################################################################
|
||||
# manifestMunge
|
||||
#
|
||||
# Allows for munging of the manifest while making it appear to be valid. This is used to create various error conditions that
|
||||
# should be caught by the unit tests.
|
||||
# Allows for munging of the manifest while making it appear to be valid. This is used to create various error conditions that should
|
||||
# be caught by the unit tests.
|
||||
####################################################################################################################################
|
||||
sub manifestMunge
|
||||
{
|
||||
|
||||
@@ -855,12 +855,12 @@ sub build
|
||||
$strManifestType = MANIFEST_VALUE_PATH;
|
||||
}
|
||||
|
||||
# Skip wal directory when doing an online backup. WAL will be restored from the archive or stored in the wal directory at
|
||||
# Skip wal directory when doing an online backup. WAL will be restored from the archive or stored in the wal directory at
|
||||
# the end of the backup if the archive-copy option is set.
|
||||
next if ($bOnline && $strFile =~ (qw{^} . MANIFEST_TARGET_PGDATA . qw{/} . $self->walPath() . '\/') &&
|
||||
$strFile !~ ('^' . MANIFEST_TARGET_PGDATA . qw{/} . $self->walPath() . qw{/} . DB_PATH_ARCHIVESTATUS . '$'));
|
||||
|
||||
# Skip all directories and files that start with pgsql_tmp. The files are removed when the server is restarted and the
|
||||
# Skip all directories and files that start with pgsql_tmp. The files are removed when the server is restarted and the
|
||||
# directories are recreated.
|
||||
next if $strName =~ ('(^|\/)' . DB_FILE_PREFIX_TMP);
|
||||
|
||||
@@ -1090,9 +1090,9 @@ sub build
|
||||
{
|
||||
my $bTimeInFuture = false;
|
||||
|
||||
# Wait for the remainder of the second when doing online backups. This is done because most filesystems only have a one
|
||||
# Wait for the remainder of the second when doing online backups. This is done because most filesystems only have a one
|
||||
# second resolution and Postgres will still be modifying files during the second that the manifest is built and this could
|
||||
# lead to an invalid diff/incr backup later when using timestamps to determine which files have changed. Offline backups do
|
||||
# lead to an invalid diff/incr backup later when using timestamps to determine which files have changed. Offline backups do
|
||||
# not wait because it makes testing much faster and Postgres should not be running (if it is the backup will not be
|
||||
# consistent anyway and the one-second resolution problem is the least of our worries).
|
||||
my $lTimeBegin = waitRemainder($bOnline);
|
||||
@@ -1223,7 +1223,7 @@ sub build
|
||||
# fileAdd
|
||||
#
|
||||
# Add files to the manifest that were generated after the initial manifest build, e.g. backup_label, tablespace_map, and copied WAL
|
||||
# files. Since the files were not in the original cluster the user, group, and mode must be defaulted.
|
||||
# files. Since the files were not in the original cluster the user, group, and mode must be defaulted.
|
||||
####################################################################################################################################
|
||||
sub fileAdd
|
||||
{
|
||||
@@ -1352,7 +1352,7 @@ sub validate
|
||||
# Assign function parameters, defaults, and log debug info
|
||||
my ($strOperation) = logDebugParam(__PACKAGE__ . 'validate');
|
||||
|
||||
# Make sure that all files have size and checksum (when size > 0). Since these values are removed before the backup file copy
|
||||
# Make sure that all files have size and checksum (when size > 0). Since these values are removed before the backup file copy
|
||||
# starts this ensures that all files had results stored in the manifest during the file copy.
|
||||
foreach my $strFile ($self->keys(MANIFEST_SECTION_TARGET_FILE))
|
||||
{
|
||||
|
||||
@@ -152,10 +152,10 @@ sub backupLabel
|
||||
# Create backup label
|
||||
my $strBackupLabel = backupLabelFormat($strType, $strBackupLabelLast, $lTimestampStart);
|
||||
|
||||
# Make sure that the timestamp has not already been used by a prior backup. This is unlikely for online backups since there is
|
||||
# Make sure that the timestamp has not already been used by a prior backup. This is unlikely for online backups since there is
|
||||
# already a wait after the manifest is built but it's still possible if the remote and local systems don't have synchronized
|
||||
# clocks. In practice this is most useful for making offline testing faster since it allows the wait after manifest build to
|
||||
# be skipped by dealing with any backup label collisions here.
|
||||
# clocks. In practice this is most useful for making offline testing faster since it allows the wait after manifest build to be
|
||||
# skipped by dealing with any backup label collisions here.
|
||||
if ($oStorageRepo->list(
|
||||
$strRepoBackupPath,
|
||||
{strExpression =>
|
||||
@@ -233,7 +233,7 @@ sub run
|
||||
{bHostBackup => $bRemote, bTls => $bTls, strStorage => $strStorage, bRepoEncrypt => $bEncrypt,
|
||||
strCompressType => NONE});
|
||||
|
||||
# If S3 set process max to 2. This seems like the best place for parallel testing since it will help speed S3 processing
|
||||
# If S3 set process max to 2. This seems like the best place for parallel testing since it will help speed S3 processing
|
||||
# without slowing down the other tests too much.
|
||||
if ($strStorage eq S3)
|
||||
{
|
||||
@@ -435,7 +435,7 @@ sub run
|
||||
$oHostDbPrimary->dbFileCreate(\%oManifest, MANIFEST_TARGET_PGDATA, 'base/32768/t333_44000', 'IGNORE');
|
||||
}
|
||||
|
||||
# Help and Version. These have complete unit tests, so here just make sure there is output from the command line.
|
||||
# Help and Version. These have complete unit tests, so here just make sure there is output from the command line.
|
||||
#---------------------------------------------------------------------------------------------------------------------------
|
||||
if ($self->runCurrent() == 1)
|
||||
{
|
||||
@@ -1088,7 +1088,7 @@ sub run
|
||||
$oManifest{&MANIFEST_SECTION_BACKUP_TARGET}{'pg_tblspc/2'}{&MANIFEST_SUBKEY_PATH} = '../../tablespace/ts2';
|
||||
$oManifest{&MANIFEST_SECTION_TARGET_LINK}{'pg_data/pg_tblspc/2'}{&MANIFEST_SUBKEY_DESTINATION} = '../../tablespace/ts2';
|
||||
|
||||
# Dump out history path at the end to verify all history files are being recorded. This test is only performed locally
|
||||
# Dump out history path at the end to verify all history files are being recorded. This test is only performed locally
|
||||
# because for some reason sort order is different when this command is executed via ssh (even though the content of the
|
||||
# directory is identical).
|
||||
#---------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -101,7 +101,7 @@ sub run
|
||||
' --reset-pg2-path' :
|
||||
'';
|
||||
|
||||
# If S3 set process max to 2. This seems like the best place for parallel testing since it will help speed S3 processing
|
||||
# If S3 set process max to 2. This seems like the best place for parallel testing since it will help speed S3 processing
|
||||
# without slowing down the other tests too much.
|
||||
if ($strStorage eq S3)
|
||||
{
|
||||
@@ -233,8 +233,8 @@ sub run
|
||||
# Enabled async archiving
|
||||
$oHostBackup->configUpdate({&CFGDEF_SECTION_GLOBAL => {'archive-async' => 'y'}});
|
||||
|
||||
# Kick out a bunch of archive logs to exercise async archiving. Only do this when compressed and remote to slow it
|
||||
# down enough to make it evident that the async process is working.
|
||||
# Kick out a bunch of archive logs to exercise async archiving. Only do this when compressed and remote to slow it down
|
||||
# enough to make it evident that the async process is working.
|
||||
if ($strCompressType ne NONE && $strBackupDestination eq HOST_BACKUP)
|
||||
{
|
||||
&log(INFO, ' multiple wal switches to exercise async archiving');
|
||||
@@ -417,8 +417,8 @@ sub run
|
||||
'insert into test1_zeroed values (1);',
|
||||
{strDb => 'test1', bAutoCommit => true});
|
||||
|
||||
# Start a backup so the next backup has to restart it. This test is not required for PostgreSQL >= 9.6 since backups
|
||||
# are run in non-exclusive mode.
|
||||
# Start a backup so the next backup has to restart it. This test is not required for PostgreSQL >= 9.6 since backups are run
|
||||
# in non-exclusive mode.
|
||||
if ($oHostDbPrimary->pgVersion() >= PG_VERSION_93 && $oHostDbPrimary->pgVersion() < PG_VERSION_96)
|
||||
{
|
||||
$oHostDbPrimary->sqlSelectOne("select pg_start_backup('test backup that will cause an error', true)");
|
||||
@@ -521,8 +521,8 @@ sub run
|
||||
# Test that the first database has not been restored since --db-include did not include test1
|
||||
my ($strSHA1, $lSize) = storageTest()->hashSize($strDb1TablePath);
|
||||
|
||||
# Create a zeroed sparse file in the test directory that is the same size as the filenode.map. We need to use the
|
||||
# posix driver directly to do this because handles cannot be passed back from the C code.
|
||||
# Create a zeroed sparse file in the test directory that is the same size as the filenode.map. We need to use the posix
|
||||
# driver directly to do this because handles cannot be passed back from the C code.
|
||||
my $oStorageTrunc = new pgBackRestTest::Common::Storage($self->testPath(), new pgBackRestTest::Common::StoragePosix());
|
||||
|
||||
my $strTestTable = $self->testPath() . "/testtable";
|
||||
@@ -575,8 +575,8 @@ sub run
|
||||
confess &log(ASSERT, "no files found in tablespace path '${strTablespacePath}'");
|
||||
}
|
||||
|
||||
# This table should exist to prove that the tablespace was restored. It has not been updated since it was created so it
|
||||
# should not be created by any full page writes. Once it is verified to exist it can be dropped.
|
||||
# This table should exist to prove that the tablespace was restored. It has not been updated since it was created so it
|
||||
# should not be created by any full page writes. Once it is verified to exist it can be dropped.
|
||||
$oHostDbPrimary->sqlSelectOneTest("select count(*) from test_exists", 0);
|
||||
$oHostDbPrimary->sqlExecute('drop table test_exists');
|
||||
|
||||
@@ -713,9 +713,9 @@ sub run
|
||||
|
||||
$oHostDbPrimary->clusterStop();
|
||||
|
||||
# The timeline to use for this test is subject to change based on tests being added or removed above. The best thing
|
||||
# would be to automatically grab the timeline after the restore, but since this test has been stable for a long time
|
||||
# it does not seem worth the effort to automate.
|
||||
# The timeline to use for this test is subject to change based on tests being added or removed above. The best thing would
|
||||
# be to automatically grab the timeline after the restore, but since this test has been stable for a long time it does not
|
||||
# seem worth the effort to automate.
|
||||
$oHostDbPrimary->restore(
|
||||
undef, $strIncrBackup,
|
||||
{bDelta => true, strType => CFGOPTVAL_RESTORE_TYPE_STANDBY, strTargetTimeline => 4, iRepo => $iRepoTotal});
|
||||
|
||||
Reference in New Issue
Block a user