Received: from eggs.gnu.org ([2001:4830:134:3::10]:46426) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZADeV-00033B-JD for qemu-devel@nongnu.org; Wed, 01 Jul 2015 04:45:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZADeS-0005U6-2c for qemu-devel@nongnu.org; Wed, 01 Jul 2015 04:45:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42645) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZADeR-0005Tu-Py for qemu-devel@nongnu.org; Wed, 01 Jul 2015 04:45:51 -0400 Date: Wed, 1 Jul 2015 09:45:49 +0100 From: Stefan Hajnoczi Message-ID: <20150701084549.GC13991@stefanha-thinkpad.redhat.com> References: <1435234332-581-1-git-send-email-stefanha@redhat.com> <1435234332-581-8-git-send-email-stefanha@redhat.com> <5591C90C.4020902@redhat.com> <20150630152755.GF31899@stefanha-thinkpad.redhat.com> <5592BB56.4020306@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Y5rl02BVI9TCfPar" Content-Disposition: inline In-Reply-To: <5592BB56.4020306@redhat.com> Subject: Re: [Qemu-devel] [PATCH 07/10] block/backup: support block job transactions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow Cc: Kevin Wolf , famz@redhat.com, Jeff Cody , qemu-devel@nongnu.org, mreitz@redhat.com, vsementsov@parallels.com --Y5rl02BVI9TCfPar Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 30, 2015 at 11:52:54AM -0400, John Snow wrote: > On 06/30/2015 11:27 AM, Stefan Hajnoczi wrote: > > On Mon, Jun 29, 2015 at 06:39:08PM -0400, John Snow wrote: > >> On 06/25/2015 08:12 AM, Stefan Hajnoczi wrote: > >>> @@ -537,6 +539,9 @@ void backup_start(BlockDriverState *bs, BlockDriv= erState *target, > >>> job->sync_mode =3D sync_mode; > >>> job->sync_bitmap =3D sync_mode =3D=3D MIRROR_SYNC_MODE_DIRTY_BIT= MAP ? > >>> sync_bitmap : NULL; > >>> + if (job->sync_bitmap) { > >>> + block_job_txn_add_job(txn, &job->common); > >>> + } > >> > >> Hmm, is this what we want? This will add backup jobs to a transaction > >> only if they have a bitmap attached to the job. > >> > >> However, if we're doing a mixture of full and incremental backups, we > >> may still want to roll back the incremental backups if the full backups > >> failed as part of the transaction. > >> > >> The (admittedly more complicated) design I submitted will always add a > >> job to the transactional group, whether it has a bitmap or not. The > >> membership test was only if it was launched by the backup transaction > >> action. The bitmap is only checked for purposes of refcounting and > >> cleanup mechanics. > >> > >> Maybe that wasn't what we wanted either, but this is a difference in h= ow > >> our series will behave. > >=20 > > The 'backup' operation was added to the QMP 'transaction' command in > > QEMU 1.6. If we add non-incremental backup commands to the transaction > > then behavior changes. > >=20 >=20 > Ugh, good point... >=20 > > Perhaps DriveBackup and BlockdevBackup QAPI structures should take an > > optional 'transaction' bool argument. That way the caller decides which > > behavior to use. > >=20 >=20 > The way my version operated only changed the cleanup behavior -- it > didn't attempt to cancel other jobs if they failed or not. It naively > let them finish, then performed cleanup based on the overall completion > status. >=20 > That let the old behavior continue working like it did, but changed how > incrementals worked upon completion. >=20 > (1) Perhaps we can change the forced cancellation aspect and just allow > jobs to finish naturally even in the event of failure. It's wasteful, > but it does allow us to maintain the existing behavior while getting the > behavior we want for incremental transactions. >=20 > (2) Or, yes, add some sort of "all or nothing" flag to transactions(?*) > that users can toggle on/off. I had wondered in the past if it wouldn't > be advantageous for libvirt to be able to choose this behavior, if > managing state of partial completions was desirable in some cases to > avoid re-running operations unnecessarily. >=20 > *As a thought, perhaps cancel-all-on-error as a flag can be a property > of the QMP transaction command itself. When set, actions that launch > jobs can add the job to the TXN. An error can be raised if the flag is > used in conjunction with an action that doesn't currently/won't ever > support the do-or-die flag. Good, this is easy to add. --Y5rl02BVI9TCfPar Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVk6i9AAoJEJykq7OBq3PIr7IIAKD2XeJMjED699uCdWGYsxLg UTdNByZ9czzLt6z8HBjrTWevLdzlmWeA6u3IxOmnKSf9AIs5H0T4UPczAzTMvj0t P47LUYRwI7xTGTZdeASW0cF2f3FE3g11V3GAc7hAAeIufgi/ini19gblphw9p4eu nGhFCvKFUY77WWwZVZnZZVEwq/ETzP9tM3om3iDxantE3fytCvRZfW08xSVwdOwV A1LQv2AMKUS4nNlpr7FTmRHh7Qe8T4e+VbhQy5Xh+QTaStd7fDp70jLI5hhDCAA4 e//2s4zLSv7dRcAnKrmBIouhgS8oDOvuPKnBaVoIpeKtQx9QLtXZMO4C3q4cJnk= =LNM4 -----END PGP SIGNATURE----- --Y5rl02BVI9TCfPar--