Skip to content

mirror: cancel nbd reconnect

Vladimir Sementsov-Ogievskiy qemu-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest10 patches 5 repliesIn review
  2. v111 patches 24 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10block: add new BlockDriver handler: bdrv_cancel_in_flightblock/io.c include/block/block.h include/block/block_int.h+23 -00 replies
2/10block/nbd: implement .bdrv_cancel_in_flightblock/nbd.c+15 -01 reply
3/10block/raw-format: implement .bdrv_cancel_in_flight handlerblock/raw-format.c+6 -00 replies
4/10job: add .cancel handler for the driverinclude/qemu/job.h job.c+8 -01 reply
5/10block/mirror: implement .cancel job handlerblock/mirror.c+9 -00 replies
6/10iotests/264: move to python unittesttests/qemu-iotests/264 tests/qemu-iotests/264.out+58 -550 replies
7/10iotests.py: qemu_nbd_popen: remove pid file after usetests/qemu-iotests/iotests.py+5 -10 replies
8/10iotests/264: add mirror-cancel test-casetests/qemu-iotests/264 tests/qemu-iotests/264.out+32 -102 replies
9/10block/backup: implement .cancel job handlerblock/backup.c+10 -00 replies
10/10iotests/264: add backup-cancel test-casetests/qemu-iotests/264 tests/qemu-iotests/264.out+16 -90 replies

Reviews trailers per patch

All 10 patches have a Reviewed-by or Acked-by.

PatchEric Blake
1/10R-b
2/10R-b
3/10R-b
4/10R-b
5/10R-b
6/10R-b
7/10R-b
8/10R-b
9/10R-b
10/10R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 00/10] mirror: cancel nbd reconnect

Hi all!

The problem

Assume we have mirror job with nbd target node with enabled reconnect. Connection failed. So, all current requests to nbd node are waiting for nbd driver to reconnect. And they will wait for reconnect-delay time specified in nbd blockdev options. This timeout may be long enough, for example, we in Virtuozzo use 300 seconds by default.

So, if at this moment user tries to cancel the job, job will wait for its in-flight requests to finish up to 300 seconds. From the user point of view, cancelling the job takes a long time. Bad.

Solution

Let's just cancel "waiting for reconnect in in-flight request coroutines" on mirror (and backup) cancel. Welcome the series below.

v2: wording, rebase on master, add Eric's r-bs, update test-output in
last commit

Vladimir Sementsov-Ogievskiy (10):
block: add new BlockDriver handler: bdrv_cancel_in_flight block/nbd: implement .bdrv_cancel_in_flight block/raw-format: implement .bdrv_cancel_in_flight handler
job: add .cancel handler for the driver block/mirror: implement .cancel job handler iotests/264: move to python unittest
iotests.py: qemu_nbd_popen: remove pid file after use iotests/264: add mirror-cancel test-case block/backup: implement .cancel job handler iotests/264: add backup-cancel test-case

 include/block/block.h         |   3 +
 include/block/block_int.h     |   9 +++
 include/qemu/job.h            |   5 ++
 block/backup.c                |  10 +++
 block/io.c                    |  11 +++
 block/mirror.c                |   9 +++
 block/nbd.c                   |  15 ++++
 block/raw-format.c            |   6 ++
 job.c                         |   3 +
 tests/qemu-iotests/264        | 140 ++++++++++++++++++++++------------
 tests/qemu-iotests/264.out    |  20 ++---
 tests/qemu-iotests/iotests.py |   6 +-
 12 files changed, 172 insertions(+), 65 deletions(-)
Signature · 1 line
2.29.2