Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package drbd-utils for openSUSE:Factory 
checked in at 2023-04-04 21:27:00
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/drbd-utils (Old)
 and      /work/SRC/openSUSE:Factory/.drbd-utils.new.19717 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "drbd-utils"

Tue Apr  4 21:27:00 2023 rev:55 rq:1077195 version:9.19.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/drbd-utils/drbd-utils.changes    2023-03-24 
15:21:09.871120520 +0100
+++ /work/SRC/openSUSE:Factory/.drbd-utils.new.19717/drbd-utils.changes 
2023-04-04 21:27:14.975519053 +0200
@@ -1,0 +2,7 @@
+Mon Mar 27 15:16:52 UTC 2023 - Nicholas Yang <nicholas.y...@suse.com>
+
+- crm-fence-peer incompatible with Pacemaker 2.1 and needs backports 
(bsc#1209783)
+  * 0001-crm-fence-peer-fix-timeout-with-Pacemaker-2.1-milli-.patch
+  * 0002-crm-fence-peer-fix-timeout-with-Pacemaker-2.0.5-mill.patch
+
+-------------------------------------------------------------------

New:
----
  0001-crm-fence-peer-fix-timeout-with-Pacemaker-2.1-milli-.patch
  0002-crm-fence-peer-fix-timeout-with-Pacemaker-2.0.5-mill.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ drbd-utils.spec ++++++
--- /var/tmp/diff_new_pack.d64kJd/_old  2023-04-04 21:27:15.619522708 +0200
+++ /var/tmp/diff_new_pack.d64kJd/_new  2023-04-04 21:27:15.623522732 +0200
@@ -48,6 +48,8 @@
 Patch4:         0001-Disable-quorum-in-default-configuration-bsc-1032142.patch
 Patch5:         move_fencing_from_disk_to_net_in_example.patch
 Patch6:         pie-fix.patch
+Patch7:         0001-crm-fence-peer-fix-timeout-with-Pacemaker-2.1-milli-.patch
+Patch8:         0002-crm-fence-peer-fix-timeout-with-Pacemaker-2.0.5-mill.patch
 Patch99:        rpmlint-build-error.patch
 
 Provides:       drbd-bash-completion = %{version}
@@ -99,6 +101,8 @@
 %patch4 -p1
 %patch5 -p1
 %patch6 -p1
+%patch7 -p1
+%patch8 -p1
 %patch99 -p1
 
 %build

++++++ 0001-crm-fence-peer-fix-timeout-with-Pacemaker-2.1-milli-.patch ++++++
>From 8a28be74bc6efa93931c957e54c01abb18b984fe Mon Sep 17 00:00:00 2001
From: Lars Ellenberg <lars.ellenb...@linbit.com>
Date: Wed, 12 Jan 2022 13:50:35 +0100
Subject: [PATCH] crm-fence-peer: fix timeout with Pacemaker 2.1: milli seconds
 vs seconds
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

crmadmin timeout was in milli seconds for <= 2.0.x,
but became a TIMESPEC with default seconds in >= 2.1.

Up to 2.0.4, atoi() was used, which effectively ignores "trailing garbage",
so we could get away with always appending "ms".
But with 2.0.5, it became g_option_context_parse G_OPTION_ARG_INT, which
"Cannot parse integer value “200ms” for --timeout" :-|

So grep the help message for "timeout.*milliseconds",
and if not present, append an explicit "ms" unit.

Also tolerate both ": ok" (2.1) and " (ok)" (older)
when matching the output string of crmadmin -S.
---
 scripts/crm-fence-peer.9.sh | 24 +++++++++++++++++++++---
 scripts/crm-fence-peer.sh   | 24 +++++++++++++++++++++---
 2 files changed, 42 insertions(+), 6 deletions(-)

diff --git a/scripts/crm-fence-peer.9.sh b/scripts/crm-fence-peer.9.sh
index 36590bd8..c943bf9f 100755
--- a/scripts/crm-fence-peer.9.sh
+++ b/scripts/crm-fence-peer.9.sh
@@ -392,6 +392,20 @@ check_cluster_properties()
        crm_is_not_false ${stonith_enabled:-} && stonith_enabled=true || 
stonith_enabled=false
 }
 
