Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP5:Update
drbd
bsc-1203931-11_drbd-Fix-a-temporarily-paused-re...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bsc-1203931-11_drbd-Fix-a-temporarily-paused-resync-to-make-progres.patch of Package drbd
From 126f29989c82138a4a74426dddb28bb5d44ff076 Mon Sep 17 00:00:00 2001 From: Philipp Reisner <philipp.reisner@linbit.com> Date: Wed, 4 Sep 2019 13:32:46 +0200 Subject: [PATCH] drbd: Fix a temporarily paused resync to make progress after the pause With 3 nodes or more we can construct a scenario where a resync gets interrupted by an other resync pausing the first resync operation. The higher priority resync makes the first resync's progress to go backward. in drbd_rs_c_min_rate_throttle() the db value is an unsigned variable db = peer_device->rs_mark_left[i] - rs_left; that becomes negative, aahm very big positive, and then dbdt is always bigger than c_min_rate und it tells the caller to halt the resync forever. Avoid all that by initializing the resync marks after a pause --- drbd/drbd_state.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/drbd/drbd_state.c b/drbd/drbd_state.c index bf20935f7d73..5f9d7c8aded0 100644 --- a/drbd/drbd_state.c +++ b/drbd/drbd_state.c @@ -2178,12 +2178,23 @@ static void queue_after_state_change_work(struct drbd_resource *resource, } } -static void initialize_resync(struct drbd_peer_device *peer_device) +static void initialize_resync_progress_marks(struct drbd_peer_device *peer_device) { unsigned long tw = drbd_bm_total_weight(peer_device); unsigned long now = jiffies; int i; + for (i = 0; i < DRBD_SYNC_MARKS; i++) { + peer_device->rs_mark_left[i] = tw; + peer_device->rs_mark_time[i] = now; + } +} + +static void initialize_resync(struct drbd_peer_device *peer_device) +{ + unsigned long tw = drbd_bm_total_weight(peer_device); + unsigned long now = jiffies; + peer_device->rs_failed = 0; peer_device->rs_paused = 0; peer_device->rs_same_csum = 0; @@ -2191,11 +2202,7 @@ static void initialize_resync(struct drbd_peer_device *peer_device) peer_device->rs_total = tw; peer_device->rs_start = now; peer_device->rs_last_writeout = now; - for (i = 0; i < DRBD_SYNC_MARKS; i++) { - peer_device->rs_mark_left[i] = tw; - peer_device->rs_mark_time[i] = now; - } - + initialize_resync_progress_marks(peer_device); drbd_rs_controller_reset(peer_device); } @@ -2342,6 +2349,7 @@ static void finish_state_change(struct drbd_resource *resource, struct completio drbd_info(peer_device, "Syncer continues.\n"); peer_device->rs_paused += (long)jiffies -(long)peer_device->rs_mark_time[peer_device->rs_last_mark]; + initialize_resync_progress_marks(peer_device); if (repl_state[NEW] == L_SYNC_TARGET) mod_timer(&peer_device->resync_timer, jiffies); } -- 2.26.2
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor