Skip to content

Commit

Permalink
Merge pull request #62 from gocardless/mosab/upgrade-postgresql-11
Browse files Browse the repository at this point in the history
Prepare draupnir for PostgreSQL 11
  • Loading branch information
Mosab Ibrahim authored May 17, 2019
2 parents 6b8a189 + e87ffe7 commit 1b6d1f2
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 8 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ Unreleased

Nothing

3.1.0
-----

- Upgrade to PostgreSQL 11

3.0.3
-----

Expand Down
2 changes: 1 addition & 1 deletion DRAUPNIR_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.3
3.1.0
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ubuntu:16.04

ENV POSTGRESQL_VERSION=9.4
ENV POSTGRESQL_VERSION=11
RUN set -x \
&& apt-get update \
&& apt-get install -y \
Expand All @@ -9,7 +9,7 @@ RUN set -x \
curl \
sudo \
btrfs-tools \
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main\ndeb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg 9.4" > /etc/apt/sources.list.d/pgdg.list \
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main\ndeb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg 11" > /etc/apt/sources.list.d/pgdg.list \
&& curl --silent -L https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
&& apt-get update -y \
&& apt-get install -y \
Expand Down
2 changes: 1 addition & 1 deletion cmd/draupnir-create-instance
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if ! [[ "$#" -eq 4 ]]; then
exit 1
fi

PG_CTL=/usr/lib/postgresql/9.4/bin/pg_ctl
PG_CTL=/usr/lib/postgresql/11/bin/pg_ctl

ROOT=$1
IMAGE_ID=$2
Expand Down
2 changes: 1 addition & 1 deletion cmd/draupnir-destroy-instance
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if ! [[ "$#" -eq 2 ]]; then
exit 1
fi

PG_CTL=/usr/lib/postgresql/9.4/bin/pg_ctl
PG_CTL=/usr/lib/postgresql/11/bin/pg_ctl

ROOT=$1
ID=$2
Expand Down
7 changes: 4 additions & 3 deletions cmd/draupnir-finalise-image
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ if ! [[ "$#" -eq 4 ]]; then
exit 1
fi

PG_CTL=/usr/lib/postgresql/9.4/bin/pg_ctl
VACUUMDB=/usr/lib/postgresql/9.4/bin/vacuumdb
PG_CTL=/usr/lib/postgresql/11/bin/pg_ctl
VACUUMDB=/usr/lib/postgresql/11/bin/vacuumdb
PSQL=/usr/bin/psql

ROOT=$1
Expand All @@ -51,7 +51,7 @@ if sudo sh -c "ls ${UPLOAD_PATH}/*.tar*"; then
sudo sh -c "rm -f ${UPLOAD_PATH}/*.tar*" # remove the compressed backup file(s)
fi

if ! sudo -u postgres /usr/lib/postgresql/9.4/bin/pg_controldata "${UPLOAD_PATH}"; then
if ! sudo -u postgres /usr/lib/postgresql/11/bin/pg_controldata "${UPLOAD_PATH}"; then
echo "image upload is not valid postgresql data directory"
exit 255
fi
Expand Down Expand Up @@ -90,6 +90,7 @@ work_mem = '128MB'
# requires a significant amount of IO. Similarly, fsync should be turned off
# during finalisation.
hot_standby = 'off'
max_wal_senders = 0
wal_level = 'minimal'
fsync = 'off'
EOF
Expand Down
Binary file modified spec/fixtures/db.tar
Binary file not shown.

0 comments on commit 1b6d1f2

Please sign in to comment.