Re: [PATCH] Repeatability when copying a whole directory into a new one.
authorAustin Clements <amdragon@mit.edu>
Sat, 5 Nov 2011 17:26:03 +0000 (13:26 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:39:59 +0000 (09:39 -0800)
20/b5aff948b472994cce841f0a0631af29e587de [new file with mode: 0644]

diff --git a/20/b5aff948b472994cce841f0a0631af29e587de b/20/b5aff948b472994cce841f0a0631af29e587de
new file mode 100644 (file)
index 0000000..dc3c24e
--- /dev/null
@@ -0,0 +1,96 @@
+Return-Path: <amdragon@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 2CFAB429E21\r
+       for <notmuch@notmuchmail.org>; Sat,  5 Nov 2011 10:26:06 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.699\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.699 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001,\r
+       RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id YxDwd9dxHKuI for <notmuch@notmuchmail.org>;\r
+       Sat,  5 Nov 2011 10:26:05 -0700 (PDT)\r
+Received: from mail-gx0-f181.google.com (mail-gx0-f181.google.com\r
+       [209.85.161.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 755D1431FB6\r
+       for <notmuch@notmuchmail.org>; Sat,  5 Nov 2011 10:26:05 -0700 (PDT)\r
+Received: by ggdk6 with SMTP id k6so734362ggd.26\r
+       for <notmuch@notmuchmail.org>; Sat, 05 Nov 2011 10:26:04 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
+       h=mime-version:sender:in-reply-to:references:date\r
+       :x-google-sender-auth:message-id:subject:from:to:cc:content-type;\r
+       bh=7xCLuJCB3Ry9FYtSJElz5LFLySWriLHVVqNltD5+nsY=;\r
+       b=gg0rSfFJNeNu6pI7o9P+QIzJ4SvXU83Oup0Dh2icV08ezIep31fxGZwNoCCn5EAmoO\r
+       luFNTDGg94eN6Z6TDwJYvGUzuCKmn9piYS9tDeL+9phtg01g6AnMJU629CBnmCnxC5dS\r
+       k2NU7nXltj4rQZ0F35hKb/V2mPVPyKbm62xpw=\r
+MIME-Version: 1.0\r
+Received: by 10.50.156.230 with SMTP id wh6mr23689683igb.17.1320513963638;\r
+       Sat, 05 Nov 2011 10:26:03 -0700 (PDT)\r
+Sender: amdragon@gmail.com\r
+Received: by 10.143.166.17 with HTTP; Sat, 5 Nov 2011 10:26:03 -0700 (PDT)\r
+In-Reply-To: <1317338806-7414-1-git-send-email-thomas@schwinge.name>\r
+References: <1317338806-7414-1-git-send-email-thomas@schwinge.name>\r
+Date: Sat, 5 Nov 2011 13:26:03 -0400\r
+X-Google-Sender-Auth: 9IOARzWfc5xQOr6jmZXl-M1MfM0\r
+Message-ID:\r
+ <CAH-f9WuE3quh1jneP1Zj4+xB7r+AXwKbX0QfYvEwOQEKFG1F8Q@mail.gmail.com>\r
+Subject: Re: [PATCH] Repeatability when copying a whole directory into a new\r
+       one.\r
+From: Austin Clements <amdragon@mit.edu>\r
+To: Thomas Schwinge <thomas@schwinge.name>\r
+Content-Type: text/plain; charset=ISO-8859-1\r
+Cc: notmuch@notmuchmail.org\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sat, 05 Nov 2011 17:26:06 -0000\r
+\r
+On Thu, Sep 29, 2011 at 7:26 PM, Thomas Schwinge <thomas@schwinge.name> wrote:\r
+> This new test currently fails -- but it shouldn't.\r
+> ---\r
+>\r
+> Hi!\r
+>\r
+> I found this while manually copying directories and running notmuch new.\r
+>\r
+> Am I just too sleepy at this time, or is it another DB vs. directory\r
+> mtime issue?\r
+\r
+Nice catch.  I haven't verified this, but I believe the problem is\r
+that notmuch never deletes directory documents.  In fact, there isn't\r
+even an API to do so.  Even though it detects the deleted directory\r
+and deletes all messages under it, the directory document sticks\r
+around.  When the directory comes back, notmuch finds the old\r
+directory document with the old directory mtime and thinks it doesn't\r
+have to rescan the directory because the cp -a reproduced the same\r
+mtime the directory used to have.\r
+\r
+So, I guess part of the answer is "don't cp -a" because that mucks\r
+with mtimes and mtimes are all notmuch has to go by.  But that's no\r
+excuse for not removing the directory documents when the directory is\r
+removed.\r
+\r
+Fixing this is slightly tricky.  I feel like there *shouldn't* be an\r
+API to simply remove a directory document because that would let you\r
+violate database consistency.  Instead, I think the API should\r
+recursively remove everything under the removed directory, exactly\r
+like what notmuch-new.c:_remove_directory does right now (plus\r
+removing the directory documents).  But _remove_directory depends on\r
+remove_filename, which currently has notmuch-new-specific logic in it.\r
+ I feel like there must be a nice solution to this, and I'm just not\r
+thinking of it.\r