drbd:clear NEW_CUR_UUID when uuid was actually created
PATCH 1/1 drbd:clear NEW_CUR_UUID when uuid was actually created
If there is an IO blocked by creating new uuid, but we found we dont have quorum, then NEW_CUR_UUID will be cleared but new uuid was not actually created.
After one peer online, we have enough quorum to continue IO, then this IO will reach primary and the online peer.
But if there is another peer join later, this peer will found same uuid, and will lose data.
So don't clear NEW_CUR_UUID unless uuid was actually created.
--- drbd/drbd_sender.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drbd/drbd_sender.c +4 -2
@@ -2360,15 +2360,17 @@ void drbd_check_peers_new_current_uuid(struct drbd_device *device)drbd_check_peers (resource); -if (device->have_quorum[NOW ] &&drbd_data_accessible (device,NOW )) +if (device->have_quorum[NOW ] &&drbd_data_accessible (device,NOW )) {drbd_uuid_new_current (device, false); +clear_bit (NEW_CUR_UUID , &device->flags); + } }static void make_new_current_uuid (struct drbd_device *device) {drbd_check_peers_new_current_uuid (device); -get_work_bits (1UL <<NEW_CUR_UUID |1UL <<WRITING_NEW_CUR_UUID , &device->flags); +clear_bit (WRITING_NEW_CUR_UUID , &device->flags);wake_up (&device->misc_wait); }
Signature · 1 line
1.8.3.1
Hi Xu,
You mentioned in your other message that this patch is intended for DRBD 9.0.
https://lists.linbit.com/pipermail/drbd-dev/2022-April/006577.html
I'm afraid that the 9.0 branch is end-of-life, so this won't be applied. The drbd-9.1 branch is the place for improvements, especially since it already contains related fixes to the handling of suspended IO due to quorum loss.
Thank you for your participation in the project nevertheless!
Best regards,
Joel