Skip to content
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

Make postgres PITR blueprint compatible with postgres 12+ #1127

Merged
merged 1 commit into from
Nov 2, 2021
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
4 changes: 1 addition & 3 deletions build/integration-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ TEST_TIMEOUT="30m"
# Set default options
TEST_OPTIONS="-tags=integration -timeout ${TEST_TIMEOUT} -check.suitep ${DOP}"
# Regex to match apps to run in short mode
# TODO: PITRPostgreSQL app is incompatible with PostgreSQL:13.4.0`
# Re-enable PITRPostgreSQL app once fixed
SHORT_APPS="^PostgreSQL$|^MySQL$|Elasticsearch|^MongoDB$|Maria"
SHORT_APPS="^PostgreSQL$|^PITRPostgreSQL|^MySQL$|Elasticsearch|^MongoDB$|Maria"
# OCAPPS has all the apps that are to be tested against openshift cluster
OC_APPS3_11="MysqlDBDepConfig$|MongoDBDepConfig$|PostgreSQLDepConfig$"
OC_APPS4_4="MysqlDBDepConfig4_4|MongoDBDepConfig4_4|PostgreSQLDepConfig4_4"
Expand Down
23 changes: 13 additions & 10 deletions examples/stable/postgresql-wale/postgresql-blueprint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,20 @@ actions:
mv ${PGDATA}/kanister-restore/* ${PGDATA}/
rm -fr ${PGDATA}/kanister-restore

# Create required configuration dir/config files
# Create empty conf.d directory
if [ ! -d $PGDATA/conf.d ]; then
mkdir $PGDATA/conf.d
fi

# Create default postgresql.conf
cp /opt/bitnami/postgresql/share/postgresql.conf.sample $PGDATA/postgresql.conf

# Create the recovery file that will apply the WAL files.
cat << EOF > "${PGDATA}"/recovery.conf
touch $PGDATA/recovery.signal
cat << EOF >> "${PGDATA}"/postgresql.conf
restore_command = 'envdir "${PGDATA}/env" wal-e --s3-prefix ${old_wale_prefix} wal-fetch "%f" "%p"'
hot_standby = off
{{- if .Options }}
{{- if .Options.pitr }}
recovery_target_time = '{{ toDate "2006-01-02T15:04:05Z" .Options.pitr | date "2006-01-02 15:04:05 GMT" }}'
Expand All @@ -232,15 +243,6 @@ actions:
EOF
sync

# Create required configuration dir/config files
# Create empty conf.d directory
if [ ! -d $PGDATA/conf.d ]; then
mkdir $PGDATA/conf.d
fi

# Create default postgresql.conf
cp /opt/bitnami/postgresql/share/postgresql.conf.sample $PGDATA/postgresql.conf

# Create default pg_hba.conf
cat << EOF > $PGDATA/pg_hba.conf
host all all 0.0.0.0/0 trust
Expand All @@ -264,6 +266,7 @@ actions:
timeline={{ toDate "2006-01-02T15:04:05.999999999Z07:00" .Time | date "2006-01-02T15-04-05" }}
wale_s3_prefix="s3://{{ .Profile.Location.Bucket }}/{{ .ArtifactsIn.manifest.KeyValue.prefix }}/${timeline}"
echo "${wale_s3_prefix}" > "${env_wal_prefix}"
rm $PGDATA/recovery.signal
- func: ScaleWorkload
name: restartPod
args:
Expand Down