+setup_crm_timeout_unit_ms()
+{
+       # crmadmin timeout was in ms for <= 2.0.x,
+       # but became a TIMESPEC in >= 2.1.
+       # Up to 2.0.4, atoi() was used, which effectively ignores "trailing
+       # garbage", so we could get away with always appending "ms", but with
+       # 2.0.5, it became g_option_context_parse G_OPTION_ARG_INT, which
+       # "Cannot parse integer value “200ms” for --timeout" :-|
+       if crmadmin --help 2>&1 | grep -q -e "--timeout=.*in milliseconds"; then
+               crm_timeout_unit_ms=""
+       else
+               crm_timeout_unit_ms="ms"
+       fi
+}
 
 #
 # In case this is a two-node cluster (still common with
@@ -737,6 +751,7 @@ drbd_peer_fencing()
 
                local startup_fencing stonith_enabled
                check_cluster_properties
+               setup_crm_timeout_unit_ms
 
                if ! $had_constraint_on_entry ; then
 
@@ -1075,14 +1090,17 @@ _check_peer_node_reachable()
                # it is obviously reachable.
                #
                # Do this only after we have been able to reach a DC above.
-               # Note: crmadmin timeout is in milli-seconds, and defaults to 
30000 (30 seconds).
+               # Note: crmadmin timeout defaults to 30 seconds.
+               #
                # Our variable $cibtimeout should be in deci-seconds (see above)
                # (unless you use a very old version of pacemaker, so don't do 
that).
                # Convert deci-seconds to milli-seconds, and double it.
+               # See also setup_crm_timeout_unit_ms() above.
+               #
                if [[ $crmd = "online" ]] ; then
                        local out
-                       if out=$( crmadmin -t $(( cibtimeout * 200 )) -S 
$DRBD_PEER ) \
-                       && [[ $out = *"(ok)" ]]; then
+                       if out=$( crmadmin -t $(( cibtimeout * 200 
))$crm_timeout_unit_ms -S $DRBD_PEER ) \
+                       && [[ $out = *@(": ok"|" (ok)") ]]; then
                                peer_state="reachable"
                                return
                        fi
diff --git a/scripts/crm-fence-peer.sh b/scripts/crm-fence-peer.sh
index cb5deded..96786734 100755
--- a/scripts/crm-fence-peer.sh
+++ b/scripts/crm-fence-peer.sh
@@ -244,6 +244,20 @@ check_cluster_properties()
        crm_is_not_false $stonith_enabled && stonith_enabled=true || 
stonith_enabled=false
 }
 
+setup_crm_timeout_unit_ms()
+{
+       # crmadmin timeout was in ms for <= 2.0.x,
+       # but became a TIMESPEC in >= 2.1.
+       # Up to 2.0.4, atoi() was used, which effectively ignores "trailing
+       # garbage", so we could get away with always appending "ms", but with
+       # 2.0.5, it became g_option_context_parse G_OPTION_ARG_INT, which
+       # "Cannot parse integer value “200ms” for --timeout" :-|
+       if crmadmin --help 2>&1 | grep -q -e "--timeout=.*in milliseconds"; then
+               crm_timeout_unit_ms=""
+       else
+               crm_timeout_unit_ms="ms"
+       fi
+}
 
 #
 # In case this is a two-node cluster (still common with
@@ -426,6 +440,7 @@ drbd_peer_fencing()
 
                local startup_fencing stonith_enabled
                check_cluster_properties
+               setup_crm_timeout_unit_ms
 
                if [[ -z $have_constraint ]] ; then
                        # try to place it.
@@ -718,14 +733,17 @@ check_peer_node_reachable()
                # it is obviously reachable.
                #
                # Do this only after we have been able to reach a DC above.
-               # Note: crmadmin timeout is in milli-seconds, and defaults to 
30000 (30 seconds).
+               # Note: crmadmin timeout defaults to 30 seconds.
+               #
                # Our variable $cibtimeout should be in deci-seconds (see above)
                # (unless you use a very old version of pacemaker, so don't do 
that).
                # Convert deci-seconds to milli-seconds, and double it.
+               # See also setup_crm_timeout_unit_ms() above.
+               #
                if [[ $crmd = "online" ]] ; then
                        local out
-                       if out=$( crmadmin -t $(( cibtimeout * 200 )) -S 
$DRBD_PEER ) \
-                       && [[ $out = *"(ok)" ]]; then
+                       if out=$( crmadmin -t $(( cibtimeout * 200 
))$crm_timeout_unit_ms -S $DRBD_PEER ) \
+                       && [[ $out = *@(": ok"|" (ok)") ]]; then
                                peer_state="reachable"
                                return
                        fi
-- 
2.40.0


++++++ 0002-crm-fence-peer-fix-timeout-with-Pacemaker-2.0.5-mill.patch ++++++
>From 68d1e4242f165917bc2c787d9df0fe41251e05e6 Mon Sep 17 00:00:00 2001
From: Lars Ellenberg <lars.ellenb...@linbit.com>
Date: Wed, 12 Jan 2022 13:50:35 +0100
Subject: [PATCH] crm-fence-peer: fix timeout with Pacemaker 2.0.5: milli
 seconds vs seconds
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Addendum to 8a28be74bc6efa93931c957e54c01abb18b984fe
Commit message of the above cited here:

> crmadmin timeout was in milli seconds for <= 2.0.x,
> but became a TIMESPEC with default seconds in >= 2.1.
>
> Up to 2.0.4, atoi() was used, which effectively ignores "trailing garbage",
> so we could get away with always appending "ms".
> But with 2.0.5, it became g_option_context_parse G_OPTION_ARG_INT, which
> "Cannot parse integer value “200ms” for --timeout" :-|
>
> So grep the help message for "timeout.*milliseconds",
> and if not present, append an explicit "ms" unit.

And this is where I got it wrong :-(
somewhere later they re-organised the help text
so now I would need to parse --help-all.

Instead try to actually call "crmadmin -t 100ms --version".
If that works, it apparently understands (or ignores)
the "ms" unit.
---
 scripts/crm-fence-peer.9.sh | 14 +++++++++++---
 scripts/crm-fence-peer.sh   | 14 +++++++++++---
 2 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/scripts/crm-fence-peer.9.sh b/scripts/crm-fence-peer.9.sh
index c943bf9f..fc8d2bc3 100755
--- a/scripts/crm-fence-peer.9.sh
+++ b/scripts/crm-fence-peer.9.sh
@@ -400,10 +400,18 @@ setup_crm_timeout_unit_ms()
        # garbage", so we could get away with always appending "ms", but with
        # 2.0.5, it became g_option_context_parse G_OPTION_ARG_INT, which
        # "Cannot parse integer value “200ms” for --timeout" :-|
-       if crmadmin --help 2>&1 | grep -q -e "--timeout=.*in milliseconds"; then
-               crm_timeout_unit_ms=""
-       else
+       # Can not parse the help text reliably, because they changed content
+       # and organisation of the help text between 2.0.4 and 2.0.5.
+       # Just try using ms unit, and see if it fails.
+       if crmadmin -t 100ms --version &> /dev/null; then
+               # this is either a recent version that actually understands ms
+               # as part of the TIMESPEC, or a version that still uses atoi().
                crm_timeout_unit_ms="ms"
+       else
+               # this one likely failed with
+               # crmadmin: Cannot parse integer value “100ms” for -t
+               # (>= 2.0.5, < 2.1)
+               crm_timeout_unit_ms=""
        fi
 }
 
diff --git a/scripts/crm-fence-peer.sh b/scripts/crm-fence-peer.sh
index 96786734..b0e4e0f1 100755
--- a/scripts/crm-fence-peer.sh
+++ b/scripts/crm-fence-peer.sh
@@ -252,10 +252,18 @@ setup_crm_timeout_unit_ms()
        # garbage", so we could get away with always appending "ms", but with
        # 2.0.5, it became g_option_context_parse G_OPTION_ARG_INT, which
        # "Cannot parse integer value “200ms” for --timeout" :-|
-       if crmadmin --help 2>&1 | grep -q -e "--timeout=.*in milliseconds"; then
-               crm_timeout_unit_ms=""
-       else
+       # Can not parse the help text reliably, because they changed content
+       # and organisation of the help text between 2.0.4 and 2.0.5.
+       # Just try using ms unit, and see if it fails.
+       if crmadmin -t 100ms --version &> /dev/null; then
+               # this is either a recent version that actually understands ms
+               # as part of the TIMESPEC, or a version that still uses atoi().
                crm_timeout_unit_ms="ms"
+       else
+               # this one likely failed with
+               # crmadmin: Cannot parse integer value “100ms” for -t
+               # (>= 2.0.5, < 2.1)
+               crm_timeout_unit_ms=""
        fi
 }
 
-- 
2.40.0

Reply via email to