File tree Expand file tree Collapse file tree 4 files changed +18
-6
lines changed Expand file tree Collapse file tree 4 files changed +18
-6
lines changed Original file line number Diff line number Diff line change 11
11
12
12
# - Recovery Target -
13
13
14
- #recovery_target = 'immediate '
14
+ #recovery_target_lsn = ''
15
15
#recovery_target_time = ''
16
16
#recovery_target_action = 'promote'
17
17
#recovery_target_timeline = 'current'
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ postgres_exporter_release_checksum:
42
42
amd64 : sha256:ff541bd3ee19c0ae003d71424a75edfcc8695e828dd20d5b4555ce433c89d60b
43
43
44
44
adminapi_release : 0.48.0
45
- adminmgr_release : 0.9 .0
45
+ adminmgr_release : 0.10 .0
46
46
47
47
# Postgres Extensions
48
48
postgis_release : " 3.3.2"
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
set -eou pipefail
3
3
4
+ PG_CONF=/etc/postgresql/postgresql.conf
5
+ SUPERVISOR_CONF=/etc/supervisor/supervisord.conf
6
+
7
+ DATA_VOLUME_MOUNTPOINT=${DATA_VOLUME_MOUNTPOINT:-/ data}
8
+ export CONFIGURED_FLAG_PATH=${CONFIGURED_FLAG_PATH:- $DATA_VOLUME_MOUNTPOINT / machine.configured}
9
+
4
10
# Ref: https://gist.github.com/sj26/88e1c6584397bb7c13bd11108a579746
5
11
function retry {
6
12
# Pass 0 for unlimited retries
@@ -44,11 +50,14 @@ function enable_swap {
44
50
swapon /mnt/swapfile
45
51
}
46
52
47
- PG_CONF=/etc/postgresql/postgresql.conf
48
- SUPERVISOR_CONF=/etc/supervisor/supervisord.conf
53
+ function create_lsn_checkpoint_file {
54
+ if [ ! -f " ${DATA_VOLUME_MOUNTPOINT} /latest-lsn-checkpoint" ]; then
55
+ echo " 0/0" > " ${DATA_VOLUME_MOUNTPOINT} /latest-lsn-checkpoint"
56
+ chown postgres:postgres " ${DATA_VOLUME_MOUNTPOINT} /latest-lsn-checkpoint"
57
+ chmod 0300 " ${DATA_VOLUME_MOUNTPOINT} /latest-lsn-checkpoint"
58
+ fi
59
+ }
49
60
50
- DATA_VOLUME_MOUNTPOINT=${DATA_VOLUME_MOUNTPOINT:-/ data}
51
- export CONFIGURED_FLAG_PATH=${CONFIGURED_FLAG_PATH:- $DATA_VOLUME_MOUNTPOINT / machine.configured}
52
61
53
62
function setup_postgres {
54
63
tar -xzvf " $INIT_PAYLOAD_PATH " -C / ./etc/postgresql.schema.sql
234
243
235
244
if [ " ${PLATFORM_DEPLOYMENT:- } " ]; then
236
245
enable_swap
246
+ create_lsn_checkpoint_file
237
247
fi
238
248
239
249
touch " $CONFIGURED_FLAG_PATH "
Original file line number Diff line number Diff line change 59
59
# This is to ensure that the WAL file is shipped, just in case
60
60
sleep 1
61
61
62
+ /usr/bin/admin-mgr lsn-checkpoint-push || echo " Failed to push LSN checkpoint"
63
+
62
64
kill -s TERM " $( supervisorctl pid) "
63
65
fi
64
66
}
You can’t perform that action at this time.
0 commit comments