[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2] block/quorum: add simple read pattern suppor
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v2] block/quorum: add simple read pattern support |
Date: |
Mon, 14 Jul 2014 21:33:59 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 |
On 07/14/2014 09:19 PM, Liu Yuan wrote:
> This patch adds single read pattern to quorum driver and quorum vote is
> default
> pattern.
>
> This patch generalize the above 2 nodes case in the N nodes. That is,
>
> vm -> write to all the N nodes, read just one of them. If single read fails,
> we
> try to read next node in FIFO order specified by the startup command.
>
> The 2 nodes case is very similar to DRBD[1] though lack of auto-sync
> functionality in the single device/node failure for now. But compared with
> DRBD
> we still have some advantages over it:
>
> +++ b/block.c
> @@ -2212,7 +2212,7 @@ int bdrv_commit(BlockDriverState *bs)
>
> if (!drv)
> return -ENOMEDIUM;
> -
> +
> if (!bs->backing_hd) {
> return -ENOTSUP;
> }
While this whitespace cleanup is nice, it doesn't belong in this patch,
when there is no other change to this unrelated file.
> +++ b/qapi/block-core.json
> @@ -1398,12 +1398,17 @@
> # @rewrite-corrupted: #optional rewrite corrupted data when quorum is reached
> # (Since 2.1)
> #
> +# @read-pattern: #optional choose quorum or fifo pattern for read
> +# set to quorum by default (Since 2.2)
> +#
> # Since: 2.0
> ##
> { 'type': 'BlockdevOptionsQuorum',
> 'data': { '*blkverify': 'bool',
> 'children': [ 'BlockdevRef' ],
> - 'vote-threshold': 'int', '*rewrite-corrupted': 'bool' } }
> + 'vote-threshold': 'int',
> + '*rewrite-corrupted': 'bool',
> + '*read-pattern': 'str' } }
Raw strings that encode a finite set of values are bad for type-safety.
Please add an enum:
{ 'enum': 'QuorumReadPattern', 'data': [ 'quorum', 'fifo' ] }
then use '*read-pattern': 'QuorumReadPattern'
Should we offer multiple modes in addition to 'quorum'? For example, I
could see a difference between 'fifo' (favor read from the first quorum
member always, unless it fails, good when the first member is local and
other member is remote) and 'round-robin' (evenly distribute reads; each
read goes to the next available quorum member, good when all members are
equally distant).
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature