From: Ben Gamari Date: Mon, 20 Aug 2012 15:31:41 +0000 (+2000) Subject: [PATCH RFC?] Compactification support X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=8373080dbe6a4a7d9fdbca31ffa76ad2e011ba77;p=notmuch-archives.git [PATCH RFC?] Compactification support --- diff --git a/86/f6feba03b274263ffe167845492894aae35ffb b/86/f6feba03b274263ffe167845492894aae35ffb new file mode 100644 index 000000000..dd1b7b859 --- /dev/null +++ b/86/f6feba03b274263ffe167845492894aae35ffb @@ -0,0 +1,79 @@ +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 8A3CA431FBD + for ; Mon, 20 Aug 2012 08:31:54 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.799 +X-Spam-Level: +X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_FROM=0.001, 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 vh6Lf9NmDh-p for ; + Mon, 20 Aug 2012 08:31:54 -0700 (PDT) +Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com + [209.85.220.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 0942A431FAE + for ; Mon, 20 Aug 2012 08:31:53 -0700 (PDT) +Received: by vcbfl17 with SMTP id fl17so5583555vcb.26 + for ; Mon, 20 Aug 2012 08:31:52 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:subject:date:message-id:x-mailer; + bh=MFEPxHraUCgLMR5OzuCb+g1CGqyr/uZsSdSB7UoorSM=; + b=RbZoI4JUydwm9R5f/oB6XEmxPq91xNgDwJQdILsS2iRC0rJIeFKK9GF/P89YaZ36lu + rbMN/Xy3qfZm/zMJYSwXLWD0AlnERfBvZ7uAj0RjI7b4jZ2ddPliazTUJ/JQbTBvXxq/ + XPI1Gqg+jgOm1WmTbrtXxy9sXg6hRcOkqCYn7UdaRgMldny9FDsS0eS6vHon2Cy4VHa4 + Qq+1sR3/CTE5jGPSuRn0cyMwhvNJnIob+dLUKPK1JCDoF5+gimCRx3CtwJ0jhrf7c1+T + t0B7Dr3N4nhwLekim3mW07/Y0h9PxdmyjO8tZzcxmDV64Vgwjz8YGF+vhsSiL/Hs3Dbi + 2aYw== +Received: by 10.221.0.74 with SMTP id nl10mr10544846vcb.47.1345476712196; + Mon, 20 Aug 2012 08:31:52 -0700 (PDT) +Received: from localhost.localdomain + (pool-108-8-230-85.spfdma.east.verizon.net. [108.8.230.85]) + by mx.google.com with ESMTPS id g10sm5430786vdk.2.2012.08.20.08.31.50 + (version=SSLv3 cipher=OTHER); Mon, 20 Aug 2012 08:31:51 -0700 (PDT) +From: Ben Gamari +To: notmuch@notmuchmail.org +Subject: [PATCH RFC?] Compactification support +Date: Mon, 20 Aug 2012 11:31:41 -0400 +Message-Id: <1345476704-17091-1-git-send-email-bgamari.foss@gmail.com> +X-Mailer: git-send-email 1.7.9.5 +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, 20 Aug 2012 15:31:54 -0000 + + +Here is a small patchset adding support for database compaction when supported +by Xapian. Here I add a function which both compacts and closes the database. +This is due to it being not entirely clear whether one is allowed to compact +the database while it is being held open for read/write. + + +Since it is nice to be able to hold the read/write lock while compacting, I +close the database only after the compaction has finished which Xapian seems to +be fine with. That being said, the database is moved after compaction, so it seems appropriate to lump compaction in with closing the database. + +Lastly, I wasn't entirely sure whether/how Xapian's status messages should be +presented to the user. At the moment I simply spit them out on stderr. Perhaps +I should just pass a callback to notmuch_database_close_compact and leave this +to the caller? + +Cheers, + +- Ben +