mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2024-11-24 08:52:38 +02:00
Merge pull request #483 from japinli/master
Fix comparison unsigned expression
This commit is contained in:
commit
e752b152d7
@ -20,7 +20,15 @@ ulimit -n 1024
|
||||
|
||||
if [ ${DISTRIB} = 'centos' ] ; then
|
||||
sed -i 's|^baseurl=http://|baseurl=https://|g' /etc/yum.repos.d/*.repo
|
||||
if [ ${DISTRIB_VERSION} = '8' ]; then
|
||||
sed -i 's|mirrorlist|#mirrorlist|g' /etc/yum.repos.d/CentOS-*.repo
|
||||
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*.repo
|
||||
fi
|
||||
yum update -y
|
||||
if [ ${DISTRIB_VERSION} = '8' ]; then
|
||||
sed -i 's|mirrorlist|#mirrorlist|g' /etc/yum.repos.d/CentOS-*.repo
|
||||
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*.repo
|
||||
fi
|
||||
fi
|
||||
|
||||
# PACKAGES NEEDED
|
||||
|
@ -15,7 +15,16 @@ PG_TOG=$(echo $PG_VERSION | sed 's|\.||g')
|
||||
|
||||
if [ ${DISTRIB} != 'rhel' -o ${DISTRIB_VERSION} != '7' ]; then
|
||||
# update of rpm package is broken in rhel-7 (26/12/2022)
|
||||
yum update -y
|
||||
#yum update -y
|
||||
if [ ${DISTRIB} = 'centos' -a ${DISTRIB_VERSION} = '8' ]; then
|
||||
sed -i 's|mirrorlist|#mirrorlist|g' /etc/yum.repos.d/CentOS-*.repo
|
||||
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*.repo
|
||||
fi
|
||||
yum update -y
|
||||
if [ ${DISTRIB} = 'centos' -a ${DISTRIB_VERSION} = '8' ]; then
|
||||
sed -i 's|mirrorlist|#mirrorlist|g' /etc/yum.repos.d/CentOS-*.repo
|
||||
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*.repo
|
||||
fi
|
||||
fi
|
||||
# yum upgrade -y || echo 'some packages in docker failed to upgrade'
|
||||
# yum install -y sudo
|
||||
|
@ -15,7 +15,15 @@ PG_TOG=$(echo $PG_VERSION | sed 's|\.||g')
|
||||
|
||||
if [ ${DISTRIB} != 'rhel' -o ${DISTRIB_VERSION} != '7' ]; then
|
||||
# update of rpm package is broken in rhel-7 (26/12/2022)
|
||||
if [ ${DISTRIB} = 'centos' -a ${DISTRIB_VERSION} = '8' ]; then
|
||||
sed -i 's|mirrorlist|#mirrorlist|g' /etc/yum.repos.d/CentOS-*.repo
|
||||
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*.repo
|
||||
fi
|
||||
yum update -y
|
||||
if [ ${DISTRIB} = 'centos' -a ${DISTRIB_VERSION} = '8' ]; then
|
||||
sed -i 's|mirrorlist|#mirrorlist|g' /etc/yum.repos.d/CentOS-*.repo
|
||||
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*.repo
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ${PBK_EDITION} == 'ent' ]; then
|
||||
@ -80,11 +88,13 @@ if [ $PBK_EDITION == 'std' ] ; then
|
||||
|
||||
# install POSTGRESQL
|
||||
# rpm -ivh https://download.postgresql.org/pub/repos/yum/reporpms/EL-${DISTRIB_VERSION}-x86_64/pgdg-redhat-repo-latest.noarch.rpm
|
||||
if [[ ${PG_VERSION} == '11' ]] || [[ ${PG_VERSION} == '12' ]]; then
|
||||
rpm -ivh https://repo.postgrespro.ru/pgpro-${PG_VERSION}/keys/postgrespro-std-${PG_VERSION}.${DISTRIB}.yum-${PG_VERSION}-0.3.noarch.rpm
|
||||
else
|
||||
rpm -ivh https://repo.postgrespro.ru/pgpro-${PG_VERSION}/keys/postgrespro-std-${PG_VERSION}.${DISTRIB}.yum-${PG_VERSION}-0.3.noarch.rpm
|
||||
fi
|
||||
#if [[ ${PG_VERSION} == '11' ]] || [[ ${PG_VERSION} == '12' ]]; then
|
||||
# rpm -ivh https://repo.postgrespro.ru/pgpro-${PG_VERSION}/keys/postgrespro-std-${PG_VERSION}.${DISTRIB}.yum-${PG_VERSION}-0.3.noarch.rpm
|
||||
#else
|
||||
# rpm -ivh https://repo.postgrespro.ru/pgpro-${PG_VERSION}/keys/postgrespro-std-${PG_VERSION}.${DISTRIB}.yum-${PG_VERSION}-0.3.noarch.rpm
|
||||
#fi
|
||||
curl -o pgpro-repo-add.sh https://repo.postgrespro.ru/pgpro-${PG_VERSION}/keys/pgpro-repo-add.sh
|
||||
sh pgpro-repo-add.sh
|
||||
|
||||
if [[ ${PG_VERSION} == '9.6' ]]; then
|
||||
yum install -y postgrespro${PG_TOG}-server.x86_64
|
||||
|
@ -2030,10 +2030,10 @@ get_page_header(FILE *in, const char *fullpath, BackupPageHeader* bph,
|
||||
return false; /* EOF found */
|
||||
else if (read_len != 0 && feof(in))
|
||||
elog(ERROR,
|
||||
"Odd size page found at offset %lu of \"%s\"",
|
||||
"Odd size page found at offset %ld of \"%s\"",
|
||||
ftello(in), fullpath);
|
||||
else
|
||||
elog(ERROR, "Cannot read header at offset %lu of \"%s\": %s",
|
||||
elog(ERROR, "Cannot read header at offset %ld of \"%s\": %s",
|
||||
ftello(in), fullpath, strerror(errno));
|
||||
}
|
||||
|
||||
@ -2321,7 +2321,7 @@ copy_pages(const char *to_fullpath, const char *from_fullpath,
|
||||
elog(ERROR, "Cannot seek to end of file position in destination file \"%s\": %s",
|
||||
to_fullpath, strerror(errno));
|
||||
{
|
||||
size_t pos = ftell(out);
|
||||
long pos = ftell(out);
|
||||
|
||||
if (pos < 0)
|
||||
elog(ERROR, "Cannot get position in destination file \"%s\": %s",
|
||||
|
15
src/delete.c
15
src/delete.c
@ -36,7 +36,7 @@ do_delete(InstanceState *instanceState, time_t backup_id)
|
||||
parray *backup_list,
|
||||
*delete_list;
|
||||
pgBackup *target_backup = NULL;
|
||||
size_t size_to_delete = 0;
|
||||
int64 size_to_delete = 0;
|
||||
char size_to_delete_pretty[20];
|
||||
|
||||
/* Get complete list of backups */
|
||||
@ -682,12 +682,11 @@ do_retention_wal(InstanceState *instanceState, bool dry_run)
|
||||
* at least one backup and no file should be removed.
|
||||
* Unless wal-depth is enabled.
|
||||
*/
|
||||
if ((tlinfo->closest_backup) && instance_config.wal_depth <= 0)
|
||||
if ((tlinfo->closest_backup) && instance_config.wal_depth == 0)
|
||||
continue;
|
||||
|
||||
/* WAL retention keeps this timeline from purge */
|
||||
if (instance_config.wal_depth >= 0 && tlinfo->anchor_tli > 0 &&
|
||||
tlinfo->anchor_tli != tlinfo->tli)
|
||||
if (tlinfo->anchor_tli > 0 && tlinfo->anchor_tli != tlinfo->tli)
|
||||
continue;
|
||||
|
||||
/*
|
||||
@ -701,7 +700,7 @@ do_retention_wal(InstanceState *instanceState, bool dry_run)
|
||||
*/
|
||||
if (tlinfo->oldest_backup)
|
||||
{
|
||||
if (instance_config.wal_depth >= 0 && !(XLogRecPtrIsInvalid(tlinfo->anchor_lsn)))
|
||||
if (!(XLogRecPtrIsInvalid(tlinfo->anchor_lsn)))
|
||||
{
|
||||
delete_walfiles_in_tli(instanceState, tlinfo->anchor_lsn,
|
||||
tlinfo, instance_config.xlog_seg_size, dry_run);
|
||||
@ -714,7 +713,7 @@ do_retention_wal(InstanceState *instanceState, bool dry_run)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (instance_config.wal_depth >= 0 && !(XLogRecPtrIsInvalid(tlinfo->anchor_lsn)))
|
||||
if (!(XLogRecPtrIsInvalid(tlinfo->anchor_lsn)))
|
||||
delete_walfiles_in_tli(instanceState, tlinfo->anchor_lsn,
|
||||
tlinfo, instance_config.xlog_seg_size, dry_run);
|
||||
else
|
||||
@ -942,7 +941,7 @@ delete_walfiles_in_tli(InstanceState *instanceState, XLogRecPtr keep_lsn, timeli
|
||||
join_path_components(wal_fullpath, instanceState->instance_wal_subdir_path, wal_file->file.name);
|
||||
|
||||
/* save segment from purging */
|
||||
if (instance_config.wal_depth >= 0 && wal_file->keep)
|
||||
if (wal_file->keep)
|
||||
{
|
||||
elog(VERBOSE, "Retain WAL segment \"%s\"", wal_fullpath);
|
||||
continue;
|
||||
@ -1027,7 +1026,7 @@ do_delete_status(InstanceState *instanceState, InstanceConfig *instance_config,
|
||||
parray *backup_list, *delete_list;
|
||||
const char *pretty_status;
|
||||
int n_deleted = 0, n_found = 0;
|
||||
size_t size_to_delete = 0;
|
||||
int64 size_to_delete = 0;
|
||||
char size_to_delete_pretty[20];
|
||||
pgBackup *backup;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user