Allow clustercheck to wait before finishing

Under rare circumstances of heavy loaded environments, HAProxy
may report 'socket error' when disconnecting from clustercheck if
the latter closed its side of the connection first.
Add a configurable post status wait time in clustercheck to fix
HAProxy error reporting. By default, this post wait is not used.

Change-Id: I07bf928742f5ff579070f4d1d6248d5b105bce55
Related-Bug: #2020490
This commit is contained in:
Damien Ciabrini 2023-05-24 10:24:49 +02:00
parent 1b65f42b55
commit 76ab93fa35
1 changed files with 10 additions and 1 deletions

View File

@ -34,12 +34,20 @@
# (Optional) The password for the clustercheck user.
# Defaults to lookup('mysql_clustercheck_password')
#
# [*post_status_wait*]
# (Optional) Number of seconds to wait after status is returned.
# This is only useful for slow environments where haproxy may report
# a "socket error" after clustercheck status is returned if it cannot
# poll and close its side of the connection before socat does.
# Defaults to 0
#
#
class tripleo::profile::pacemaker::clustercheck (
$step = Integer(lookup('step')),
$clustercheck_user = 'clustercheck',
$clustercheck_password = lookup('mysql_clustercheck_password'),
$bind_address = lookup('mysql_bind_host'),
$post_status_wait = 0,
) {
if $step >= 1 {
@ -59,7 +67,8 @@ class tripleo::profile::pacemaker::clustercheck (
content => "MYSQL_USERNAME=${clustercheck_user}\n
MYSQL_PASSWORD='${clustercheck_password}'\n
MYSQL_HOST=localhost\n
TRIPLEO_SOCAT_BIND='${socat_listen_type}:9200,bind=\"${bind_address}\",reuseaddr,fork'\n",
TRIPLEO_SOCAT_BIND='${socat_listen_type}:9200,bind=\"${bind_address}\",reuseaddr,fork'\n
TRIPLEO_POST_STATUS_WAIT=${post_status_wait}\n",
}
# configuration used when clustercheck is run via xinet