Configuration option quorum.device.sync_timeout is available for setting qdevice poll timeout for synchronization phase. Default value is 30 sec. Signed-off-by: Jan Friesse <jfriesse@xxxxxxxxxx> --- exec/coroparse.c | 1 + exec/votequorum.c | 8 ++++++-- include/corosync/votequorum.h | 1 + man/votequorum_qdevice_poll.3.in | 7 +++++-- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/exec/coroparse.c b/exec/coroparse.c index 422b586..74a4c2a 100644 --- a/exec/coroparse.c +++ b/exec/coroparse.c @@ -557,6 +557,7 @@ static int main_config_parser_cb(const char *path, break; case MAIN_CP_CB_DATA_STATE_QDEVICE: if ((strcmp(path, "quorum.device.timeout") == 0) || + (strcmp(path, "quorum.device.sync_timeout") == 0) || (strcmp(path, "quorum.device.votes") == 0)) { val_type = ICMAP_VALUETYPE_UINT32; if (safe_atoq(value, &val, val_type) != 0) { diff --git a/exec/votequorum.c b/exec/votequorum.c index 7781077..78e6b7b 100644 --- a/exec/votequorum.c +++ b/exec/votequorum.c @@ -71,6 +71,7 @@ static struct corosync_api_v1 *corosync_api; static char qdevice_name[VOTEQUORUM_QDEVICE_MAX_NAME_LEN]; static struct cluster_node *qdevice = NULL; static unsigned int qdevice_timeout = VOTEQUORUM_QDEVICE_DEFAULT_TIMEOUT; +static unsigned int qdevice_sync_timeout = VOTEQUORUM_QDEVICE_DEFAULT_SYNC_TIMEOUT; static uint8_t qdevice_can_operate = 1; static void *qdevice_reg_conn = NULL; static uint8_t qdevice_master_wins = 0; @@ -1197,6 +1198,9 @@ static int votequorum_qdevice_is_configured(uint32_t *qdevice_votes) if (icmap_get_uint32("quorum.device.timeout", &qdevice_timeout) != CS_OK) { qdevice_timeout = VOTEQUORUM_QDEVICE_DEFAULT_TIMEOUT; } + if (icmap_get_uint32("quorum.device.sync_timeout", &qdevice_sync_timeout) != CS_OK) { + qdevice_sync_timeout = VOTEQUORUM_QDEVICE_DEFAULT_SYNC_TIMEOUT; + } update_qdevice_can_operate(1); ret = 1; } @@ -2244,13 +2248,13 @@ static void votequorum_sync_init ( if (qdevice_timer_set) { corosync_api->timer_delete(qdevice_timer); } - corosync_api->timer_add_duration((unsigned long long)qdevice_timeout*1000000, qdevice, + corosync_api->timer_add_duration((unsigned long long)qdevice_sync_timeout*1000000, qdevice, qdevice_timer_fn, &qdevice_timer); qdevice_timer_set = 1; sync_wait_for_poll_or_timeout = 1; log_printf(LOGSYS_LEVEL_INFO, "waiting for quorum device %s poll (but maximum for %u ms)", - qdevice_name, qdevice_timeout); + qdevice_name, qdevice_sync_timeout); } LEAVE(); diff --git a/include/corosync/votequorum.h b/include/corosync/votequorum.h index ef5294a..9bc5690 100644 --- a/include/corosync/votequorum.h +++ b/include/corosync/votequorum.h @@ -56,6 +56,7 @@ typedef uint64_t votequorum_handle_t; #define VOTEQUORUM_QDEVICE_NODEID 0 #define VOTEQUORUM_QDEVICE_MAX_NAME_LEN 255 #define VOTEQUORUM_QDEVICE_DEFAULT_TIMEOUT 10000 +#define VOTEQUORUM_QDEVICE_DEFAULT_SYNC_TIMEOUT 30000 #define VOTEQUORUM_NODESTATE_MEMBER 1 #define VOTEQUORUM_NODESTATE_DEAD 2 diff --git a/man/votequorum_qdevice_poll.3.in b/man/votequorum_qdevice_poll.3.in index b8299df..044105b 100644 --- a/man/votequorum_qdevice_poll.3.in +++ b/man/votequorum_qdevice_poll.3.in @@ -51,10 +51,13 @@ must be set (one get in votequorum_notification_fn callback) otherwise poll is i This routine should be called at regular intervals to ensure that the device status is always known to votequorum. If .B votequorum_qdevice_poll -is not called for (default) 10 seconds then the device will be deemed to be dead and +is not called for (default) 10 seconds (or 30 seconds for sync phase) then the device will be deemed to be dead and its votes removed from the cluster. This does not unregister the device. The default poll time can be changed by setting the cmap variable -quorum.quorumdev_poll. +.B quorum.device.timeout +for normal operation or +.B quorum.device.sync_timeout +for synchronization phase. .SH RETURN VALUE This call returns the CS_OK value if successful, otherwise an error is returned. .PP -- 1.7.1 _______________________________________________ discuss mailing list discuss@xxxxxxxxxxxx http://lists.corosync.org/mailman/listinfo/discuss