From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41948) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X6tVL-0004lP-QK for qemu-devel@nongnu.org; Mon, 14 Jul 2014 23:34:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X6tVG-0003HQ-3f for qemu-devel@nongnu.org; Mon, 14 Jul 2014 23:34:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:13123) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X6tVF-0003GG-Qj for qemu-devel@nongnu.org; Mon, 14 Jul 2014 23:34:06 -0400 Message-ID: <53C4A127.8010500@redhat.com> Date: Mon, 14 Jul 2014 21:33:59 -0600 From: Eric Blake MIME-Version: 1.0 References: <1405394393-24154-1-git-send-email-namei.unix@gmail.com> In-Reply-To: <1405394393-24154-1-git-send-email-namei.unix@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wRttKxfB8UqOnPQPEnMvseBWlIP9C9aMn" Subject: Re: [Qemu-devel] [PATCH v2] block/quorum: add simple read pattern support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Liu Yuan , qemu-devel@nongnu.org Cc: Kevin Wolf , Benoit Canet , Stefan Hajnoczi This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --wRttKxfB8UqOnPQPEnMvseBWlIP9C9aMn Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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. >=20 > This patch generalize the above 2 nodes case in the N nodes. That is, >=20 > vm -> write to all the N nodes, read just one of them. If single read f= ails, we > try to read next node in FIFO order specified by the startup command. >=20 > 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 w= ith DRBD > we still have some advantages over it: >=20 > +++ b/block.c > @@ -2212,7 +2212,7 @@ int bdrv_commit(BlockDriverState *bs) > =20 > if (!drv) > return -ENOMEDIUM; > - =20 > + > 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). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --wRttKxfB8UqOnPQPEnMvseBWlIP9C9aMn Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTxKEnAAoJEKeha0olJ0Nqr18IAIAE+PBwoEiRXinWfzDKxZeX CBRwDP7tI4LzKy6+RmXJ3T/XFE93GdToyHXXy2pMln2RBMM9+iD8yWCfS3XNuLJ1 r7IfjAt93ZMr2QPgIIOI0kiNuhSUp7uBXrkGcbtubr1z4b1gX6Fq3wd9fnpp3Xme IFbHgf9DctitIhZzikmG0uufwsm92k8/f4jkis7rxgi9q9jvPzF4Fr/sYmNAxD4A 3PhNXKz4rT+veGmaDEDPt4Spn3mN26/dGHqXaNpP8vNxZ+rGmvRJwv+5F01I6U/w kxAYk3QJoQvaxsW9PbMDx16a5qDEg3QI8QVnT/xYi/CiTR/cN1ZKbqLG+tH58Mc= =bR1G -----END PGP SIGNATURE----- --wRttKxfB8UqOnPQPEnMvseBWlIP9C9aMn--