All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: Max Reitz <mreitz@redhat.com>, qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, armbru@redhat.com, kwolf@redhat.com,
	jsnow@redhat.com
Subject: Re: [PATCH RFC 0/3] mirror: rework soft-cancelling READY mirror
Date: Thu, 29 Jul 2021 14:35:12 +0300	[thread overview]
Message-ID: <af37e046-46d3-2791-f91d-bdbaec9ee5e5@virtuozzo.com> (raw)
In-Reply-To: <660d9a7b-beb9-c2a2-33eb-d894aae8b1e0@redhat.com>

29.07.2021 13:38, Max Reitz wrote:
> On 29.07.21 12:02, Vladimir Sementsov-Ogievskiy wrote:
>> 28.07.2021 10:00, Max Reitz wrote:
>>> On 27.07.21 18:47, Vladimir Sementsov-Ogievskiy wrote:
>>>> Hi all!
>>>>
>>>> That's an alternative to (part of) Max's
>>>> "[PATCH for-6.1? v2 0/7] mirror: Handle errors after READY cancel"
>>>> and shows' my idea of handling soft-cancelling READY mirror case
>>>> directly in qmp_block_job_cancel. And cleanup all other job cancelling
>>>> functions.
>>>>
>>>> That's untested draft, don't take it to heart :)
>>>
>>> Well, I would have preferred it if you’d rebased this on top of that series, precisely because it’s an alternative to only part of it. And if it’s just an untested draft, that would have been even better, because it would’ve given a better idea on what the cleanup looks like.
>>>
>>> There are also things like this series making cancel internally always a force-cancel, where I’m not sure whether we want that in the replication driver or not[1].  With my series, we add an explicit parameter, so we’re forced to think about it, and then in this series on top we can just drop the parameter for all force-cancel invocations again, and for all non-force-cancel invocations we would have to think a bit more.
>>
>> I now don't sure that patch 5 of your series is correct (see my last answer to it), that's why I decided to not base on it.
> 
> Well, we can always take patch 5 from v1.  (Where I changed any job_is_cancelled() to job_cancel_requested() when it influenced the external interface.)
> 
>> My series has the benefit of handling soft-mirror-cancel case the other way and handles mirror finalization in case of soft-cancel properly.
>>
>>>
>>> Specifically as for this series, I don’t like job_complete_ex() very much, I think the parameter should be part of job_complete() itself.
>>
>> That was my idea. But job_complete is passed as function pointer, so changing its prototype would be more work.. But I think it's possible.
>>
>>>   If we think that’s too specific of a mirror parameter to include in normal job_complete(), well, then there shouldn’t be a job_complete_ex() either, and do_graph_change should be a property of the mirror job (perhaps as pivot_on_completion) that’s cleared by qmp_block_job_cancel() before invoking job_complete().
>>
>> This way users will lose a way to make a decision during job running..
> 
> On the contrary, it would be a precursor to letting the user change this property explicitly with a new QMP command.
> 
>> But probably they don't need actually. Moving the option to mirror job parameter seems a good option to me.
>>
>>>
>>> Max
>>>
>>> [1] Although looking at it again now, it probably wants force-cancel.
>>>
>>
>>
>> What do you think of my idea to keep old bugs as is and just deprecate block-job-cancel and add a new interface for "no-graph-change mirror" case?
> 
> I don’t see a reason for that.  The fix isn’t that complicated.
> 
> Also, honestly, I don’t see a good reason for deprecating anything.
> 

Current interface lead to mess in the code, that's bad. Cancellation mode that is actually a kind of completion (and having comments in many places about that) - that shows for me that interface is not good.. It's a question of terminology, what to call "cancel". Also, that's not the first time this question arise. Remember my recent cancel-in-flight-requests series, when I thought that "cancel is cancel" and didn't consider soft-cancel of mirror.. And reviewers didn't caught it. I don't think that interface is good, it will always confuse new developers and users. But that's just my opinion, I don't impose it )

If not deprecate, i.e. if we consider old interface to be good, than no reason for this my series and for introducing new interface :)

-- 
Best regards,
Vladimir


  reply	other threads:[~2021-07-29 11:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-27 16:47 [PATCH RFC 0/3] mirror: rework soft-cancelling READY mirror Vladimir Sementsov-Ogievskiy
2021-07-27 16:47 ` [PATCH 1/3] job: add job_complete_ex with do_graph_change argument Vladimir Sementsov-Ogievskiy
2021-07-27 16:47 ` [PATCH 2/3] job: use complete(do_graph_change=false) to handle soft cancel Vladimir Sementsov-Ogievskiy
2021-07-27 16:47 ` [PATCH 3/3] job: drop force argument of *job*cancel Vladimir Sementsov-Ogievskiy
2021-07-27 16:56 ` [PATCH RFC 0/3] mirror: rework soft-cancelling READY mirror Vladimir Sementsov-Ogievskiy
2021-07-28  7:00 ` Max Reitz
2021-07-29 10:02   ` Vladimir Sementsov-Ogievskiy
2021-07-29 10:38     ` Max Reitz
2021-07-29 11:35       ` Vladimir Sementsov-Ogievskiy [this message]
2021-07-29 13:47         ` Max Reitz
2021-07-29 16:29           ` Vladimir Sementsov-Ogievskiy
2021-07-30 15:11             ` Max Reitz

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=af37e046-46d3-2791-f91d-bdbaec9ee5e5@virtuozzo.com \
    --to=vsementsov@virtuozzo.com \
    --cc=armbru@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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.