Skip to contentSkip to conversation

drbd: Ignore negotiation result with the peer who is also negotiating

PATCH In review Zhang Duan 2 participants 2 messages Mar 2, 2020 – Mar 5, 2020 DRBD driver

lore
Share & tools
lore

Zhang Duan

author
#0 lore raw

PATCH 1/1 drbd: Ignore negotiation result with the peer who is also negotiating

We have a test on 3 nodes cluster in which the primary is uptodate and the other two secondary is diskless by doing drbdadm detach. Then after doing drbdadm attach on the two secondary at the same time, one status hangs at NEGOTIATING while another hangs at ATTACHING.

That is because if a negotiating peer receives another's wide-cluster-change from DISKLESS to NEGOTIATING, it will reject it due to more than one negotiation throughout the cluster, but the new disk state of that node remains NEGOTIATING after a failed state change. Then neither of two peers can get a negotiating result what they want.

Signed-off-by ZhangDuan

---
drbd/drbd_state.c | 4 +++-

1 file changed, 3 insertions(+), 1 deletion(-)
drbd/drbd_state.c +0 -0
index c919d759..85910f1e 100644
@@ -1835,8 +1835,10 @@ static void sanitize_state(struct drbd_resource *resource)

for_each_peer_device_rcu(peer_device, device) {
enum drbd_repl_state nr = peer_device->negotiation_result; enum drbd_disk_state pdsk = peer_device->disk_state[NEW];
+ enum drbd_disk_state pdsk_old = peer_device->disk_state[OLD];

- if (pdsk == D_UNKNOWN || pdsk < D_NEGOTIATING)
+ if ((pdsk == D_UNKNOWN || pdsk < D_NEGOTIATING) ||
+ (pdsk_old < D_NEGOTIATING && pdsk == D_NEGOTIATING)) continue;

if (pdsk == D_UP_TO_DATE)

Signature · 5 lines
2.24.0.windows.2

-- 
Sincerely Yours,
Zhang Duan
#1 lore raw

Hi Philipp,

     What's your opinion on this patch?

Thanx

Yang

Quoted 39 lines · Zhang Duan

We have a test on 3 nodes cluster in which the primary is uptodate and the other two secondary is diskless by doing drbdadm detach. Then after doing drbdadm attach on the two secondary at the same time, one status hangs at NEGOTIATING while another hangs at ATTACHING.

That is because if a negotiating peer receives another's wide-cluster-change from DISKLESS to NEGOTIATING, it will reject it due to more than one negotiation throughout the cluster, but the new disk state of that node remains NEGOTIATING after a failed state change. Then neither of two peers can get a negotiating result what they want.

Signed-off-by ZhangDuan

---
drbd/drbd_state.c | 4 +++-

1 file changed, 3 insertions(+), 1 deletion(-)
drbd/drbd_state.c +3 -1
index c919d759..85910f1e 100644
@@ -1835,8 +1835,10 @@ static void sanitize_state(struct drbd_resource 
 *resource)
 for_each_peer_device_rcu(peer_device, device) {
 enum drbd_repl_state nr = peer_device->negotiation_result;
 enum drbd_disk_state pdsk = peer_device->disk_state[NEW];
+ enum drbd_disk_state pdsk_old = peer_device->disk_state[OLD];
 
- if (pdsk == D_UNKNOWN || pdsk < D_NEGOTIATING)
+ if ((pdsk == D_UNKNOWN || pdsk < D_NEGOTIATING) ||
+ (pdsk_old < D_NEGOTIATING && pdsk == D_NEGOTIATING))
 continue;
 

if (pdsk == D_UP_TO_DATE)

Signature · 5 lines
2.24.0.windows.2

-- 
Sincerely Yours,
Zhang Duan