From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id C6CF1431FBC for ; Sun, 24 Jan 2010 21:19:37 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -2.599 X-Spam-Level: X-Spam-Status: No, score=-2.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599] autolearn=ham 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 qowNVyp-37QI for ; Sun, 24 Jan 2010 21:19:35 -0800 (PST) Received: from mout.perfora.net (mout.perfora.net [74.208.4.194]) by olra.theworths.org (Postfix) with ESMTP id 72AEC431FAE for ; Sun, 24 Jan 2010 21:19:35 -0800 (PST) Received: from rose ([199.199.210.158]) by mx.perfora.net (node=mxus1) with ESMTP (Nemesis) id 0LeONZ-1O9Pr63UYX-00qgQ2 for notmuch@notmuchmail.org; Mon, 25 Jan 2010 00:19:34 -0500 Received: from renaissance (localhost [127.0.0.1]) by rose (Postfix) with ESMTPS id A66042E0133; Mon, 25 Jan 2010 05:20:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by renaissance (Postfix) with ESMTPS id 2FBBFCDC8B; Mon, 25 Jan 2010 00:19:25 -0500 (EST) Date: Mon, 25 Jan 2010 00:19:24 -0500 (EST) From: Asheesh Laroia X-X-Sender: paulproteus@localhost To: martin f krafft In-Reply-To: <20100125004659.GA24818@lapse.rw.madduck.net> Message-ID: References: <20100111221909.GA30299@lapse.rw.madduck.net> <1263267603-sup-302@elise> <20100112045152.GA15275@lapse.rw.madduck.net> <20100114203730.GE4691@lapse.rw.madduck.net> <20100125004659.GA24818@lapse.rw.madduck.net> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) X-OpenPGP-Key-ID: 0x70096AD1 MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323328-756071938-1264396765=:27181" Cc: notmuch Subject: Re: Git as notmuch object store (was: Potential problem using Git for mail) 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: Mon, 25 Jan 2010 05:19:37 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323328-756071938-1264396765=:27181 Content-Type: TEXT/PLAIN; charset=utf-8; format=flowed Content-Transfer-Encoding: 8BIT On Mon, 25 Jan 2010, martin f krafft wrote: > also sprach Asheesh Laroia [2010.01.21.1928 > +1300]: >>> I suppose that I never actually considered merges on the IMAP server >>> side, but obviously the IMAP server has to work off a clone, and that >>> means it needs to merge. >> >> It's not "merge" that's unsafe; that just builds a tree in the git >> index (assuming no conflicts). It's the ensuing process of git writing >> a tree to the filesystem that is problematic. > > There is no way to make that atomic, I am afraid. As you say. > >> I could probably actually write a wrapper that locks the Maildir while >> git is operating. It would probably be specific to each IMAP server. > > Ouch! I'd really rather not go there. You say "Ouch" but you should know Dovecot *already* does this. I don't mind interoperating with that. See http://wiki.dovecot.org/MailboxFormat/Maildir, section "Issues with the specification", subsection "Locking". I term this the famous readdir() race. Without this lock, Maildir is fundamentally incompatible with IMAP -- one Maildir-using process modifying message flags could make a different Maildir-using process think said message is actually deleted. In the case of temporary disappearing mails in Mutt locally, that's not the end of the world. For IMAP, it will make the IMAP daemon (one of the Maildir-using processes) send a note to IMAP clients saying that the message has been deleted and expunged. >> Note that this mean git is fundamentally incompatible with Maildir, not >> just IMAP servers. > > We had an idea about using Git to replace IMAP altogether, along with > making notmuch use a bare Git repository as object store. The idea is > that notmuch uses low-level Git commands to access the .git repository > (from which you can still checkout a tree tying the blobs into a > Maildir). The benefit would be compression, lower inode count (due to > packs), and backups using clones/merges. Sure, that makes sense to me. > You could either have the MDA write to a Git repo on the server side and > use git packs to download mail to a local clone, or one could have e.g. > offlineimap grow a Git storage backend. The interface to notmuch would > be the same. Yeah, I generally like this. > If we used this, all the rename and delete code would be refactored into > Git and could be removed from notmuch. In addition, notmuch could > actually use Git tree objects to represent the results of searches, and > you could checkout these trees. However, deleting messages from search > results would not have any effect on the message or its existence in > other search results, much like what happens with mairix nowadays. That's okay with me. > I think we all kinda agreed that the Maildir flags should not be used by > notmuch and that things like Sebastian's notmuchsync should be used if > people wanted flags represented in Maildir filenames. Aww, I like Maildir flags, but if there's a sync tool, I'm fine with that. > Instead of a Maildir checkout, notmuch could provide an interface to > browse the store contents in a way that could make it accessible to > mutt. The argument is that with 'notmuch {ls,cat,rm,…}', a mutt backend > could be trivially written. I am not sure about that, but it's worth a > try. Sure. > But there are still good reasons why you'd want to have IMAP capability > too, e.g. Webmail. Given the atomicity problems that come from Git, > maybe an IMAP server reading from the Git store would make sense. It wouldn't be too hard to write a FUSE filesystem that presented an interface to a Git repository that didn't allow the contents of files to be modified. Then Dovecot could think it's interacting with the filesystem. > However, this all sounds like a lot of NIH and reinvention. It's > a bit like the marriage between the hypothetical Maildir2 and Git, > which is definitely worth pursuing. Before we embark on any of this, > however, we'd need to define the way in which Git stores mail. Sure. If it were me, I'd just say, "For phase 1 of notmuch, just have git store Maildir spools." When you need a filesystem interface for e.g. Dovecot, have a FUSE wrapper. See how far that can take you, and then see if version 2 is necessary. (-: > Stewart, you've worked most on this so far. Would you like to share your > thoughts? I'll listen, too. Just don't fall into the trap of thinking Maildir is compatible with IMAP. It's not, because as I understand things, the filesystem doesn't guarantee that you can actually iterate across a directory's files if another process is modifying the list of files. I'm not sure, but maybe it's safe if you refuse to ever modify a message's flags in the filename. Anyway, as I see it, further hacks that aren't much worse than Dovecot's should be considered okay, unless you have a more elegant design up your sleeve. If I'm slightly wrong about something, try to give me the benefit of doubt. It's past midnight. (-: -- Asheesh. -- There's no real need to do housework -- after four years it doesn't get any worse. --8323328-756071938-1264396765=:27181--