drbd: reply cancel to source when target of verify becomes inconsistent
PATCH 1/1 drbd: reply cancel to source when target of verify becomes inconsistent
Consider one situation below:
1. primary A disconnects with secondary B & C both of which are Uptodate
2. start a verify from B to C
3. during the verify above, A reconnects and starts a resync to C because of primary-lost-quorum
4. C becomes resync target and Inconsistent, then ignore the verify requests from B which are already in its receive buffer
5. verify from B to C stalls here
To resolve it, at step 4, C should reply a message of P_RS_CANCEL to B
Here is the result if do that:
Nov 6 16:25:46 node-2 kernel: drbd drbd1/0 drbd1 node-3: Skipped verify, too busy: start=170208, size=48 (sectors)
Nov 6 16:25:46 node-2 kernel: drbd drbd1/0 drbd1 node-3: Online verify done but 6 4k blocks skipped (total 314 sec; paused 0 sec; 3336 K/sec) Nov 6 16:25:46 node-2 kernel: drbd drbd1/0 drbd1 node-3: repl( VerifyS -> Established )
---drbd/drbd_receiver.c | 2 ++
1 file changed, 2 insertions(+)
drbd/drbd_receiver.c +0 -0
@@ -3273,6 +3273,8 @@ static int receive_DataRequest(struct drbd_connection *connection, struct packet
break;
case P_OV_REQUEST:verify_skipped_block(peer_device, sector, size);
+ drbd_send_ack_rp(peer_device, P_RS_CANCEL, p);
+ break;
/* Fall through */
case P_RS_THIN_REQ:
case P_RS_DATA_REQUEST:
Signature · 5 lines
2.24.0.windows.2 -- Sincerely Yours, Zhang Duan