Skip to content

Commit 3261c18

Browse files
Add postgres pitr support with physical backup (#36)
Signed-off-by: souravbiswassanto <[email protected]>
1 parent 066e7b5 commit 3261c18

37 files changed

+96
-66
lines changed

role_scripts/10/primary/start.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ echo "max_wal_senders = 90" >>/tmp/postgresql.conf # default is 10. value must
2424
if [ ! -z "${WAL_RETAIN_PARAM:-}" ] && [ ! -z "${WAL_RETAIN_AMOUNT:-}" ]; then
2525
echo "${WAL_RETAIN_PARAM}=${WAL_RETAIN_AMOUNT}" >>/tmp/postgresql.conf
2626
else
27-
echo "wal_keep_segments = 64" >>/tmp/postgresql.conf
27+
echo "wal_keep_segments = 160" >>/tmp/postgresql.conf
2828
fi
2929
echo "max_replication_slots = 90" >>/tmp/postgresql.conf
3030
echo "wal_log_hints = on" >>/tmp/postgresql.conf

role_scripts/10/standby/ha_backup_job.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ echo "max_wal_senders = 90" >>/tmp/postgresql.conf # default is 10. value must
8181
if [ ! -z "${WAL_RETAIN_PARAM:-}" ] && [ ! -z "${WAL_RETAIN_AMOUNT:-}" ]; then
8282
echo "${WAL_RETAIN_PARAM}=${WAL_RETAIN_AMOUNT}" >>/tmp/postgresql.conf
8383
else
84-
echo "wal_keep_segments = 64" >>/tmp/postgresql.conf
84+
echo "wal_keep_segments = 160" >>/tmp/postgresql.conf
8585
fi
8686

8787
echo "shared_preload_libraries = 'pg_stat_statements'" >>/tmp/postgresql.conf

role_scripts/10/standby/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ echo "max_wal_senders = 90" >>/tmp/postgresql.conf # default is 10. value must
119119
if [ ! -z "${WAL_RETAIN_PARAM:-}" ] && [ ! -z "${WAL_RETAIN_AMOUNT:-}" ]; then
120120
echo "${WAL_RETAIN_PARAM}=${WAL_RETAIN_AMOUNT}" >>/tmp/postgresql.conf
121121
else
122-
echo "wal_keep_segments = 64" >>/tmp/postgresql.conf
122+
echo "wal_keep_segments = 160" >>/tmp/postgresql.conf
123123
fi
124124

125125
echo "wal_log_hints = on" >>/tmp/postgresql.conf

role_scripts/10/standby/warm_stanby.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ echo "max_wal_senders = 90" >>/tmp/postgresql.conf # default is 10. value must
2626
if [ ! -z "${WAL_RETAIN_PARAM:-}" ] && [ ! -z "${WAL_RETAIN_AMOUNT:-}" ]; then
2727
echo "${WAL_RETAIN_PARAM}=${WAL_RETAIN_AMOUNT}" >>/tmp/postgresql.conf
2828
else
29-
echo "wal_keep_segments = 64" >>/tmp/postgresql.conf
29+
echo "wal_keep_segments = 160" >>/tmp/postgresql.conf
3030
fi
3131
echo "max_replication_slots = 90" >>/tmp/postgresql.conf
3232
echo "wal_log_hints = on" >>/tmp/postgresql.conf

role_scripts/11/primary/start.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ echo "max_wal_senders = 90" >>/tmp/postgresql.conf # default is 10. value must
2424
if [ ! -z "${WAL_RETAIN_PARAM:-}" ] && [ ! -z "${WAL_RETAIN_AMOUNT:-}" ]; then
2525
echo "${WAL_RETAIN_PARAM}=${WAL_RETAIN_AMOUNT}" >>/tmp/postgresql.conf
2626
else
27-
echo "wal_keep_segments = 64" >>/tmp/postgresql.conf
27+
echo "wal_keep_segments = 160" >>/tmp/postgresql.conf
2828
fi
2929
echo "max_replication_slots = 90" >>/tmp/postgresql.conf
3030
echo "wal_log_hints = on" >>/tmp/postgresql.conf

role_scripts/11/standby/ha_backup_job.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ echo "max_wal_senders = 90" >>/tmp/postgresql.conf # default is 10. value must
8181
if [ ! -z "${WAL_RETAIN_PARAM:-}" ] && [ ! -z "${WAL_RETAIN_AMOUNT:-}" ]; then
8282
echo "${WAL_RETAIN_PARAM}=${WAL_RETAIN_AMOUNT}" >>/tmp/postgresql.conf
8383
else
84-
echo "wal_keep_segments = 64" >>/tmp/postgresql.conf
84+
echo "wal_keep_segments = 160" >>/tmp/postgresql.conf
8585
fi
8686
echo "max_replication_slots = 90" >>/tmp/postgresql.conf
8787
echo "wal_log_hints = on" >>/tmp/postgresql.conf

role_scripts/11/standby/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ echo "max_wal_senders = 90" >>/tmp/postgresql.conf # default is 10. value must
118118
if [ ! -z "${WAL_RETAIN_PARAM:-}" ] && [ ! -z "${WAL_RETAIN_AMOUNT:-}" ]; then
119119
echo "${WAL_RETAIN_PARAM}=${WAL_RETAIN_AMOUNT}" >>/tmp/postgresql.conf
120120
else
121-
echo "wal_keep_segments = 64" >>/tmp/postgresql.conf
121+
echo "wal_keep_segments = 160" >>/tmp/postgresql.conf
122122
fi
123123
echo "max_replication_slots = 90" >>/tmp/postgresql.conf
124124
echo "wal_log_hints = on" >>/tmp/postgresql.conf

role_scripts/11/standby/warm_stanby.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ echo "max_wal_senders = 90" >>/tmp/postgresql.conf # default is 10. value must
2626
if [ ! -z "${WAL_RETAIN_PARAM:-}" ] && [ ! -z "${WAL_RETAIN_AMOUNT:-}" ]; then
2727
echo "${WAL_RETAIN_PARAM}=${WAL_RETAIN_AMOUNT}" >>/tmp/postgresql.conf
2828
else
29-
echo "wal_keep_segments = 64" >>/tmp/postgresql.conf
29+
echo "wal_keep_segments = 160" >>/tmp/postgresql.conf
3030
fi
3131
echo "max_replication_slots = 90" >>/tmp/postgresql.conf
3232
echo "wal_log_hints = on" >>/tmp/postgresql.conf

role_scripts/12/primary/start.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ echo "max_wal_senders = 90" >>/tmp/postgresql.conf # default is 10. value must
2424
if [ ! -z "${WAL_RETAIN_PARAM:-}" ] && [ ! -z "${WAL_RETAIN_AMOUNT:-}" ]; then
2525
echo "${WAL_RETAIN_PARAM}=${WAL_RETAIN_AMOUNT}" >>/tmp/postgresql.conf
2626
else
27-
echo "wal_keep_segments = 64" >>/tmp/postgresql.conf
27+
echo "wal_keep_segments = 160" >>/tmp/postgresql.conf
2828
fi
2929
echo "max_replication_slots = 90" >>/tmp/postgresql.conf
3030
echo "wal_log_hints = on" >>/tmp/postgresql.conf

role_scripts/12/standby/ha_backup_job.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ echo "max_wal_senders = 90" >>/tmp/postgresql.conf # default is 10. value must
7676
if [ ! -z "${WAL_RETAIN_PARAM:-}" ] && [ ! -z "${WAL_RETAIN_AMOUNT:-}" ]; then
7777
echo "${WAL_RETAIN_PARAM}=${WAL_RETAIN_AMOUNT}" >>/tmp/postgresql.conf
7878
else
79-
echo "wal_keep_segments = 64" >>/tmp/postgresql.conf
79+
echo "wal_keep_segments = 160" >>/tmp/postgresql.conf
8080
fi
8181

8282
if [[ "$WAL_LIMIT_POLICY" == "ReplicationSlot" ]]; then

0 commit comments

Comments
 (0)