Skip to content

Commit 419a0e3

Browse files
author
Matthew Fisher
committed
fix(rootfs): enable archive_mode before initial boot
It appears that the first WAL log is (occasionally) not being shipped to minio, and that's because we did not enable `archive_mode = on` for the first database boot in `003_restore_from_backup.sh`, which starts shipping WAL logs immediately after booting. We enable archive mode in 004. This is a simple fix that just requires us enabling archive_mode in `003_restore_from_backup.sh` before we boot up the server.
1 parent 17a4041 commit 419a0e3

3 files changed

Lines changed: 6 additions & 13 deletions

File tree

rootfs/docker-entrypoint-initdb.d/003_restore_from_backup.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
cat << EOF >> "$PGDATA/postgresql.conf"
44
wal_level = archive
5+
archive_mode = on
6+
archive_command = 'envdir "${WALE_ENVDIR}" wal-e wal-push %p'
7+
archive_timeout = 60
58
EOF
69

710
# ensure $PGDATA has the right permissions
@@ -28,6 +31,9 @@ lc_numeric = 'C' # locale for number formatting
2831
lc_time = 'C' # locale for time formatting
2932
default_text_search_config = 'pg_catalog.english'
3033
wal_level = archive
34+
archive_mode = on
35+
archive_command = 'envdir "${WALE_ENVDIR}" wal-e wal-push %p'
36+
archive_timeout = 60
3137
listen_addresses = '*'
3238
EOF
3339
cat << EOF > "$PGDATA/pg_hba.conf"
File renamed without changes.

rootfs/docker-entrypoint-initdb.d/004_setup_backup_restore.sh

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)