mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-01-18 04:58:51 +02:00
1ad67644da
After a file is copied during backup the size is requested from the storage in case it differs from what was written so that repo-size can be reported accurately. This is useful for situations where compression is being done by the filesystem (e.g. ZFS) and what is stored can differ in size from what was written. In S3 the reported size will always be exactly what was written so there is no need to check the size and doing so immediately can cause problems because the new file might not appear in list commands. This has not been observed on S3 (though it seems to be possible) but it has been reported on the Swift S3 gateway. Add a driver capability to determine if size needs to be called after a file is written and if not then simply use the number of bytes written for repo-size. Reported by Matt Kunkel.
56 lines
2.1 KiB
Perl
56 lines
2.1 KiB
Perl
####################################################################################################################################
|
|
# CIFS Storage Driver
|
|
#
|
|
# Implements storage functions for Posix-compliant file systems.
|
|
####################################################################################################################################
|
|
package pgBackRest::Storage::Cifs::Driver;
|
|
use parent 'pgBackRest::Storage::Posix::Driver';
|
|
|
|
use strict;
|
|
use warnings FATAL => qw(all);
|
|
use Carp qw(confess);
|
|
use English '-no_match_vars';
|
|
|
|
use Exporter qw(import);
|
|
our @EXPORT = qw();
|
|
|
|
use pgBackRest::Common::Log;
|
|
use pgBackRest::Storage::Base;
|
|
|
|
####################################################################################################################################
|
|
# Package name constant
|
|
####################################################################################################################################
|
|
use constant STORAGE_CIFS_DRIVER => __PACKAGE__;
|
|
push @EXPORT, qw(STORAGE_CIFS_DRIVER);
|
|
|
|
####################################################################################################################################
|
|
# pathSync - CIFS does not support path sync so this is a noop
|
|
####################################################################################################################################
|
|
sub pathSync
|
|
{
|
|
my $self = shift;
|
|
|
|
# Assign function parameters, defaults, and log debug info
|
|
my
|
|
(
|
|
$strOperation,
|
|
$strPath,
|
|
) =
|
|
logDebugParam
|
|
(
|
|
__PACKAGE__ . '->pathSync', \@_,
|
|
{name => 'strPath', trace => true},
|
|
);
|
|
|
|
# Return from function and log return values if any
|
|
return logDebugReturn($strOperation);
|
|
}
|
|
|
|
####################################################################################################################################
|
|
# Getters/Setters
|
|
####################################################################################################################################
|
|
sub capability {shift eq STORAGE_CAPABILITY_SIZE_DIFF ? true : false}
|
|
sub className {STORAGE_CIFS_DRIVER}
|
|
|
|
1;
|