Skip to content

Commit a374b8d

Browse files
committed
WAL-G (custom bootstrap): Wait for PostgreSQL Recovery to complete (WAL apply)
1 parent f546561 commit a374b8d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

roles/patroni/tasks/main.yml

+13
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,19 @@
771771
delay: 10
772772
ignore_errors: false
773773

774+
# for WAL-G (custom bootstrap)
775+
- name: Wait for PostgreSQL Recovery to complete (WAL apply)
776+
become: true
777+
become_user: postgres
778+
command: "{{ postgresql_bin_dir }}/psql -p {{ postgresql_port }} -tAc 'SELECT pg_is_in_recovery()'"
779+
register: pg_is_in_recovery
780+
until: pg_is_in_recovery.stdout == "f"
781+
retries: 1200 # timeout 10 hours
782+
delay: 30
783+
changed_when: false
784+
failed_when: false
785+
when: patroni_cluster_bootstrap_method == "wal-g"
786+
774787
- name: Check PostgreSQL is started and accepting connections on Master
775788
become: true
776789
become_user: postgres

0 commit comments

Comments
 (0)