]> git.proxmox.com Git - mirror_corosync-qdevice.git/commitdiff
qnetd: Fix dpd timer
authorJan Friesse <jfriesse@redhat.com>
Tue, 15 Sep 2020 13:10:53 +0000 (15:10 +0200)
committerJan Friesse <jfriesse@redhat.com>
Mon, 21 Sep 2020 14:35:32 +0000 (16:35 +0200)
With default config of running dpd timer every 10 second and waiting for
2 * client_timeout to clear message received flag and then waiting
another 2 * client_timeout without message received it was possible that
client was marked as a dead after more than 40 seconds making qdevice to
stop sending votequorum hearbeat for too long so corosync lost votes
from qdevice.

This patch is simpler solution which just changes default dpd timer to
1 second and timeout to 1.2 * client_timeout.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
man/corosync-qnetd.8
qdevices/qnet-config.h
qdevices/qnetd-dpd-timer.c

index 2983ae5d8c60597e0626264e23a72d2256b33454..3ae5531b69f54876ed0d08c73f4b0fe11f29810b 100644 (file)
@@ -1,5 +1,5 @@
 .\"/*
-.\" * Copyright (C) 2016-2019 Red Hat, Inc.
+.\" * Copyright (C) 2016-2020 Red Hat, Inc.
 .\" *
 .\" * All rights reserved.
 .\" *
@@ -31,7 +31,7 @@
 .\" * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 .\" * THE POSSIBILITY OF SUCH DAMAGE.
 .\" */
-.TH COROSYNC-QNETD 8 2019-08-12
+.TH COROSYNC-QNETD 8 2020-09-15
 .SH NAME
 corosync-qnetd \- QNet daemon
 .SH SYNOPSIS
@@ -217,7 +217,7 @@ Maximum heartbeat timeout accepted by server in ms. (120000)
 Dead peer detection enabled. (on)
 .TP
 .B dpd_interval
-How often the DPD algorithm detects dead peers in ms. (10000)
+How often the DPD algorithm detects dead peers in ms. (1000)
 .TP
 .B lock_file
 Lock file location. (/var/run/corosync-qnetd/corosync-qnetd.pid)
index 8435b53f3a06df12685fba19a256887ff71daabf..3a9df193a6db6c5e4d60dbba2b02d119692554f8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015-2016 Red Hat, Inc.
+ * Copyright (c) 2015-2020 Red Hat, Inc.
  *
  * All rights reserved.
  *
@@ -71,7 +71,7 @@ extern "C" {
 #define QNETD_MIN_HEARTBEAT_INTERVAL                   1
 
 #define QNETD_DEFAULT_DPD_ENABLED                      1
-#define QNETD_DEFAULT_DPD_INTERVAL                     (10*1000)
+#define QNETD_DEFAULT_DPD_INTERVAL                     (1*1000)
 #define QNETD_MIN_DPD_INTERVAL                         1
 
 #define QNETD_DEFAULT_LOCK_FILE                                LOCALSTATEDIR"/run/corosync-qnetd/corosync-qnetd.pid"
index 42f7ca93b31c5190ea589ba71eec732d21b7f640..23a530e9c96e68ec6e46dd874fec7c749e04f6bf 100644 (file)
@@ -50,7 +50,7 @@ qnetd_dpd_timer_cb(void *data1, void *data2)
 
                client->dpd_time_since_last_check += instance->advanced_settings->dpd_interval;
 
-               if (client->dpd_time_since_last_check > (client->heartbeat_interval * 2)) {
+               if (client->dpd_time_since_last_check > client->heartbeat_interval * 1.2) {
                        if (!client->dpd_msg_received_since_last_check) {
                                log(LOG_WARNING, "Client %s doesn't sent any message during "
                                    "%"PRIu32"ms. Disconnecting",