File 0001-TimeoutFormulas.patch of Package crmsh

From 2b40cbd002bea83ba29f867993fb8ec22d41c41a Mon Sep 17 00:00:00 2001
From: xin liang <xliang@suse.com>
Date: Tue, 29 Jul 2025 16:47:13 +0800
Subject: [PATCH] Fix: doc: Add TimeoutFormulas help topic (bsc#1242981)

To show SBD and Pacemaker related timeout formulas in the help topic.
---
 doc/crm.8.adoc | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 67 insertions(+)

diff --git a/doc/crm.8.adoc b/doc/crm.8.adoc
index 9d9a9111..ecdf8f1e 100644
--- a/doc/crm.8.adoc
+++ b/doc/crm.8.adoc
@@ -296,6 +296,73 @@ INFO: test-2 shadow CIB created
 crm(test-2)configure# commit
 ...............
 
+[[topics.TimeoutFormulas,Timeout formulas]]
+=== Timeout formulas
+
+If you use `crm cluster init` command to set up a cluster with SBD as
+the stonith device, crmsh configures several fencing related settings
+based on the calculations with a set of formulas.
+
+.SBD related timeouts
+`watchdog` timeout: Default value is 15s. This value is from the definition
+in +/etc/crm/profiles.xml+, can be a different value with a different profile.
+`msgwait` timeout:
+...............
+    msgwait = 2 * watchdog
+...............
+`SBD_WATCHDOG_TIMEOUT`:
+...............
+    # For diskless SBD
+    SBD_WATCHDOG_TIMEOUT = Default value is 15s. This value is from the definition
+in +/etc/crm/profiles.xml+, can be a different value with a different profile.
+
+    # When adding diskless SBD and QDevice together from crm cluster init
+    if SBD_WATCHDOG_TIMEOUT < 35s:
+	SBD_WATCHDOG_TIMEOUT = 35s
+
+    # When adding diskless SBD in a cluster with QDevice already
+    if SBD_WATCHDOG_TIMEOUT < qdevice_sync_timeout:
+	SBD_WATCHDOG_TIMEOUT = qdevice_sync_timeout + 5s
+
+    # When adding QDevice in a cluster with diskless SBD already
+    if SBD_WATCHDOG_TIMEOUT < 35s:
+	SBD_WATCHDOG_TIMEOUT = 35s
+...............
+`SBD_DELAY_START`:
+...............
+    # For disk-based SBD
+    SBD_DELAY_START =  pcmk_delay_max + msgwait + corosync.token + corosync.consensus
+
+    # For diskless SBD
+    SBD_DELAY_START = 2 * SBD_WATCHDOG_TIMEOUT + corosync.token + corosync.consensus
+...............
+`TimeoutSec` of sbd.service systemd unit:
+...............
+    default_value = 1min30s
+    if SBD_DELAY_START > default_value:
+	start_timeout = 1.2 * SBD_DELAY_START
+    else:
+	start_timeout = default_value
+...............
+.Pacemaker related timeouts
+`stonith-watchdog-timeout`: (for diskless SBD)
+...............
+    stonith-watchdog-timeout = 2 * SBD_WATCHDOG_TIMEOUT
+...............
+`stonith-timeout`:
+...............
+    # For disk-based SBD
+    value_from_sbd = 1.2 * msgwait
+    stonith-timeout = max(value_from_sbd, 60) + corosync.token + corosync.consensus
+
+    # For diskless SBD
+    value_from_sbd = 1.2 * max(stonith-watchdog-timeout, 2*SBD_WATCHDOG_TIMEOUT)
+    stonith-timeout = max(value_from_sbd, 60) + corosync.token + corosync.consensus
+
+    # For general scenarios
+    stonith-timeout = 60 + corosync.token + corosync.consensus
+...............
+
 [[topics.Features.Checks,Configuration semantic checks]]
 === Configuration semantic checks
 
-- 
2.45.2

openSUSE Build Service is sponsored by