From: W. Trevor King Date: Wed, 24 Sep 2014 18:18:44 +0000 (+1700) Subject: Re: [PATCH] lib: Simplify close and codify aborting atomic section X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e6fddc75d066168c601ab749fa4c1e77ca820cd1;p=notmuch-archives.git Re: [PATCH] lib: Simplify close and codify aborting atomic section --- diff --git a/66/8a91092fce51cdacc7eb46dba7dafa1597cec3 b/66/8a91092fce51cdacc7eb46dba7dafa1597cec3 new file mode 100644 index 000000000..6eb611092 --- /dev/null +++ b/66/8a91092fce51cdacc7eb46dba7dafa1597cec3 @@ -0,0 +1,144 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 1309A431FAF + for ; Wed, 24 Sep 2014 11:18:55 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.1 +X-Spam-Level: +X-Spam-Status: No, score=-0.1 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + RCVD_IN_DNSWL_NONE=-0.0001] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id USBT1VmM-YhC for ; + Wed, 24 Sep 2014 11:18:47 -0700 (PDT) +Received: from resqmta-po-10v.sys.comcast.net (resqmta-po-10v.sys.comcast.net + [96.114.154.169]) + (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 8EF68431FB6 + for ; Wed, 24 Sep 2014 11:18:47 -0700 (PDT) +Received: from resomta-po-05v.sys.comcast.net ([96.114.154.229]) + by resqmta-po-10v.sys.comcast.net with comcast + id v6Hg1o0054xDoy8016JmzM; Wed, 24 Sep 2014 18:18:46 +0000 +Received: from odin.tremily.us ([24.18.63.50]) + by resomta-po-05v.sys.comcast.net with comcast + id v6Jk1o00Z152l3L016JlmV; Wed, 24 Sep 2014 18:18:46 +0000 +Received: by odin.tremily.us (Postfix, from userid 1000) + id 5E02013AAE54; Wed, 24 Sep 2014 11:18:44 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tremily.us; s=odin; + t=1411582724; bh=ESxq4zvkO7kDZZsV0WbZ6eHX4vMoVbfXfq+1N6BjDwM=; + h=Date:From:To:Cc:Subject:References:In-Reply-To; + b=ONVCOwS6udawzn9MEri4X5nJo6eqx99MUXh0nfpH69T0IpakTRAKynGdGX/BTaTfR + xeKtkVn4BFrnHITiRwix94jQu++EuHOUO+PaUMnZ4YI3FBQkRG/ZXtARWv9t1RtgY7 + 3w/sszkyb3riurpDmU57RmcYLw63uksPeImvi/aI= +Date: Wed, 24 Sep 2014 11:18:44 -0700 +From: "W. Trevor King" +To: David Bremner +Subject: Re: [PATCH] lib: Simplify close and codify aborting atomic section +Message-ID: <20140924181844.GB20130@odin.tremily.us> +References: <1411400615-20934-1-git-send-email-amdragon@mit.edu> + <20140922165954.GI20827@odin.tremily.us> + <20140922185050.GB7970@csail.mit.edu> + <20140922190022.GO20827@odin.tremily.us> + <87iokc28mg.fsf@maritornes.cs.unb.ca> +MIME-Version: 1.0 +Content-Type: multipart/signed; micalg=pgp-sha1; + protocol="application/pgp-signature"; boundary="1UWUbFP1cBYEclgG" +Content-Disposition: inline +In-Reply-To: <87iokc28mg.fsf@maritornes.cs.unb.ca> +OpenPGP: id=39A2F3FA2AB17E5D8764F388FC29BDCDF15F5BE8; + url=http://tremily.us/pubkey.txt +User-Agent: Mutt/1.5.23 (2014-03-12) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; + s=q20140121; t=1411582726; + bh=eRafiU43Gwq9vkf0njWP4NVZ12XLeJfHqI1u0bYFxUc=; + h=Received:Received:Received:Date:From:To:Subject:Message-ID: + MIME-Version:Content-Type; + b=R7oxq4ODApSoEEGXge3LQtWCg1wyoI9apqJKLQv8vlf9kJxxRM9MoERSyCFoAh71F + kjZuIihPwiFxdteZusNImvtJXlPxqnvEldnqpf+/4XZgbtBnSgOeV0QwOQGIYb4aiy + kJIvQqHLLdIeCULHhYL81VTD0HFt4+o6VM0qt7n4ejrRMLsW4d1cFO5e75PvxCuuVG + /ghysKsaedyEAZ8rM0jKbb1exBCoOgQOzOpJGjxhA4e9gK+xoSGmrndmMgVUkG4wT1 + dErHt3xD0AWnfNQW9saTFDFXPa/AYlrwtCGQHyg6C/L590b8Fg/VB5GD0k7R7+rPnO + qHl/scA+QpIOw== +Cc: notmuch@notmuchmail.org +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Wed, 24 Sep 2014 18:18:55 -0000 + + +--1UWUbFP1cBYEclgG +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +Content-Transfer-Encoding: quoted-printable + +On Wed, Sep 24, 2014 at 08:09:27PM +0200, David Bremner wrote: +> W. Trevor King writes: +> > Ah, I thought the implicit flush/commit was just in our code. +> > Since it's also in the underlying Xapian close, then this patch +> > looks pretty good to me. I'd mention Xapian's explicit close in +> > the notmuch.h message. Xapain's docs say [1]: +> > +> > For a WritableDatabase, if a transaction is active it will be +> > aborted, while if no transaction is active commit() will be +> > implicitly called. +>=20 +> I'm not sure what you're asking for here by "explicit close". Isn't +> what you quote a restatement of +>=20 +> + * If the caller is currently in an atomic section (there was a +> + * notmuch_database_begin_atomic without a matching +> + * notmuch_database_end_atomic), this will abort the atomic section, +> + * discarding any modifications made in the atomic section. +>=20 +> in terms of underyling Xapian mechanics? + +Sorry, I didn't phrase that very well. The notmuch docs (as of this +patch) explain that we don't commit if we're in an atomic block. The +Xapian docs also say that, *and* they say that if we're not in atomic +block the close *does* try to commit. I think that's worth mentioning +in our close docs. + +Cheers, +Trevor + +--=20 +This email may be signed or encrypted with GnuPG (http://www.gnupg.org). +For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy + +--1UWUbFP1cBYEclgG +Content-Type: application/pgp-signature; name="signature.asc" +Content-Description: OpenPGP digital signature + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2 + +iQIcBAEBAgAGBQJUIwsBAAoJEG8/JgBt8ol8G+wP/15WCG6fH4ZKsKy9s5hBJz6X +PkqY3ZE7ahjTIBJzRlnCLecOiSsh1NmBGswJuC0WdGfvfJmL4qTrXxaQR9qIZszx +YLeBMdgeFxNX0TfvMI8UG7KPgOxe65uGYA33/EGScIluWnrKRq+xIv8itL5+0WaE +q7YCiZ9HUTHhIKFR0UOBPqPkovAk52y6cZEssTZMo5CX/ULdgm3BeqOOFfH2PZIP +6QHRPrhNiv9bCVOVNs+Yvvfsd77mdGdWH7T6SqE1E3YYeexga8nJanCy0bwKKgWV +S7AYOKIdP3RQsjTNY1m+6+bhvLDNClMJFgSYFygYDYk/jog8hXvyeApwluSD19oM +TJ/+Y7Hlkvt63GU61jHl85XoHvGAM3X/A02veVeyJFzSsE4FoMAfVcbnRNIGTtoh +TDLUAB/FNGTvigIy8tkDoP1Y+zIcyK16oFiedLh3+IJ78iwZqGdXJKWm6AiXa6Np +5thE4hwGZ5npMnLUnnIApZaXmo6nnBBZNaLdEvo5Dj2u+aP69KOsRlPbeU+9rEue +s2rsDbBTD+J7z6dZsoTYEEVk9itO/lLl5/YHvaU1raOvjEycNkbhm6V5qjEnGUpI +699Yer/p+mMrgdPCz9hcndIv87wKGi6+bZni6f3Ht0qIz/BVLqRTw/cy9/ZWpkI2 +pJJbArp9gJhUcL0p2C6w +=EudI +-----END PGP SIGNATURE----- + +--1UWUbFP1cBYEclgG--