From: Eric Blake <eblake@redhat.com>
To: Liu Yuan <namei.unix@gmail.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
Benoit Canet <benoit@irqsave.net>
Subject: Re: [Qemu-devel] [PATCH v2] block/quorum: add simple read pattern support
Date: Mon, 14 Jul 2014 22:44:49 -0600 [thread overview]
Message-ID: <53C4B1C1.9020403@redhat.com> (raw)
In-Reply-To: <20140715041323.GC15811@ubuntu-trusty>
[-- Attachment #1: Type: text/plain, Size: 1919 bytes --]
On 07/14/2014 10:13 PM, Liu Yuan wrote:
>>> + '*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'
>
> For startup command line, did it imply a change too? Sorry I'm not familiar with
> block-core.json.
Adding an enum in the .json file will generate an enum that you can
reuse in your parsing code (look at commit 82a402e99,
parse_enum_option). The command line will be the same, but instead of
open-coding things, you can now use the same enum as what the QMP code
will use.
>
> With your suggestion, how we pass read-pattern via qmp?
>
> read-pattern: fifo
> or
> read-pattern: quorum
The QMP wire format will be identical - the user still passes
"read-pattern":"fifo" as part of building up their JSON. It's just that
the string "fifo" is now validated for correctness against the enum of
valid strings, instead of being open-ended anything goes.
>
>
>>
>> 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).
>
> I guess so. 'round-robin' in your context would benefit use case seeking for
> better read load balance.
Of course, if you do add 'round-robin', do it in a separate patch; and
that's also a case where having the enum list valid modes will make it
easier to add in a new mode.
--
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 --]
prev parent reply other threads:[~2014-07-15 4:45 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
2014-07-15 4:13 ` Liu Yuan
2014-07-15 4:44 ` Eric Blake [this message]
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=53C4B1C1.9020403@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.