Skip to content

Commit

Permalink
fix(rootfs): enable archive_mode before initial boot
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Matthew Fisher committed Jun 8, 2016
1 parent 17a4041 commit 419a0e3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
6 changes: 6 additions & 0 deletions rootfs/docker-entrypoint-initdb.d/003_restore_from_backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

cat << EOF >> "$PGDATA/postgresql.conf"
wal_level = archive
archive_mode = on
archive_command = 'envdir "${WALE_ENVDIR}" wal-e wal-push %p'
archive_timeout = 60
EOF

# ensure $PGDATA has the right permissions
Expand All @@ -28,6 +31,9 @@ lc_numeric = 'C' # locale for number formatting
lc_time = 'C' # locale for time formatting
default_text_search_config = 'pg_catalog.english'
wal_level = archive
archive_mode = on
archive_command = 'envdir "${WALE_ENVDIR}" wal-e wal-push %p'
archive_timeout = 60
listen_addresses = '*'
EOF
cat << EOF > "$PGDATA/pg_hba.conf"
Expand Down
13 changes: 0 additions & 13 deletions rootfs/docker-entrypoint-initdb.d/004_setup_backup_restore.sh

This file was deleted.

0 comments on commit 419a0e3

Please sign in to comment.