Skip to content

Commit eb4f049

Browse files
committed
fixes for upgrade bugs
1 parent f550ee1 commit eb4f049

3 files changed

Lines changed: 10 additions & 63 deletions

File tree

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ PACKAGER ?= dnf
1616
BUILD ?= 1
1717
IMAGE_TAG ?= $(BASEOS)-$(PGVERSION_FULL)-$(BUILD)
1818
POSTGIS_IMAGE_TAG ?= $(BASEOS)-$(PGVERSION_FULL)-$(POSTGIS_VERSION)-$(BUILD)
19+
ARCH ?= amd64
1920

2021
# Settings for the Build-Process
2122
BUILDWITH ?= docker
@@ -76,7 +77,8 @@ postgres-build:
7677
--build-arg PGBACKREST_VERSION=$(PGBACKREST_VERSION) \
7778
--build-arg PATRONI_VERSION=$(PATRONI_VERSION) \
7879
--build-arg OLD_PG_VERSIONS="$(OLD_PG_VERSIONS)" \
79-
--build-arg PGVERSION=$(PGVERSION)
80+
--build-arg PGVERSION=$(PGVERSION) \
81+
--build-arg ARCH=$(ARCH)
8082

8183
postgres: postgres-build
8284

docker/postgres/Dockerfile

Lines changed: 6 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ ARG PG_SUPPORTED_VERSIONS="$PGVERSION"
1515
ARG PG_SUPPORTED_VERSIONS="$OLD_PG_VERSIONS $PGVERSION"
1616
ARG TIMESCALEDB="1.7.5 2.3.1 2.13.0"
1717
ARG ARCH
18+
1819
# Spilo-specific
1920
ENV SET_USER=REL3_0_0 \
2021
PLPROFILER=REL4_1 \
@@ -25,46 +26,7 @@ ENV SET_USER=REL3_0_0 \
2526
PG_TM_AUX_COMMIT=6c012d38a4c1b0ba4a36952d60b0ce3a22ac9c3d
2627

2728
# Get some Standard-Stuff
28-
RUN if [ "$BASEOS" = "ubi8" ] ; then \
29-
${PACKAGER} -y update && ${PACKAGER} -y install --nodocs --noplugins --setopt=install_weak_deps=0 \
30-
--setopt=skip_missing_names_on_install=False \
31-
openssh-clients \
32-
openssh-server \
33-
shadow-utils \
34-
tar \
35-
bzip2 \
36-
lz4 \
37-
python3 \
38-
python3-pip \
39-
python3-psycopg2 \
40-
# python3-psutil \
41-
# python3-requests \
42-
# python3-etcd \
43-
# python3-pyyaml \
44-
# python3-setuptools \
45-
git \
46-
patchutils \
47-
binutils \
48-
make \
49-
cmake \
50-
gcc \
51-
pam-devel \
52-
wget \
53-
mlocate \
54-
git-clang-format \
55-
openssl-devel \
56-
ccache \
57-
redhat-rpm-config \
58-
krb5-devel \
59-
busybox \
60-
jq \
61-
rsync \
62-
dumb-init \
63-
libicu \
64-
pgbackrest-${PGBACKREST_VERSION} \
65-
&& ${PACKAGER} -y clean all ; \
66-
else \
67-
${PACKAGER} -y update && ${PACKAGER} -y install --nodocs --noplugins --setopt=install_weak_deps=0 \
29+
RUN ${PACKAGER} -y update && ${PACKAGER} -y install --nodocs --noplugins --setopt=install_weak_deps=0 \
6830
--setopt=skip_missing_names_on_install=False \
6931
openssh-clients \
7032
openssh-server \
@@ -75,11 +37,6 @@ else \
7537
python3 \
7638
python3-pip \
7739
python3-psycopg2 \
78-
# python3-psutil \
79-
# python3-requests \
80-
# python3-etcd \
81-
# python3-pyyaml \
82-
# python3-setuptools \
8340
git \
8441
patchutils \
8542
binutils \
@@ -100,17 +57,15 @@ else \
10057
dumb-init \
10158
libicu \
10259
pgbackrest-${PGBACKREST_VERSION} \
103-
&& ${PACKAGER} -y clean all ; \
104-
fi
60+
&& ${PACKAGER} -y clean all;
10561

10662
# install etcdctl
107-
RUN ETCDVERSION=3.5.13 \
108-
&& curl -L https://github.com/coreos/etcd/releases/download/v${ETCDVERSION}/etcd-v${ETCDVERSION}-linux-${ARCH}.tar.gz \
109-
| tar xz -C /bin --strip=1 --wildcards --no-anchored --no-same-owner etcdctl etcd;
63+
RUN ETCDVERSION=3.5.1 \
64+
&& curl -L https://github.com/coreos/etcd/releases/download/v${ETCDVERSION}/etcd-v${ETCDVERSION}-linux-${ARCH}.tar.gz | tar xz -C /bin --strip=1 --wildcards --no-anchored --no-same-owner etcdctl etcd;
11065

11166
ENV PATHBACKUP = $PATH
11267

113-
COPY runit-2.1.2.tar.gz /package/runit-2.1.2.tar.gz
68+
RUN wget https://smarden.org/runit/runit-2.1.2.tar.gz -P /package/
11469

11570
# Install pam_oauth2.so
11671
#RUN #git clone -b $PAM_OAUTH2 --recurse-submodules https://github.com/zalando-pg/pam-oauth2.git \
@@ -188,16 +143,6 @@ RUN pip3 install 'PyYAML<6.0' setuptools pystache loader kazoo meld3 boto python
188143
&& ${PACKAGER} -y clean dbcache \
189144
&& ${PACKAGER} -y clean all;
190145

191-
# RUN ${PACKAGER} -y install --nodocs --noplugins --setopt=install_weak_deps=0 glibc-devel glibc-static \
192-
# && ${PACKAGER} -y clean all \
193-
# && mkdir -p /package \
194-
# && cd /package && tar -xvzf runit-2.1.2.tar.gz && rm runit-2.1.2.tar.gz \
195-
# && cd admin/runit-2.1.2 && package/install \
196-
# && ln -s /usr/local/bin/runsvdir /usr/bin/runsvdir \
197-
# && ${PACKAGER} -y remove $(rpm -qa "*-devel") \
198-
# && ${PACKAGER} -y autoremove \
199-
# && ${PACKAGER} -y clean all;
200-
201146
FROM scratch
202147

203148
ARG PGVERSION

major_upgrade/inplace_upgrade.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ def do_upgrade(self):
490490
self.cluster_version, self.desired_version)
491491
return True
492492

493-
if not (self.postgresql.is_running() and self.postgresql.is_leader()):
493+
if not (self.postgresql.is_running() and self.postgresql.is_primary()):
494494
return logger.error('PostgreSQL is not running or in recovery')
495495

496496
cluster = self.dcs.get_cluster()

0 commit comments

Comments
 (0)