unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Rob Browning <rlb@defaultvalue.org>
To: david@tethera.net
Cc: notmuch@notmuchmail.org
Subject: Re: First draft of logging functionality.
Date: Tue, 12 Oct 2010 09:32:48 -0500	[thread overview]
Message-ID: <87sk0bxyzz.fsf@raven.defaultvalue.org> (raw)
In-Reply-To: <1286803617-17328-1-git-send-email-david@tethera.net> (david@tethera.net's message of "Mon, 11 Oct 2010 10:26:54 -0300")

david@tethera.net writes:

> The patches following this message are my first attempt at
> implementing atomic logging for notmuch.  The idea is that such logs
> could be useful in synchronizing notmuch instances.

For this to be completely safe, I suspect it may need to be adjusted to
do write ahead logging or something similar.  Otherwise operations could
be lost.

i.e. notmuch would atomically and safely write the intended (tag)
operation to the log, then perform the tag.  On startup, notmuch would
need to scan the log to detect and apply operations that hadn't been
fully completed (presumably due to a crash).

More generally, while thinking about sync/logging a few days ago, I
wondered about using sqlite.  That would help with atomicity, rollback,
synchronizing multiple readers/writers, etc.  It might also make
operations more efficient once we implement all the features we want.

For example, with the log information in sqlite, a separate notmuch sync
to another machine could be reading from the log (and with limitations,
writing) in parallel with normal notmuch operations.  Depending on how
we decide to handle sync with multiple peers, the log may also need to
track which peers have seen what, prune appropriately, etc.

Of course sqlite may not be appropriate, and would require performance
testing, etc., but we should probably think about the features we'll
eventually want, and consider how much work they're likely to require
with any given approach, regardless.

Hope this helps
-- 
Rob Browning
rlb @defaultvalue.org and @debian.org
GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4

  parent reply	other threads:[~2010-10-12 14:33 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-11 13:26 First draft of logging functionality david
2010-10-11 13:26 ` [PATCH 1/3] Initial implementation of low level logging routines david
2010-10-11 13:26 ` [PATCH 2/3] notmuch-log.c: Add a function to log a pair of strings with a timestamp david
2010-10-11 13:26 ` [PATCH 3/3] notmuch-tag.c: Add tag logging david
2010-10-12  9:06 ` First draft of logging functionality Michal Sojka
2010-10-12 11:21   ` David Bremner
2010-10-12 11:38     ` Michal Sojka
2010-10-12 13:16       ` David Bremner
2010-10-12 14:32 ` Rob Browning [this message]
2010-10-24 21:01 ` Second draft of logging patches david
2010-11-10  3:18   ` David Bremner
2010-11-13  5:25     ` Michal Sojka
2010-11-13 12:11       ` David Bremner
2010-10-24 21:01 ` [PATCH 1/4] Initial implementation of low level logging routines david
2010-10-24 21:01 ` [PATCH 2/4] Add log component to database struct david
2010-10-24 21:01 ` [PATCH 3/4] Add logging to low level message handling routines david
2010-10-24 21:01 ` [PATCH 4/4] Enable logging in notmuch-tag.c david

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=87sk0bxyzz.fsf@raven.defaultvalue.org \
    --to=rlb@defaultvalue.org \
    --cc=david@tethera.net \
    --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).