From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Changlong Xie <xiecl.fnst@cn.fujitsu.com>
Cc: Kevin Wolf <kwolf@redhat.com>, Alberto Garcia <berto@igalia.com>,
qemu devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v2 1/1] quorum: Change vote rules for 64 bits hash
Date: Thu, 18 Feb 2016 10:00:33 +0000 [thread overview]
Message-ID: <20160218100032.GD2438@work-vm> (raw)
In-Reply-To: <1455588944-29799-2-git-send-email-xiecl.fnst@cn.fujitsu.com>
* Changlong Xie (xiecl.fnst@cn.fujitsu.com) wrote:
> If quorum has two children(A, B). A do flush sucessfully, but B flush failed.
> We MUST choice A as winner rather than just pick anyone of them. Otherwise
> the filesystem of guest will become read-only with following errors:
>
> end_request: I/O error, dev vda, sector 11159960
> Aborting journal on device vda3-8
> EXT4-fs error (device vda3): ext4_journal_start_sb:327: Detected abort journal
> EXT4-fs (vda3): Remounting filesystem read-only
>
> Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
> Signed-off-by: Changlong Xie <xiecl.fnst@cn.fujitsu.com>
Hi,
That seems to fix the problem I was seeing; thanks.
(I don't know enough about the quorum layer to comment much more).
Dave
> ---
> block/quorum.c | 15 +++++++++++----
> 1 file changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/block/quorum.c b/block/quorum.c
> index 11cc60b..f094208 100644
> --- a/block/quorum.c
> +++ b/block/quorum.c
> @@ -447,7 +447,8 @@ static int quorum_compute_hash(QuorumAIOCB *acb, int i, QuorumVoteValue *hash)
> return 0;
> }
>
> -static QuorumVoteVersion *quorum_get_vote_winner(QuorumVotes *votes)
> +static QuorumVoteVersion *quorum_get_vote_winner(QuorumVotes *votes,
> + bool vote_error)
> {
> int max = 0;
> QuorumVoteVersion *candidate, *winner = NULL;
> @@ -456,6 +457,12 @@ static QuorumVoteVersion *quorum_get_vote_winner(QuorumVotes *votes)
> if (candidate->vote_count > max) {
> max = candidate->vote_count;
> winner = candidate;
> + continue;
> + }
> + /* For 64 bit hash */
> + if (vote_error && candidate->vote_count == max
> + && candidate->value.l == 0) {
> + winner = candidate;
> }
> }
>
> @@ -545,7 +552,7 @@ static int quorum_vote_error(QuorumAIOCB *acb)
> }
>
> if (error) {
> - winner = quorum_get_vote_winner(&error_votes);
> + winner = quorum_get_vote_winner(&error_votes, false);
> ret = winner->value.l;
> }
>
> @@ -610,7 +617,7 @@ static bool quorum_vote(QuorumAIOCB *acb)
> }
>
> /* vote to select the most represented version */
> - winner = quorum_get_vote_winner(&acb->votes);
> + winner = quorum_get_vote_winner(&acb->votes, false);
>
> /* if the winner count is smaller than threshold the read fails */
> if (winner->vote_count < s->threshold) {
> @@ -770,7 +777,7 @@ static coroutine_fn int quorum_co_flush(BlockDriverState *bs)
> quorum_count_vote(&error_votes, &result_value, i);
> }
>
> - winner = quorum_get_vote_winner(&error_votes);
> + winner = quorum_get_vote_winner(&error_votes, true);
> result = winner->value.l;
>
> quorum_free_vote_list(&error_votes);
> --
> 1.9.3
>
>
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
next prev parent reply other threads:[~2016-02-18 10:00 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-16 2:15 [Qemu-devel] [PATCH v2 0/1] change quorum vote rules for 64-bits hash Changlong Xie
2016-02-16 2:15 ` [Qemu-devel] [PATCH v2 1/1] quorum: Change vote rules for 64 bits hash Changlong Xie
2016-02-18 10:00 ` Dr. David Alan Gilbert [this message]
2016-02-18 15:16 ` Alberto Garcia
2016-02-19 8:26 ` Wen Congyang
2016-02-19 11:24 ` Alberto Garcia
2016-02-20 14:28 ` Max Reitz
2016-02-22 3:17 ` Changlong Xie
2016-02-22 9:02 ` Dr. David Alan Gilbert
2016-02-22 9:52 ` Changlong Xie
2016-02-22 9:59 ` Dr. David Alan Gilbert
2016-02-22 10:34 ` Kevin Wolf
2016-02-22 10:39 ` Dr. David Alan Gilbert
2016-02-23 2:55 ` Changlong Xie
2016-02-22 13:31 ` Alberto Garcia
2016-02-22 13:43 ` Alberto Garcia
2016-02-22 16:37 ` 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=20160218100032.GD2438@work-vm \
--to=dgilbert@redhat.com \
--cc=berto@igalia.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=xiecl.fnst@cn.fujitsu.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.