Index: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java =================================================================== --- oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java (revision 1777538) +++ oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java (working copy) @@ -713,6 +713,9 @@ } } reindexedDefinitions.clear(); + if (!store.release(afterCheckpoint)) { + log.debug("[{}] Unable to release checkpoint {}", name, afterCheckpoint); + } } updatePostRunStatus = true; } Index: oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/property/AsyncPropertyIndexTest.java =================================================================== --- oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/property/AsyncPropertyIndexTest.java (revision 1777538) +++ oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/property/AsyncPropertyIndexTest.java (working copy) @@ -17,7 +17,6 @@ package org.apache.jackrabbit.oak.plugins.index.property; import static com.google.common.collect.ImmutableSet.of; -import static org.apache.jackrabbit.JcrConstants.JCR_SYSTEM; import static org.apache.jackrabbit.JcrConstants.NT_BASE; import static org.apache.jackrabbit.oak.api.Type.STRINGS; import static org.apache.jackrabbit.oak.plugins.index.IndexConstants.ASYNC_PROPERTY_NAME; @@ -25,10 +24,10 @@ import static org.apache.jackrabbit.oak.plugins.index.IndexConstants.INDEX_DEFINITIONS_NAME; import static org.apache.jackrabbit.oak.plugins.index.IndexConstants.REINDEX_ASYNC_PROPERTY_NAME; import static org.apache.jackrabbit.oak.plugins.index.IndexUtils.createIndexDefinition; -import static org.apache.jackrabbit.oak.plugins.nodetype.NodeTypeConstants.JCR_NODE_TYPES; import static org.apache.jackrabbit.oak.spi.commit.CommitInfo.EMPTY; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; +import static org.junit.Assert.assertTrue; import java.util.Arrays; import java.util.Set; @@ -52,6 +51,7 @@ import org.junit.Test; import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Iterables; import com.google.common.collect.Sets; /** @@ -66,6 +66,7 @@ @Test public void testAsyncPropertyLookup() throws Exception { NodeStore store = new MemoryNodeStore(); + assertTrue(Iterables.isEmpty(store.checkpoints())); NodeBuilder builder = store.getRoot().builder(); @@ -101,8 +102,10 @@ // run async second time, there are no changes, should switch to sync async.run(); + async.close(); assertEquals(null, store.getRoot().getChildNode(INDEX_DEFINITIONS_NAME) .getChildNode("foo").getString(ASYNC_PROPERTY_NAME)); + assertTrue(Iterables.isEmpty(store.checkpoints())); // add content, it should be indexed synchronously builder = store.getRoot().builder();