Skip to content

Fix comparison unsigned expression #483

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions packaging/pkg/scripts/rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 10 additions & 1 deletion packaging/test/scripts/rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 15 additions & 5 deletions packaging/test/scripts/rpm_forks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/data.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down Expand Up @@ -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",
Expand Down
15 changes: 7 additions & 8 deletions src/delete.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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;

/*
Expand All @@ -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);
Expand All @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down