Skip to content

Commit 395fd09

Browse files
authored
Merge branch 'main' into PKG-394-Packaging-tasks-for-release-PXC-8.4.4
2 parents d936e9d + 21dcfab commit 395fd09

File tree

12 files changed

+176
-36
lines changed

12 files changed

+176
-36
lines changed

fluentbit/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ FROM registry.access.redhat.com/ubi9/ubi-minimal AS ubi9
33
LABEL name="Fluent Bit" \
44
description="Fluent Bit docker image" \
55
vendor="Percona" \
6+
maintainer="Percona Development <[email protected]>" \
67
summary="Fluent Bit is a lightweight and high performance log processor" \
78
org.opencontainers.image.authors="[email protected]"
89

percona-pgbackrest/Dockerfile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ FROM redhat/ubi9-minimal
22

33
LABEL org.opencontainers.image.authors="[email protected]"
44

5-
ARG PG_MAJOR=17
5+
ENV PG_VERSION 17.4
6+
ENV PPG_REPO release
67

78
# check repository package signature in secure way
89
RUN set -ex; \
10+
ARCH=$(uname -m) && echo "Architecture is: $ARCH" && \
911
export GNUPGHOME="$(mktemp -d)"; \
1012
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys \
1113
4D1BB29D63D98E422B2113B19334A25F8507EFA5 \
@@ -20,16 +22,16 @@ RUN set -ex; \
2022
${GNUPGHOME}/RPM-GPG-KEY-oracle \
2123
${GNUPGHOME}/RPM-GPG-KEY-centosofficial; \
2224
microdnf install -y findutils yum-utils; \
23-
curl -Lf -o /tmp/oraclelinux-release.rpm https://yum.oracle.com/repo/OracleLinux/OL9/baseos/latest/x86_64/getPackage/oraclelinux-release-el9-1.0-15.el9.x86_64.rpm; \
24-
curl -Lf -o /tmp/epel-release.rpm https://yum.oracle.com/repo/OracleLinux/OL9/baseos/latest/x86_64/getPackage/oracle-epel-release-el9-1.0-1.el9.x86_64.rpm; \
25+
curl -Lf -o /tmp/oraclelinux-release.rpm https://yum.oracle.com/repo/OracleLinux/OL9/baseos/latest/${ARCH}/getPackage/oraclelinux-release-el9-1.0-15.el9.${ARCH}.rpm; \
26+
curl -Lf -o /tmp/epel-release.rpm https://yum.oracle.com/repo/OracleLinux/OL9/baseos/latest/${ARCH}/getPackage/oracle-epel-release-el9-1.0-1.el9.${ARCH}.rpm; \
2527
curl -Lf -o /tmp/percona-release.rpm https://repo.percona.com/yum/percona-release-latest.noarch.rpm; \
2628
rpm --import ${GNUPGHOME}/PERCONA-PACKAGING-KEY ${GNUPGHOME}/RPM-GPG-KEY-oracle ${GNUPGHOME}/RPM-GPG-KEY-centosofficial; \
2729
rpmkeys --checksig /tmp/percona-release.rpm; \
2830
rpmkeys --checksig /tmp/epel-release.rpm; \
2931
rpmkeys --checksig /tmp/oraclelinux-release.rpm; \
3032
rpm -i /tmp/percona-release.rpm /tmp/oraclelinux-release.rpm /tmp/epel-release.rpm; \
3133
rm -rf "$GNUPGHOME" /tmp/percona-release.rpm /tmp/oraclelinux-release.rpm /tmp/epel-release.rpm; \
32-
percona-release enable ppg-${PG_MAJOR} release
34+
percona-release enable ppg-${PG_VERSION} ${PPG_REPO}
3335

3436
RUN set -ex; \
3537
microdnf -y update; \

percona-pgbouncer/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ FROM redhat/ubi9-minimal
22

33
LABEL org.opencontainers.image.authors="[email protected]"
44

5-
ENV PG_VERSION 17.0
6-
ENV PPG_REPO testing
5+
ENV PG_VERSION 17.4
6+
ENV PPG_REPO release
77

88
# check repository package signature in secure way
99
RUN set -ex; \

