Skip to content

add basic recovery logic to quorum driver

Liu Yuan qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 22 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8block/quorum: initialize qcrs.aiocb for readblock/quorum.c+12 -110 replies
2/8block: add driver operation callbacksblock.c include/block/block.h include/block/block_int.h+17 -04 replies
3/8block/sheepdog: propagate disconnect/reconnect events to upper driverblock/sheepdog.c+9 -02 replies
4/8block/quorum: add quorum_aio_release() helperblock/quorum.c+8 -41 reply
5/8quorum: fix quorum_aio_cancel()block/quorum.c+3 -14 replies
6/8block/quorum: add broken state to BlockDriverStateblock/quorum.c include/block/block_int.h+87 -182 replies
7/8block: add two helpersblock.c include/block/block.h+12 -01 reply
8/8quorum: add basic device recovery logicblock/quorum.c trace-events+191 -32 replies

Reviews trailers per patch

1 of 8 patches has a Reviewed-by or Acked-by.

PatchBenoît Canet
1/8
2/8
3/8
4/8R-b
5/8
6/8
7/8
8/8

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

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 0/8] add basic recovery logic to quorum driver

This patch set mainly add mainly two logics to implement device recover
- notify qourum driver of the broken states from the child driver(s)
- dirty track and sync the device after it is repaired

Thus quorum allow VMs to continue while some child devices are broken and when the child devices are repaired and return back, we sync dirty bits during downtime to keep data consistency.

The recovery logic is based on the driver state bitmap and will sync the dirty bits with a timeslice window in a coroutine in this prtimive implementation.

Simple graph about 2 children with threshold=1 and read-pattern=fifo:
(similary to DRBD)

+ denote device sync iteration
- IO on a single device
= IO on two devices

                                      sync complete, release dirty bitmap
                                         ^
                                         |
  ====-----------------++++----++++----++==========
     |                 |
     |                 v
     |               device repaired and begin to sync

v
device broken, create a dirty bitmap

This sync logic can take care of nested broken problem, that devices are broken while in sync. We just start a sync process after the devices are repaired again and switch the devices from broken to sound only when the sync completes.

For read-pattern=quorum mode, it enjoys the recovery logic without any problem.

Todo:
- use aio interface to sync data (multiple transfer in one go)
- dynamic slice window to control sync bandwidth more smoothly
- add auto-reconnection mechanism to other protocol (if not support yet)
- add tests

Cc Eric Blake <[email protected]>
Cc Benoit Canet <[email protected]>
Cc Kevin Wolf <[email protected]>
Cc Stefan Hajnoczi <[email protected]>

Liu Yuan (8):
block/quorum: initialize qcrs.aiocb for read
block: add driver operation callbacks
block/sheepdog: propagate disconnect/reconnect events to upper driver block/quorum: add quorum_aio_release() helper
quorum: fix quorum_aio_cancel()
block/quorum: add broken state to BlockDriverState
block: add two helpers
quorum: add basic device recovery logic

 block.c                   |  17 +++
 block/quorum.c            | 324 +++++++++++++++++++++++++++++++++++++++++-----
 block/sheepdog.c          |   9 ++
 include/block/block.h     |   9 ++
 include/block/block_int.h |   6 +
 trace-events              |   5 +
 6 files changed, 336 insertions(+), 34 deletions(-)
Signature · 1 line
1.9.1