From: Stefan Hajnoczi <stefanha@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Cc: qemu-devel <qemu-devel@nongnu.org>,
qemu block <qemu-block@nongnu.org>, Jeff Cody <jcody@redhat.com>,
John Snow <jsnow@redhat.com>, Fam Zheng <famz@redhat.com>,
"Denis V. Lunev" <den@openvz.org>
Subject: Re: [Qemu-devel] backup notifier fail policy
Date: Mon, 3 Oct 2016 14:11:51 +0100 [thread overview]
Message-ID: <20161003131151.GB31993@stefanha-x1.localdomain> (raw)
In-Reply-To: <57EEB604.1090908@virtuozzo.com>
[-- Attachment #1: Type: text/plain, Size: 2182 bytes --]
On Fri, Sep 30, 2016 at 09:59:16PM +0300, Vladimir Sementsov-Ogievskiy wrote:
> On 30.09.2016 20:11, Vladimir Sementsov-Ogievskiy wrote:
> > Hi all!
> >
> > Please, can somebody explain me, why we fail guest request in case of io
> > error in write notifier? I think guest consistency is more important
> > than success of unfinished backup. Or, what am I missing?
> >
> > I'm saying about this code:
> >
> > static int coroutine_fn backup_before_write_notify(
> > NotifierWithReturn *notifier,
> > void *opaque)
> > {
> > BackupBlockJob *job = container_of(notifier, BackupBlockJob,
> > before_write);
> > BdrvTrackedRequest *req = opaque;
> > int64_t sector_num = req->offset >> BDRV_SECTOR_BITS;
> > int nb_sectors = req->bytes >> BDRV_SECTOR_BITS;
> >
> > assert(req->bs == blk_bs(job->common.blk));
> > assert((req->offset & (BDRV_SECTOR_SIZE - 1)) == 0);
> > assert((req->bytes & (BDRV_SECTOR_SIZE - 1)) == 0);
> >
> > return backup_do_cow(job, sector_num, nb_sectors, NULL, true);
> > }
> >
> > So, what about something like
> >
> > ret = backup_do_cow(job, ...
> > if (ret < 0 && job->notif_ret == 0) {
> > job->notif_ret = ret;
> > }
> >
> > return 0;
> >
> > and fail block job if notif_ret < 0 in other places of backup code?
> >
>
> And second question about notifiers in backup block job. If block job is
> paused, notifiers still works and can copy data. Is it ok? So, user thinks
> that job is paused, so he can do something with target disk.. But really,
> this 'something' will race with write-notifiers. So, what assumptions may
> user actually have about paused backup job? Is there any agreements? Also,
> on query-block-jobs we will see job.busy = false, when actually
> copy-on-write may be in flight..
I agree that the job should fail and the guest continues running.
The backup job cannot do the usual ENOSPC stop/resume error handling
since we lose snapshot consistency once guest writes are allowed to
proceed. Backup errors need to be fatal, resuming is usually not
possible. The user will have to retry the backup operation.
Stefan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
next prev parent reply other threads:[~2016-10-03 13:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-30 17:11 [Qemu-devel] backup notifier fail policy Vladimir Sementsov-Ogievskiy
2016-09-30 18:59 ` Vladimir Sementsov-Ogievskiy
2016-10-03 13:11 ` Stefan Hajnoczi [this message]
2016-10-03 18:07 ` John Snow
2016-10-04 9:23 ` Stefan Hajnoczi
2016-10-04 9:34 ` Kevin Wolf
2016-10-04 10:41 ` Denis V. Lunev
2016-10-04 11:55 ` Kevin Wolf
2016-10-04 16:02 ` Stefan Hajnoczi
2016-10-04 16:03 ` John Snow
2016-10-04 16:19 ` Denis V. Lunev
2016-10-05 8:12 ` Kevin Wolf
2016-10-05 12:59 ` Stefan Hajnoczi
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=20161003131151.GB31993@stefanha-x1.localdomain \
--to=stefanha@redhat.com \
--cc=den@openvz.org \
--cc=famz@redhat.com \
--cc=jcody@redhat.com \
--cc=jsnow@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@virtuozzo.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).