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 5C0A8431FD0 for ; Sat, 11 Jun 2011 13:04:58 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 q2pRHr5s6pob for ; Sat, 11 Jun 2011 13:04:57 -0700 (PDT) Received: from dmz-mailsec-scanner-6.mit.edu (DMZ-MAILSEC-SCANNER-6.MIT.EDU [18.7.68.35]) by olra.theworths.org (Postfix) with ESMTP id BF8F8431FB6 for ; Sat, 11 Jun 2011 13:04:57 -0700 (PDT) X-AuditID: 12074423-b7ce8ae000000a29-68-4df3ca633489 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39]) by dmz-mailsec-scanner-6.mit.edu (Symantec Messaging Gateway) with SMTP id D6.55.02601.36AC3FD4; Sat, 11 Jun 2011 16:04:51 -0400 (EDT) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id p5BK4udc029922 for ; Sat, 11 Jun 2011 16:04:56 -0400 Received: from drake.mit.edu (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com [209.6.116.242]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id p5BK4tpO005528 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT) for ; Sat, 11 Jun 2011 16:04:56 -0400 (EDT) Received: from amthrax by drake.mit.edu with local (Exim 4.76) (envelope-from ) id 1QVUQR-0000Gr-1Z for notmuch@notmuchmail.org; Sat, 11 Jun 2011 16:04:55 -0400 From: Austin Clements To: notmuch@notmuchmail.org Subject: [PATCH v6 00/17] Fix 'notmuch new' atomicity issues Date: Sat, 11 Jun 2011 16:04:26 -0400 Message-Id: <1307822683-848-1-git-send-email-amdragon@mit.edu> X-Mailer: git-send-email 1.7.5.1 In-Reply-To: <87ei34rnc5.fsf@yoom.home.cworth.org> References: <87ei34rnc5.fsf@yoom.home.cworth.org> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrBIsWRmVeSWpSXmKPExsUixG6nrpt86rOvwdO51hbXb85kdmD0eLbq FnMAYxSXTUpqTmZZapG+XQJXxrWbH5gKGoUqXmx+ztTAeIqvi5GTQ0LARKJ74SZGCFtM4sK9 9WxdjFwcQgL7GCWa3k5lgnDOMUrMuNLLClIlJPCXSWLLUhUIey+jxNcjpiA2m4CGxLb9y8Em iQhIS+y8OxusXljARmLFg99gcRYBVYm/+1rYQGxeATuJex3LWCE2K0hcuTKPBcTmFDCSONG2 lAlivqFE78EnTBMY+RYwMqxilE3JrdLNTczMKU5N1i1OTszLSy3SNdPLzSzRS00p3cQIDg4X 5R2Mfw4qHWIU4GBU4uFVXPvZV4g1say4MvcQoyQHk5Ior84JoBBfUn5KZUZicUZ8UWlOavEh RgkOZiUR3vXtn3yFeFMSK6tSi/JhUtIcLErivHMl1X2FBNITS1KzU1MLUotgsjIcHEoSvJtP Ag0VLEpNT61Iy8wpQUgzcXCCDOcBGn4UpIa3uCAxtzgzHSJ/itGYY+G69YcYOR5v2HSIUYgl Lz8vVUqc9z5IqQBIaUZpHtw0WIS/YhQHek6Y9wdIFQ8wOcDNewW0iglolUAp2KqSRISUVAPj ydVbb5l8v9HVvFBjp3Lj7Ngr1QvFti0x+Zom0femyaHTRoTdQNmmNlz4r96ruRlvds0vd7Gr Y6xaFJ/l8mnyYpngddfSpJ+cSs/WDJjUdDNtmavV3tjvTKx5z4IjBc5nMkd6Gpsdf6PQHPLG Xfbv3OXcXT3lLmmMT6Q0NyydkJE17cJJuyVKLMUZiYZazEXFiQAWSbHtywIAAA== 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: Sat, 11 Jun 2011 20:04:58 -0000 Here's the reworked patch series that uses atomic sections more heavily rather than changing the removal API. This is atomic-new-v6 on http://awakening.csail.mit.edu/git/notmuch.git . (I was planning to make this series on Monday while stuck on a plane, but an opportunity presented itself when I needed something better to do than fix the sink. As a result, if you can look over this before Monday, I can use that time to address any further comments.) The beginning of the sequence---"test: Fix message when skipping test_expect_equal* tests" through "new: Defer updating directory mtimes until the end."---has not changed besides than the minor things you pointed out earlier. Here's a quick summary of the differences in the rest of the sequence: lib: Add notmuch_database_{begin,end}_atomic. Rebased but otherwise identical. lib: Add support for nested atomic sections. New. lib: Indicate if there are more filenames after removal. Rebased but otherwise identical. lib: Remove message document directly after removing the last file name. New. Supersedes the patches that rewrote notmuch_database_remove_message and made sync delete messages. lib: Add an API to find a message by filename. Culled from "lib: Add API's to find by filename and ..." in the old series. What I kept is identical. lib: Wrap notmuch_database_add_message in an atomic section. New. new: Cleanup. Put removed/renamed message count in add_files_state_t. new: Cleanup. De-duplicate file name removal code. Both new, but closely related to previous remove_filename patch. new: Synchronize maildir flags eagerly. New, but very closely related to previous patch of the same name. This patch is simpler now because of the previous two cleanups. new: Wrap adding and removing messages in atomic sections. Rebased and added an atomic section around removal. lib: Improve notmuch_database_{add,remove}_message documentation. New. Ultimately, I still think the existing removal API is weird because it forces you to do things like lookup a message by file name just in case you need that message object after removal tells you that it didn't actually remove the message. But I don't know what to do about it that isn't equally weird.