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 CDAF59324 for ; Mon, 2 Apr 2012 16:35:04 +0000 (UTC) Received: (qmail 28888 invoked by uid 500); 2 Apr 2012 16:35:04 -0000 Delivered-To: apmail-jackrabbit-oak-dev-archive@jackrabbit.apache.org Received: (qmail 28851 invoked by uid 500); 2 Apr 2012 16:35:04 -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 28842 invoked by uid 99); 2 Apr 2012 16:35:04 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Apr 2012 16:35:04 +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 (nike.apache.org: domain of stefan.guggisberg@gmail.com designates 209.85.210.170 as permitted sender) Received: from [209.85.210.170] (HELO mail-iy0-f170.google.com) (209.85.210.170) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Apr 2012 16:34:56 +0000 Received: by iaeh11 with SMTP id h11so9648203iae.1 for ; Mon, 02 Apr 2012 09:34:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=2EPArzHvHc9q2QQwQ1reV9kiCY7Kjl5J082/C9i//ac=; b=O3k8AKz1v5oWBTBZ4vUQhl2APm5x5M2YWAa+JI3sZZ7vvN8z8OZRzfbDrl15EAG9eF ZDmJnPWKfFET7uP+gD4pq8iQ1cgpk2lKgSD5J8DSAVxakaRQH/NJCI7KK8HtBhh8JkDh 084E2cq75acK+jCV0WaAHBPEAbUNF381XGwML2Xm7hVng3sfL8iZ1DM2j6g6scSRjtn0 xTky/45FGotnvPUpeHRBZwEpQG/Tb/7EZMLI4oib06Ws/JWL94dkF1CRjyUJAZndBIw6 1jYMcb6kb0m9M+wQ60+9NF8SYD2VWv6MUEwYhu0iYIcfZJgFbaIlwYwfPLpHeV6SA1On t3xw== MIME-Version: 1.0 Received: by 10.50.159.198 with SMTP id xe6mr7216354igb.74.1333384475950; Mon, 02 Apr 2012 09:34:35 -0700 (PDT) Received: by 10.42.174.1 with HTTP; Mon, 2 Apr 2012 09:34:35 -0700 (PDT) In-Reply-To: References: Date: Mon, 2 Apr 2012 18:34:35 +0200 Message-ID: Subject: Re: Lifetime of revision identifiers From: Stefan Guggisberg To: oak-dev@jackrabbit.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Sat, Mar 31, 2012 at 12:39 PM, Jukka Zitting w= rote: > Hi, > > The revision identifiers returned by methods like > MicroKernel.getHeadRevision() are plain strings so in theory I could > write one down on a piece of paper, lock it in a safe, and come back > ten years later expecting the identifier to give me access to the > repository content as it existed a decade ago. > > Currently there's nothing in the documented MicroKernel contract that > prevents me from expecting that the above use case would work. This is > troublesome as it means that *no* past state of the repository should > ever be automatically cleaned out as garbage. right, there's currently no mention of lifetime of revisions in the javadoc= . i agree that this needs to be clearly specified. > > To allow automatic garbage collection without unexpectedly breaking > client expectations, we should define some rules on the expected > lifetime of revision identifiers. Without rules like that a client > can't even do the following without worrying about potential > interference from the garbage collector: > > =A0 =A0String revision =3D mk.getHeadRevision(); > =A0 =A0String root =3D mk.getNodes(revision, "/"); > > Since the revision identifiers are plain strings, we can't leverage > the standard garbage collector of the JVM and simply declare that all > revisions identifiers will remain valid for at least as long as they > are being referenced by some client. Thus a lease mechanism like > "revision identifiers remain valid for at least N minutes since last > access" may be needed. A client like a long-lived JCR Session would > then need to either periodically refresh to the latest revision or > extend its "lease" on an earlier revision. i think that we should specify that revisions have a certain guaranteed life span, e.g. N minutes, and that a client cannot expect to be able to read a revision exceeding that life span. however, what should the guaranteed life span be? 1 minute, 1 hour, 1 day? i don't think that we should allow clients to explicitly extend the life sp= an of a specific revision. this would IMO unnecessarily complicate the GC logic and it would allow misbehaved clients to compromise the stability of the mk. cheers stefan > > Or we could combine these approaches by defining a Revision interface > for local Java clients and an accompanying Revision-String mapping > with defined lease handling for remote access. > > WDYT? > > BR, > > Jukka Zitting