Return-Path: X-Original-To: apmail-jackrabbit-oak-dev-archive@minotaur.apache.org Delivered-To: apmail-jackrabbit-oak-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3E44D10A82 for ; Wed, 12 Jun 2013 09:32:23 +0000 (UTC) Received: (qmail 66046 invoked by uid 500); 12 Jun 2013 09:32:23 -0000 Delivered-To: apmail-jackrabbit-oak-dev-archive@jackrabbit.apache.org Received: (qmail 65673 invoked by uid 500); 12 Jun 2013 09:32:16 -0000 Mailing-List: contact oak-dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: oak-dev@jackrabbit.apache.org Delivered-To: mailing list oak-dev@jackrabbit.apache.org Received: (qmail 65663 invoked by uid 99); 12 Jun 2013 09:32:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Jun 2013 09:32:14 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jukka.zitting@gmail.com designates 209.85.214.172 as permitted sender) Received: from [209.85.214.172] (HELO mail-ob0-f172.google.com) (209.85.214.172) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Jun 2013 09:32:09 +0000 Received: by mail-ob0-f172.google.com with SMTP id wo10so13175092obc.31 for ; Wed, 12 Jun 2013 02:31:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=ek8vVvfzaP3oesii6TCwHDHgDlaBUDQSIi0Baft/0L0=; b=U375GdlCsK+em+3LXv3Yz2OSvHphA8F5M872iDFONk1EkuO4toDO/+lX2A9MK6eZDz b0FlVd564wO2THzSN7kdzf8duRUEMp3FgMFAXCaQPIkfhoNOx5DxWLf45J5gMmXEwq9Y NMeUjRcqH54vrGHbi0Jq888vPMH1P2p2eMr/vLRSxyk6f0q1y0p1kfFznm3vig8yvCC2 lBOgXo0dD/s+BU6qjNZa7GhTIivJK/6Y8WIg3noZEHvelVG10Tc+wznGckJlH1OjdZ6/ z5GufFun5HZEWLFo4lnNw0QFjUGAsNUMkZxBfCN2tKlJtJ+QrtBL2Ef3d3NtbEZygzl8 XCxw== X-Received: by 10.182.215.133 with SMTP id oi5mr14676809obc.83.1371029509088; Wed, 12 Jun 2013 02:31:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.113.225 with HTTP; Wed, 12 Jun 2013 02:31:28 -0700 (PDT) In-Reply-To: References: From: Jukka Zitting Date: Wed, 12 Jun 2013 12:31:28 +0300 Message-ID: Subject: Re: Asynchronous indexing consistency To: Oak devs Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Hi, After some thought and discussions about this, it seems to me that the tree copy approach is probably too complex to implement. Instead I'd like to propose a "checkpoint" mechanism that allows a client to request a state of the repository to be excluded from garbage collection for a specified amount of time. The proposed new MicroKernel method would be: /** * Creates a new checkpoint of the latest head revision. The checkpoint * guarantees that revision to remain valid and accessible for at least * as long as requested. * * @param lifetime time (in milliseconds) that the checkpoint should * remain available * @return revision id of the created checkpoint */ String checkpoint(long lifetime); And the mechanism could be reflected in the NodeStore interface like this: /** * Creates a new checkpoint of the latest root of the tree. The checkpoint * remains valid for at least as long as requested and allows that state * of the repository to be retrieved using the returned opaque string * reference. * * @param lifetime time (in milliseconds) that the checkpoint should * remain available * @return string reference of this checkpoint */ String checkpoint(long lifetime); /** * Retrieves the root node from a previously created repository checkpoint. * * @param checkpoint string reference of a checkpoint * @return the root node of the checkpoint, * or {@code null} if the checkpoint is no longer available */ NodeState retrieve(String checkpoint); BR, Jukka Zitting