percona-xtradb-cluster-5.7-backup/lib/pxc/aws.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ is_object_exist() {
1515
local path="$2"
1616

1717
# '--summarize' is included to retrieve the 'Total Objects:' count for checking object/folder existence
18-
res=$(aws $AWS_S3_NO_VERIFY_SSL s3 ls "s3://$bucket/$path" --summarize)
18+
res=$(aws $AWS_S3_NO_VERIFY_SSL s3 ls "s3://$bucket/$path" --summarize --recursive)
1919
if echo "$res" | grep -q 'Total Objects: 0'; then
2020
return 0 # object/folder does not exist
2121
fi

percona-xtradb-cluster-8.0-backup/backup.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,14 @@ function request_streaming() {
8686
--sst "xtrabackup-v2:$LOCAL_IP:4444/xtrabackup_sst//1" \
8787
--recv-script="/usr/bin/run_backup.sh" 2>&1 | tee /tmp/garbd.log
8888

89-
GARB_PID=$!
90-
wait $GARB_PID
91-
EXID_CODE=$?
89+
if grep 'Will never receive state. Need to abort' /tmp/garbd.log; then
90+
exit 1
91+
fi
9292

9393
if grep 'Donor is no longer in the cluster, interrupting script' /tmp/garbd.log; then
9494
exit 1
95+
elif grep 'failed: Invalid argument' /tmp/garbd.log; then
96+
exit 1
9597
fi
9698

9799
if [ -f '/tmp/backup-is-completed' ]; then
@@ -101,12 +103,14 @@ function request_streaming() {
101103

102104
log 'ERROR' 'Backup was finished unsuccessful'
103105

104-
exit $EXID_CODE
106+
exit 1
105107
}
106108

107109
check_ssl
108110
if [ -n "${S3_BUCKET}" ]; then
109111
clean_backup_s3
112+
elif [ -n "$AZURE_CONTAINER_NAME" ]; then
113+
clean_backup_azure
110114
fi
111115
request_streaming
112116

percona-xtradb-cluster-8.0-backup/lib/pxc/aws.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ is_object_exist() {
1515
local path="$2"
1616

1717
# '--summarize' is included to retrieve the 'Total Objects:' count for checking object/folder existence
18-
res=$(aws $AWS_S3_NO_VERIFY_SSL s3 ls "s3://$bucket/$path" --summarize)
18+
res=$(aws $AWS_S3_NO_VERIFY_SSL s3 ls "s3://$bucket/$path" --summarize --recursive)
1919
if echo "$res" | grep -q 'Total Objects: 0'; then
20-
return 0 # object/folder does not exist
20+
return 1 # object/folder does not exist
2121
fi
22-
return 1
22+
return 0
2323
}
2424

2525
s3_add_bucket_dest() {

percona-xtradb-cluster-8.0-backup/lib/pxc/backup.sh

Lines changed: 72 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,39 @@ log() {
2929
clean_backup_s3() {
3030
s3_add_bucket_dest
3131

32-
is_object_exist "$S3_BUCKET" "$S3_BUCKET_PATH.$SST_INFO_NAME" || xbcloud delete ${XBCLOUD_ARGS} --storage=s3 --s3-bucket="$S3_BUCKET" "$S3_BUCKET_PATH.$SST_INFO_NAME"
33-
is_object_exist "$S3_BUCKET" "$S3_BUCKET_PATH/" || xbcloud delete ${XBCLOUD_ARGS} --storage=s3 --s3-bucket="$S3_BUCKET" "$S3_BUCKET_PATH"
32+
local time=15
33+
local is_deleted_full=0
34+
local is_deleted_info=0
35+
local exit_code=0
36+
37+
for i in {1..5}; do
38+
if (( i > 1 )); then
39+
log 'INFO' "Sleeping ${time}s before retry $i..."
40+
sleep "$time"
41+
fi
42+
43+
if is_object_exist "$S3_BUCKET" "$S3_BUCKET_PATH/"; then
44+
log 'INFO' "Delete (attempt $i)..."
45+
46+
xbcloud delete ${XBCLOUD_ARGS} --storage=s3 --s3-bucket="$S3_BUCKET" "$S3_BUCKET_PATH"
47+
else
48+
is_deleted_full=1
49+
fi
50+
51+
if is_object_exist "$S3_BUCKET" "$S3_BUCKET_PATH.$SST_INFO_NAME/"; then
52+
log 'INFO' "Delete (attempt $i)..."
53+
54+
xbcloud delete ${XBCLOUD_ARGS} --storage=s3 --s3-bucket="$S3_BUCKET" "$S3_BUCKET_PATH.$SST_INFO_NAME"
55+
else
56+
is_deleted_info=1
57+
fi
58+
59+
if [[ ${is_deleted_full} == 1 && ${is_deleted_info} == 1 ]]; then
60+
log 'INFO' "Object deleted successfully before attempt $i. Exiting."
61+
break
62+
fi
63+
let time*=2
64+
done
3465
}
3566

3667
azure_auth_header_file() {
@@ -78,7 +109,44 @@ is_object_exist_azure() {
78109
set -x
79110

80111
if [[ ${#res} -ne 0 ]]; then
81-
return 1
112+
return 0
82113
fi
83-
return 0
114+
return 1
84115
}
116+
117+
clean_backup_azure() {
118+
ENDPOINT=${AZURE_ENDPOINT:-"https://$AZURE_STORAGE_ACCOUNT.blob.core.windows.net"}
119+
120+
local time=15
121+
local is_deleted_full=0
122+
local is_deleted_info=0
123+
local exit_code=0
124+
125+
for i in {1..5}; do
126+
if (( i > 1 )); then
127+
log 'INFO' "Sleeping ${time}s before retry $i..."
128+
sleep "$time"
129+
fi
130+
131+
if is_object_exist_azure "$BACKUP_PATH.$SST_INFO_NAME/"; then
132+
log 'INFO' "Delete (attempt $i)..."
133+
xbcloud delete ${XBCLOUD_ARGS} --storage=azure "$BACKUP_PATH.$SST_INFO_NAME"
134+
else
135+
is_deleted_info=1
136+
fi
137+
138+
if is_object_exist_azure "$BACKUP_PATH/"; then
139+
log 'INFO' "Delete (attempt $i)..."
140+
xbcloud delete ${XBCLOUD_ARGS} --storage=azure "$BACKUP_PATH"
141+
else
142+
is_deleted_full=1
143+
fi
144+
145+
if [[ ${is_deleted_full} == 1 && ${is_deleted_info} == 1 ]]; then
146+
log 'INFO' "Object deleted successfully before attempt $i. Exiting."
147+
break
148+
fi
149+
let time*=2
150+
done
151+
}
152+

percona-xtradb-cluster-8.0-backup/run_backup.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,6 @@ backup_azure() {
138138

139139
log 'INFO' "Backup to $ENDPOINT/$AZURE_CONTAINER_NAME/$BACKUP_PATH"
140140

141-
is_object_exist_azure "$BACKUP_PATH.$SST_INFO_NAME/" || xbcloud delete $XBCLOUD_ARGS --storage=azure "$BACKUP_PATH.$SST_INFO_NAME"
142-
is_object_exist_azure "$BACKUP_PATH/" || xbcloud delete $XBCLOUD_ARGS --storage=azure "$BACKUP_PATH"
143-
144141
socat -u "$SOCAT_OPTS" stdio | xbstream -x -C /tmp $XBSTREAM_EXTRA_ARGS &
145142
wait $!
146143
log 'INFO' 'Socat was started'

percona-xtradb-cluster-8.4-backup/backup.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,28 +86,31 @@ function request_streaming() {
8686
--sst "xtrabackup-v2:$LOCAL_IP:4444/xtrabackup_sst//1" \
8787
--recv-script="/usr/bin/run_backup.sh" 2>&1 | tee /tmp/garbd.log
8888

89-
GARB_PID=$!
90-
wait $GARB_PID
91-
EXID_CODE=$?
89+
if grep 'Will never receive state. Need to abort' /tmp/garbd.log; then
90+
exit 1
91+
fi
9292

9393
if grep 'Donor is no longer in the cluster, interrupting script' /tmp/garbd.log; then
9494
exit 1
95+
elif grep 'failed: Invalid argument' /tmp/garbd.log; then
96+
exit 1
9597
fi
9698

97-
9899
if [ -f '/tmp/backup-is-completed' ]; then
99100
log 'INFO' 'Backup was finished successfully'
100101
exit 0
101102
fi
102103

103104
log 'ERROR' 'Backup was finished unsuccessful'
104105

105-
exit $EXID_CODE
106+
exit 1
106107
}
107108

108109
check_ssl
109110
if [ -n "${S3_BUCKET}" ]; then
110111
clean_backup_s3
112+
elif [ -n "$AZURE_CONTAINER_NAME" ]; then
113+
clean_backup_azure
111114
fi
112115
request_streaming
113116

percona-xtradb-cluster-8.4-backup/lib/pxc/aws.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ is_object_exist() {
1515
local path="$2"
1616

1717
# '--summarize' is included to retrieve the 'Total Objects:' count for checking object/folder existence
18-
res=$(aws $AWS_S3_NO_VERIFY_SSL s3 ls "s3://$bucket/$path" --summarize)
18+
res=$(aws $AWS_S3_NO_VERIFY_SSL s3 ls "s3://$bucket/$path" --summarize --recursive)
1919
if echo "$res" | grep -q 'Total Objects: 0'; then
20-
return 0 # object/folder does not exist
20+
return 1 # object/folder does not exist
2121
fi
22-
return 1
22+
return 0
2323
}
2424

2525
s3_add_bucket_dest() {

0 commit comments

Comments
 (0)