Skip to content

Commit

Permalink
OAK-8603: Composite Node Store + Counter Index: allow indexing from s…
Browse files Browse the repository at this point in the history
…cratch / reindex

git-svn-id: https://svn.apache.org/repos/asf/jackrabbit/oak/trunk@1867371 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
catholicon committed Sep 23, 2019
1 parent 6b6fe17 commit fc76969
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,11 @@ private void leaveNew() throws CommitFailedException {
}
root.callback.indexUpdate();
for (Map.Entry<Mount, Integer> e : countOffsets.entrySet()) {
NodeBuilder builder = getBuilder(e.getKey());
Mount mount = e.getKey();
if (mount.isReadOnly()) {
continue;
}
NodeBuilder builder = getBuilder(mount);
int countOffset = e.getValue();

PropertyState p = builder.getProperty(COUNT_HASH_PROPERTY_NAME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import static org.apache.jackrabbit.oak.plugins.index.lucene.TestUtil.shutdown;
import static org.hamcrest.CoreMatchers.containsString;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat;

@SuppressWarnings("ConstantConditions")
Expand Down Expand Up @@ -113,6 +114,19 @@ public void addIndexInReadWriteWithIndexExistinginReadOnly() throws Exception {
repoV1.setupIndexAndContentInRepo("luceneTest", "foo", true, VERSION_1);
}

@Test
public void reindexCounterIndex() throws Exception {
Session s = repoV1.getSession();
Node c = s.getRootNode().getNode(INDEX_DEFINITIONS_NAME).getNode("counter");

c.setProperty("async", (String) null);
c.setProperty("resolution", 1);
c.setProperty("reindex", true);
s.save();

assertFalse(c.getProperty("reindex").getBoolean());
}

/**
* Given a composite jcr repo with a lucene index with indexed data from both read only and read write parts
* We create a V2 of this repo which will have the lucene index removed -
Expand Down

0 comments on commit fc76969

Please sign in to comment.