Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sbd
Browse files Browse the repository at this point in the history
liangxin1300 committed Jul 29, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent bbfefa0 commit c2ec736
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions crmsh/sbd.py
Original file line number Diff line number Diff line change
@@ -26,9 +26,12 @@ class SBDManager(object):
If you want to use diskless SBD for two-nodes cluster, should be combined with QDevice."""
PARSE_RE = "[; ]"
DISKLESS_CRM_CMD = "crm configure property stonith-enabled=true stonith-watchdog-timeout={} stonith-timeout={}"

SBD_WATCHDOG_TIMEOUT_DEFAULT = 5
SBD_WATCHDOG_TIMEOUT_DEFAULT_S390 = 15
STONITH_WATCHDOG_TIMEOUT_DEFAULT = SBD_WATCHDOG_TIMEOUT_DEFAULT * 2
STONITH_WATCHDOG_TIMEOUT_DEFAULT_S390 = SBD_WATCHDOG_TIMEOUT_DEFAULT_S390 * 2
SBD_WATCHDOG_TIMEOUT_DEFAULT_WITH_QDEVICE = 35
STONITH_WATCHDOG_TIMEOUT_DEFAULT = "10s"
STONITH_WATCHDOG_TIMEOUT_DEFAULT_S390 = "30s"

def __init__(self, context):
"""
@@ -41,9 +44,13 @@ def __init__(self, context):
self.diskless_sbd = context.diskless_sbd
self._sbd_devices = None
self._watchdog_inst = None
self._stonith_watchdog_timeout = self.STONITH_WATCHDOG_TIMEOUT_DEFAULT
self._stonith_timeout = 60
self._sbd_watchdog_timeout = 0
if context.is_s390:
self._sbd_watchdog_timeout = self.SBD_WATCHDOG_TIMEOUT_DEFAULT_S390
self._stonith_watchdog_timeout = self.STONITH_WATCHDOG_TIMEOUT_DEFAULT_S390
else:
self._sbd_watchdog_timeout = self.SBD_WATCHDOG_TIMEOUT_DEFAULT
self._stonith_watchdog_timeout = self.STONITH_WATCHDOG_TIMEOUT_DEFAULT
self._context = context
self._delay_start = False

@@ -200,8 +207,8 @@ def _determine_sbd_watchdog_timeout(self):
if utils.is_qdevice_configured() and utils.service_is_active("corosync-qdevice.service"):
qdevice_sync_timeout = utils.get_qdevice_sync_timeout()
self._sbd_watchdog_timeout = qdevice_sync_timeout + 5
if self._context.is_s390 and self._sbd_watchdog_timeout < 15:
self._sbd_watchdog_timeout = 15
if self._context.is_s390 and self._sbd_watchdog_timeout < self.SBD_WATCHDOG_TIMEOUT_DEFAULT_S390:
self._sbd_watchdog_timeout = self.SBD_WATCHDOG_TIMEOUT_DEFAULT_S390
self._stonith_timeout = self.calculate_stonith_timeout(self._sbd_watchdog_timeout)
# add sbd and qdevice together from beginning
elif self._context.qdevice_inst:
@@ -215,8 +222,6 @@ def _determine_stonith_watchdog_timeout(self):
res = SBDManager.get_sbd_value_from_config("SBD_WATCHDOG_TIMEOUT")
if res:
self._stonith_watchdog_timeout = -1
elif self._context.is_s390:
self._stonith_watchdog_timeout = self.STONITH_WATCHDOG_TIMEOUT_DEFAULT_S390

def _get_sbd_device_from_config(self):
"""

0 comments on commit c2ec736

Please sign in to comment.