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 0E22B431FBF for ; Wed, 23 Apr 2014 04:54:29 -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 68tG4zIGmrQc for ; Wed, 23 Apr 2014 04:54:22 -0700 (PDT) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com [209.85.215.41]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 3C76B431FBD for ; Wed, 23 Apr 2014 04:54:22 -0700 (PDT) Received: by mail-la0-f41.google.com with SMTP id gl10so679859lab.0 for ; Wed, 23 Apr 2014 04:54:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:from:to:cc:subject:in-reply-to :references:date:message-id:user-agent:content-transfer-encoding; bh=xtoOnRQWbi/IkmS+Wsi0ABHTYggeJzf+seFlJK7O6ng=; b=MC5jgOzjbvmvDnzHvCfo9OBbz6+Z8Iv8BN1cy6ZAvnh7kDAzDdt/UYCEwEPZiG5KzD Rc3qYwtQRaWInHi4fQkDFvkijqm5E0JTGrr7f7xr8U3PVA/6J5Yp/nicJ6yzGZ5BuqyB sFdvrjr6gUWqCiEE6cH7Sf/k19Mk0NG8q8f3M86//id4LfrtVjVz4qzDYX8JllxAbxFL fpdkTEprvpYilj280e1L9Myqpr97vNjHPwP5eZ1FbgCMiFa8TR+4ApMt0Y/NcngWjcQF GfsuQQsOhP8qDsQU4azQs/DCJO9u/oGA91K/jwDMeMGhHllMAtpjaAuAyulI23yEC/7k WQJA== X-Gm-Message-State: ALoCoQlV45D3SXtic/4dGPC/kAC98UfArsn8ZqtPD8iLMwvizByz3qHAbw/r7gRFZgsPhT33ufL4 X-Received: by 10.152.22.72 with SMTP id b8mr36745laf.63.1398254058245; Wed, 23 Apr 2014 04:54:18 -0700 (PDT) Received: from localhost ([128.39.46.106]) by mx.google.com with ESMTPSA id u4sm730335laj.2.2014.04.23.04.54.16 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Apr 2014 04:54:16 -0700 (PDT) Content-Type: text/plain; charset=UTF-8 From: Gaute Hope To: David Mazieres expires 2014-07-22 PDT Subject: Re: [PATCH] Add configurable changed tag to messages that have been changed on disk In-reply-to: <87ioq0l8th.fsf@ta.scs.stanford.edu> References: <1396800683-9164-1-git-send-email-eg@gaute.vetsj.com> <87wqf2gqig.fsf@ta.scs.stanford.edu> <1397140962-sup-6514@qwerzila> <87wqexnqvb.fsf@ta.scs.stanford.edu> <1397163239-sup-5101@qwerzila> <87d2g9ja0h.fsf@maritornes.cs.unb.ca> <1398237865-sup-624@qwerzila> <87ioq0l8th.fsf@ta.scs.stanford.edu> Date: Wed, 23 Apr 2014 13:53:10 +0200 Message-Id: <1398253735-sup-5203@qwerzila> User-Agent: Sup/git Content-Transfer-Encoding: 8bit Cc: notmuch 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, 23 Apr 2014 11:54:29 -0000 Excerpts from David Mazieres's message of 2014-04-23 11:00:10 +0200: > Gaute Hope writes: > > > A db-tick or a _good_ ctime solution can as far as I can see solve both > > David M's (correct me if I am wrong) and my purposes, as well as > > probably have more use cases in the future. It would even be an > > interesting direct search: show me everything that changed lately, > > sorted. > > I could live with a db-tick scheme. I would prefer a ctime scheme, > since then I can answer questions such as "what has changed in the last > five minutes"? I mean all kinds of other stuff starts to break if your > clock goes backwards on a mail server machine, not the least of which is > that incremental backups will fail silently, so you risk losing your > mail. > > A middle ground might be to use the maximum of two values: 1) the > time-of-day at which notmuch started executing, and 2) the highest ctime > in the database plus 100 microseconds (leaving plenty of slop to store > timestamps as IEEE doubles with 52 significant bits). Since the values > will be Btree-indexed, computing the max plus one will be cheap. > > Incidentally, if you are really this paranoid about time stamps, it > should bother you that notmuch's directory timestamps only have one > second granularity. It's not that hard to get a new message delivered > in the same second that notmuch new finished running. In my > synchronizer, I convert st_mtim (a struct timespec) into a double and > keep that plus size in the database to decide if I need to re-hash > files. But for directories, I'm stuck with NOTMUCH_VALUE_TIMESTAMP, > which are quantized to the second. (Ironically, I think > Xapian::sortable_serialize converts time_ts to doubles anyway, so > avoiding st_mtim is not really helping performance.) Agreed, it probably won't be the end of the world.. I will have to handle conflicts anyway. With an inclusion of ctime my 'changed'-tag patches are unnecessary. By the way, muchsync looks very promising! Cheers, gaute