unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Mazieres <dm-list-email-notmuch@scs.stanford.edu>
To: Gaute Hope <eg@gaute.vetsj.com>,
	David Bremner <david@tethera.net>,
	notmuch <notmuch@notmuchmail.org>
Subject: Re: [PATCH] Add configurable changed tag to messages that have been changed on disk
Date: Wed, 23 Apr 2014 02:00:10 -0700	[thread overview]
Message-ID: <87ioq0l8th.fsf@ta.scs.stanford.edu> (raw)
In-Reply-To: <1398237865-sup-624@qwerzila>

Gaute Hope <eg@gaute.vetsj.com> 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.)

David

  reply	other threads:[~2014-04-23  9:00 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-06 16:11 [PATCH] Add configurable changed tag to messages that have been changed on disk Gaute Hope
2014-04-06 20:19 ` David Mazieres
2014-04-10 14:43   ` Gaute Hope
2014-04-10 15:31     ` dm-list-email-notmuch
2014-04-10 21:10       ` Gaute Hope
2014-04-22 22:05         ` David Bremner
2014-04-23  7:24           ` Gaute Hope
2014-04-23  9:00             ` David Mazieres [this message]
2014-04-23 11:53               ` Gaute Hope
2014-04-23 20:59               ` Austin Clements
2014-04-23 22:31                 ` dm-list-email-notmuch
2014-04-11 11:08       ` David Bremner
2014-04-11 16:03         ` dm-list-email-notmuch
2014-04-12 15:58           ` David Bremner
2014-05-03 14:01             ` Jani Nikula
2014-04-23 21:28   ` Austin Clements
2014-04-23 22:40     ` David Mazieres expires 2014-07-22 PDT
2014-07-03 10:42 ` David Bremner
2014-07-28 14:37   ` Gaute Hope
2014-08-01 18:55     ` Austin Clements
2014-08-02  0:49       ` Austin Clements
2014-08-06  9:02       ` Gaute Hope
2014-08-06 17:06         ` Austin Clements
     [not found]       ` <1407313144-astroid-0-vyhth1tcrd-3835@strange>
2014-09-22 12:06         ` Gaute Hope
2014-09-22 15:33           ` Tomi Ollila
2014-09-22 15:40           ` Austin Clements
2014-09-23  6:57             ` Gaute Hope

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ioq0l8th.fsf@ta.scs.stanford.edu \
    --to=dm-list-email-notmuch@scs.stanford.edu \
    --cc=david@tethera.net \
    --cc=eg@gaute.vetsj.com \
    --cc=mazieres-eqbxrjbqrn7vs5xdx45e9hkucs@temporary-address.scs.stanford.edu \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).