qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* about mirror cancel
@ 2021-04-15 18:46 Vladimir Sementsov-Ogievskiy
  2021-04-16  7:05 ` Max Reitz
  0 siblings, 1 reply; 4+ messages in thread
From: Vladimir Sementsov-Ogievskiy @ 2021-04-15 18:46 UTC (permalink / raw)
  To: qemu block; +Cc: qemu-devel, Max Reitz, Kevin Wolf, Eric Blake, Denis V. Lunev

Hi all!

Recently I've implemented fast-cancelling of mirror job: do bdrv_cancel_in_flight() in mirror_cancel().

Now I'm in doubt: is it a correct thing? I heard, that mirror-cancel is a kind of valid mirror completion..

Looking at documentation:

# Note that if you issue 'block-job-cancel' after 'drive-mirror' has indicated
# (via the event BLOCK_JOB_READY) that the source and destination are
# synchronized, then the event triggered by this command changes to
# BLOCK_JOB_COMPLETED, to indicate that the mirroring has ended and the
# destination now has a point-in-time copy tied to the time of the cancellation.

So, in other words, do we guarantee something to the user, if it calls mirror-cancel in ready state? Does this abuse exist in libvirt?

====

Note, that if cancelling all in-flight requests on target is wrong on mirror cancel, we still don't have real bug, as the only implementation of .bdrv_cancel_in_flight is stopping reconnect waiting in nbd driver. So, we'll cancel requests only if connection is already lost anyway.

But that probably means, that correct name of the handler would be .bdrv_cancel_in_fligth_requests_that_will_most_probably_fail_anyway()..

And it also means, that abuse of mirror-cancel as valid completion is a bad idea, as we can't distinguish the cases when user calls job-cancel to have a kind of point-in-time copy, or just to cancel job (and being not interested in the final state of target).

So, probably we need an option boolean argument for blockjob-cancel, like "hard", that will cancel in-flight writes on target node..

-- 
Best regards,
Vladimir


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-04-16  7:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-15 18:46 about mirror cancel Vladimir Sementsov-Ogievskiy
2021-04-16  7:05 ` Max Reitz
2021-04-16  7:11   ` Max Reitz
2021-04-16  7:45     ` Vladimir Sementsov-Ogievskiy

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).