Skip to content

Commit c86b25d

Browse files
committed
pgsql: Fixed an issue where tmpdir was not created when rep_mode was set to slave.
1 parent 968ad70 commit c86b25d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

heartbeat/pgsql

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1990,6 +1990,16 @@ validate_ocf_check_level_10() {
19901990
fi
19911991
fi
19921992

1993+
# For slave mode in PostgreSQL 12 and later, create the tmp directory to place recovery.conf.
1994+
ocf_version_cmp "$version" "12"
1995+
rc=$?
1996+
if [ $rc -eq 1 ]||[ $rc -eq 2 ]; then # PosrgreSQL 12 or later.
1997+
if ! mkdir -p $OCF_RESKEY_tmpdir || ! chown $OCF_RESKEY_pgdba $OCF_RESKEY_tmpdir || ! chmod 700 $OCF_RESKEY_tmpdir; then
1998+
ocf_exit_reason "Can't create directory $OCF_RESKEY_tmpdir or it is not readable by $OCF_RESKEY_pgdba"
1999+
return $OCF_ERR_PERM
2000+
fi
2001+
fi
2002+
19932003
if use_replication_slot; then
19942004
ocf_version_cmp "$version" "9.4"
19952005
rc=$?

0 commit comments

Comments
 (0)