All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Liu Yuan <namei.unix@gmail.com>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, Benoit Canet <benoit@irqsave.net>,
	Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2] block/quorum: add simple read pattern support
Date: Mon, 14 Jul 2014 21:33:59 -0600	[thread overview]
Message-ID: <53C4A127.8010500@redhat.com> (raw)
In-Reply-To: <1405394393-24154-1-git-send-email-namei.unix@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2313 bytes --]

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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2014-07-15  3:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-15  3:19 [Qemu-devel] [PATCH v2] block/quorum: add simple read pattern support Liu Yuan
2014-07-15  3:33 ` Eric Blake [this message]
2014-07-15  4:13   ` Liu Yuan
2014-07-15  4:44     ` Eric Blake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53C4A127.8010500@redhat.com \
    --to=eblake@redhat.com \
    --cc=benoit@irqsave.net \
    --cc=kwolf@redhat.com \
    --cc=namei.unix@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.