Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package drbd for openSUSE:Factory checked in 
at 2026-08-17 16:58:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/drbd (Old)
 and      /work/SRC/openSUSE:Factory/.drbd.new.1258 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "drbd"

Mon Aug 17 16:58:58 2026 rev:123 rq:1371461 version:9.1.23

Changes:
--------
--- /work/SRC/openSUSE:Factory/drbd/drbd.changes        2026-03-31 
15:24:39.690249719 +0200
+++ /work/SRC/openSUSE:Factory/.drbd.new.1258/drbd.changes      2026-08-17 
17:02:14.114905836 +0200
@@ -0,0 +1,8 @@
+------------------------------------------------------------------
+Fri Aug 14 08:12:21 UTC 2026 - Su Yue <[email protected]>
+
+- L3: drbdadm status shows replication:WFBitMapS peer-disk:Consistent 
(bsc#1271076)
+  * Add suse special patch
+    + bsc-1271076-drbd-consider-resync-after-peer-forced-Primary-from-.patch
+          
+-------------------------------------------------------------------

New:
----
  bsc-1271076-drbd-consider-resync-after-peer-forced-Primary-from-.patch

----------(New B)----------
  New:  * Add suse special patch
    + bsc-1271076-drbd-consider-resync-after-peer-forced-Primary-from-.patch
          
----------(New E)----------

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

Other differences:
------------------
++++++ drbd.spec ++++++
--- /var/tmp/diff_new_pack.6ETXA5/_old  2026-08-17 17:02:16.249981273 +0200
+++ /var/tmp/diff_new_pack.6ETXA5/_new  2026-08-17 17:02:16.256981521 +0200
@@ -46,7 +46,9 @@
 
 # suse special patch
 Patch1001:  bsc-1025089_fix-resync-finished-with-syncs-have-bits-set.patch
-Patch1002:  suse-coccinelle.patch
+Patch1002:  
bsc-1271076-drbd-consider-resync-after-peer-forced-Primary-from-.patch
+Patch1003:  suse-coccinelle.patch
+
 ########################
 
 #https://github.com/openSUSE/rpmlint-checks/blob/master/KMPPolicyCheck.py

++++++ bsc-1271076-drbd-consider-resync-after-peer-forced-Primary-from-.patch 
++++++
>From d74c33464678b0a648c86323e19a9cb0c4967da4 Mon Sep 17 00:00:00 2001
From: Su Yue <[email protected]>
Date: Tue, 14 Jul 2026 12:22:58 +0800
Subject: [PATCH] drbd: consider resync after peer forced Primary from
 Outdated/Outdated

When a node is force-promoted to Primary with --force while both nodes
are Outdated, it generates a new current data generation UUID.

If they are connected, the state change transition updates the peer disk
state to UpToDate. However, because if both nodes were Outdated,
the state machine does not automatically trigger a sync handshake
(the CONSIDER_RESYNC flag is only set if both disks were D_INCONSISTENT).

CONSIDER_RESYNC was only armed when both sides' previous disk state was
D_INCONSISTENT. When both disks are D_OUTDATED instead (e.g. after both
nodes were explicitly outdated and reconnected) and one side is then
force-promoted to Primary/D_UP_TO_DATE, only the promoted node redoes
the UUID handshake and moves to L_WF_BITMAP_S. The peer never arms
CONSIDER_RESYNC, stays in L_ESTABLISHED, and drops the
incoming bitmap in receive_bitmap() with "unexpected repl_state
(Established) in receive_bitmap". The two nodes then diverge
permanently: the Primary stuck at WFBitMapS/Consistent, the Secondary
falsely reporting UpToDate/UpToDate.

To reproduce:
====================================
ssh node2 drbdadm down drbd0
sleep 1
drbdadm down drbd0
sleep 1
drbdadm outdate drbd0 && drbdadm up drbd0
sleep 1
ssh node2 "drbdadm outdate drbd0 && drbdadm up drbd0 "
sleep 1
drbdadm status
echo "node2 drbdadm status:"
ssh node2 drbdadm status
drbdadm primary --force drbd0
drbdadm status
ssh node2 drbdadm status
====================================

Fix this by expanding the CONSIDER_RESYNC check in finish_state_change()
to also cover D_OUTDATED disk states when the peer is force-promoted to
Primary and UpToDate. This successfully triggers the subsequent handshake,
completing the resync and elevating both nodes disks to UpToDate cleanly.

Signed-off-by: Su Yue <[email protected]>
Reviewed-by: Heming Zhao <[email protected]>
Co-Authored-By: Claude Fable 5 <[email protected]>
Co-Authored-By: Gemini <[email protected]>
---
 drbd/drbd_state.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/drbd/drbd_state.c b/drbd/drbd_state.c
index f498eaa60396..54cc9cd934ba 100644
--- a/drbd/drbd_state.c
+++ b/drbd/drbd_state.c
@@ -2780,9 +2780,16 @@ static void finish_state_change(struct drbd_resource 
*resource, const char *tag)
                                        }
                                }
 
-                               /* Peer was forced D_UP_TO_DATE & R_PRIMARY, 
consider to resync */
-                               if (disk_state[OLD] == D_INCONSISTENT &&
-                                   peer_disk_state[OLD] == D_INCONSISTENT && 
peer_disk_state[NEW] == D_UP_TO_DATE &&
+                               /* Peer was forced D_UP_TO_DATE & R_PRIMARY, 
consider to resync.
+                                * Also cover D_OUTDATED, not just 
D_INCONSISTENT: e.g. after both
+                                * nodes were D_OUTDATED (both --outdate'd, 
then reconnected) and
+                                * one side is force-promoted to 
Primary/D_UP_TO_DATE, we still
+                                * need to redo the handshake here, or we get 
stuck: the newly
+                                * forced Primary moves on to L_WF_BITMAP_S and 
sends its bitmap,
+                                * while we never armed CONSIDER_RESYNC and 
stay in L_ESTABLISHED. */
+                               if ((disk_state[OLD] == D_INCONSISTENT || 
disk_state[OLD] == D_OUTDATED) &&
+                                   (peer_disk_state[OLD] == D_INCONSISTENT || 
peer_disk_state[OLD] == D_OUTDATED) &&
+                                   peer_disk_state[NEW] == D_UP_TO_DATE &&
                                    peer_role[OLD] == R_SECONDARY && 
peer_role[NEW] == R_PRIMARY)
                                        set_bit(CONSIDER_RESYNC, 
&peer_device->flags);
 
-- 
2.54.0

Reply via email to