jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jukka Zitting <jukka.zitt...@gmail.com>
Subject Re: Lifetime of revision identifiers
Date Tue, 03 Apr 2012 10:50:47 GMT

On Tue, Apr 3, 2012 at 11:56 AM, Dominique Pfister <dpfister@adobe.com> wrote:
> On Apr 3, 2012, at 11:51 AM, Jukka Zitting wrote:
>> You'd drop revision identifiers from the MicroKernel interface? That's
>> a pretty big design change...
> No, I probably did not make myself clear: I would not keep a revision
> (and all its nodes) reachable in terms of garbage collection, simply
> because it was accessed by a client some time ago.

If that's the case, I'm worried about what could happen to code like this:

    String revision = mk.getHeadRevision();
    String root = getNodes("/", revision);

Suppose someone else makes a commit in between the two calls and the
garbage collector gets triggered. The result then would be that the
getNodes() call will fail because the given revision identifier is no
longer available.

And if you consider that an unlikely enough scenario, consider a case
where I want to then page through a potentially large list of the
child nodes:

    int page_size = 10;
    long count = getChildNodeCount(root);
    for (long offset = 0; offset < count; offset += page_size) {
        String children = mk.getNodes("/", revision, 1, offset,
page_size, null);

That could take a potentially long time, during which the revision
might well get garbage-collected. How should a client prepare for such
a situation?


Jukka Zitting

View raw message