You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by GitBox <gi...@apache.org> on 2020/10/27 07:31:17 UTC
[GitHub] [jackrabbit-oak] Vinod-holani opened a new pull request #258: OAK-9265 : Recovery utility function of LastRevRecoveryAgent
Vinod-holani opened a new pull request #258:
URL: https://github.com/apache/jackrabbit-oak/pull/258
should not process previous docs
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [jackrabbit-oak] mreutegg commented on a change in pull request #258: OAK-9265 : Recovery utility function of LastRevRecoveryAgent
Posted by GitBox <gi...@apache.org>.
mreutegg commented on a change in pull request #258:
URL: https://github.com/apache/jackrabbit-oak/pull/258#discussion_r520577921
##########
File path: oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/MissingLastRevSeekerTest.java
##########
@@ -216,4 +220,26 @@ public void getClusterNodeInfo() {
private ClusterNodeInfoDocument getClusterNodeInfo(int clusterId) {
return seeker.getClusterNodeInfo(clusterId);
}
+
+ @Test
+ public void getNonSplitDocs() throws Exception {
+ String nodeName = this.getClass().getName() + "-foo";
+ DocumentNodeStore dns = getBuilder().setDocumentStore(store).getNodeStore();
+ NodeBuilder b1 = dns.getRoot().builder();
+ b1.child(nodeName);
+ dns.merge(b1, EmptyHook.INSTANCE, CommitInfo.EMPTY);
+ //Modify and commit changes on this node 100 times to create a split document
+ for (int i = 0; i < NUM_REVS_THRESHOLD; i++) {
+ b1 = dns.getRoot().builder();
+ b1.child(nodeName).setProperty("prop",i);
+ dns.merge(b1, EmptyHook.INSTANCE, CommitInfo.EMPTY);
+ }
+ dns.runBackgroundOperations();
+ int docs = 0;
+ //seeker should return only non split documents
+ for(Document doc : seeker.getCandidates(0)) {
+ docs++;
+ }
Review comment:
Can be simplified with:
```suggestion
//seeker should return only non split documents
int docs = Iterables.size(seeker.getCandidates(0));
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [jackrabbit-oak] Vinod-holani commented on a change in pull request #258: OAK-9265 : Recovery utility function of LastRevRecoveryAgent
Posted by GitBox <gi...@apache.org>.
Vinod-holani commented on a change in pull request #258:
URL: https://github.com/apache/jackrabbit-oak/pull/258#discussion_r525077893
##########
File path: oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/MissingLastRevSeekerTest.java
##########
@@ -216,4 +220,26 @@ public void getClusterNodeInfo() {
private ClusterNodeInfoDocument getClusterNodeInfo(int clusterId) {
return seeker.getClusterNodeInfo(clusterId);
}
+
+ @Test
+ public void getNonSplitDocs() throws Exception {
+ String nodeName = this.getClass().getName() + "-foo";
+ DocumentNodeStore dns = getBuilder().setDocumentStore(store).getNodeStore();
+ NodeBuilder b1 = dns.getRoot().builder();
+ b1.child(nodeName);
+ dns.merge(b1, EmptyHook.INSTANCE, CommitInfo.EMPTY);
+ //Modify and commit changes on this node 100 times to create a split document
+ for (int i = 0; i < NUM_REVS_THRESHOLD; i++) {
+ b1 = dns.getRoot().builder();
+ b1.child(nodeName).setProperty("prop",i);
+ dns.merge(b1, EmptyHook.INSTANCE, CommitInfo.EMPTY);
+ }
+ dns.runBackgroundOperations();
+ int docs = 0;
+ //seeker should return only non split documents
+ for(Document doc : seeker.getCandidates(0)) {
+ docs++;
+ }
+ assertEquals(2, docs);
+ }
Review comment:
Ok so we do need to dispose the DocumentNodeStore but not underlying DocumentStore for this test case. I was confused with these two comments.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [jackrabbit-oak] Vinod-holani commented on a change in pull request #258: OAK-9265 : Recovery utility function of LastRevRecoveryAgent
Posted by GitBox <gi...@apache.org>.
Vinod-holani commented on a change in pull request #258:
URL: https://github.com/apache/jackrabbit-oak/pull/258#discussion_r524879106
##########
File path: oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/MissingLastRevSeekerTest.java
##########
@@ -216,4 +220,26 @@ public void getClusterNodeInfo() {
private ClusterNodeInfoDocument getClusterNodeInfo(int clusterId) {
return seeker.getClusterNodeInfo(clusterId);
}
+
+ @Test
+ public void getNonSplitDocs() throws Exception {
+ String nodeName = this.getClass().getName() + "-foo";
+ DocumentNodeStore dns = getBuilder().setDocumentStore(store).getNodeStore();
Review comment:
Does this wrapping is required if we are not disposing the nodestore?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [jackrabbit-oak] Vinod-holani commented on a change in pull request #258: OAK-9265 : Recovery utility function of LastRevRecoveryAgent
Posted by GitBox <gi...@apache.org>.
Vinod-holani commented on a change in pull request #258:
URL: https://github.com/apache/jackrabbit-oak/pull/258#discussion_r524880102
##########
File path: oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/MissingLastRevSeekerTest.java
##########
@@ -216,4 +220,26 @@ public void getClusterNodeInfo() {
private ClusterNodeInfoDocument getClusterNodeInfo(int clusterId) {
return seeker.getClusterNodeInfo(clusterId);
}
+
+ @Test
+ public void getNonSplitDocs() throws Exception {
+ String nodeName = this.getClass().getName() + "-foo";
+ DocumentNodeStore dns = getBuilder().setDocumentStore(store).getNodeStore();
+ NodeBuilder b1 = dns.getRoot().builder();
+ b1.child(nodeName);
+ dns.merge(b1, EmptyHook.INSTANCE, CommitInfo.EMPTY);
+ //Modify and commit changes on this node 100 times to create a split document
+ for (int i = 0; i < NUM_REVS_THRESHOLD; i++) {
+ b1 = dns.getRoot().builder();
+ b1.child(nodeName).setProperty("prop",i);
+ dns.merge(b1, EmptyHook.INSTANCE, CommitInfo.EMPTY);
+ }
+ dns.runBackgroundOperations();
+ int docs = 0;
+ //seeker should return only non split documents
+ for(Document doc : seeker.getCandidates(0)) {
+ docs++;
+ }
+ assertEquals(2, docs);
+ }
Review comment:
As per above review comment we should not do this right?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [jackrabbit-oak] mreutegg commented on a change in pull request #258: OAK-9265 : Recovery utility function of LastRevRecoveryAgent
Posted by GitBox <gi...@apache.org>.
mreutegg commented on a change in pull request #258:
URL: https://github.com/apache/jackrabbit-oak/pull/258#discussion_r515772188
##########
File path: oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/LastRevRecoveryAgent.java
##########
@@ -310,6 +310,12 @@ public void sweepUpdate(Map<Path, UpdateOp> updates)
long lastLog = startOfScan;
for (NodeDocument doc : suspects) {
+
+ //Should skip previous documents
+ if(!doc.getPath().isAbsolute()) {
Review comment:
This is even better. +1
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [jackrabbit-oak] mreutegg commented on pull request #258: OAK-9265 : Recovery utility function of LastRevRecoveryAgent
Posted by GitBox <gi...@apache.org>.
mreutegg commented on pull request #258:
URL: https://github.com/apache/jackrabbit-oak/pull/258#issuecomment-718737313
Alternatively the implementation(s) of MissingLastRevSeeker could be changed to filter our split documents. But apply the filtering later also works.
Would it be possible to have a test that reproduces the problem?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [jackrabbit-oak] mreutegg commented on pull request #258: OAK-9265 : Recovery utility function of LastRevRecoveryAgent
Posted by GitBox <gi...@apache.org>.
mreutegg commented on pull request #258:
URL: https://github.com/apache/jackrabbit-oak/pull/258#issuecomment-720287969
Hmm, it is indeed difficult to come up with a test that fails with the current code. What about a test that runs just fine in trunk, but would fail in the maintenance branches without the Path class? Though, I don't see how to write such a test either. The infinite loop would simply cause the test to run forever.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [jackrabbit-oak] mreutegg commented on a change in pull request #258: OAK-9265 : Recovery utility function of LastRevRecoveryAgent
Posted by GitBox <gi...@apache.org>.
mreutegg commented on a change in pull request #258:
URL: https://github.com/apache/jackrabbit-oak/pull/258#discussion_r525057869
##########
File path: oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/MissingLastRevSeekerTest.java
##########
@@ -216,4 +220,26 @@ public void getClusterNodeInfo() {
private ClusterNodeInfoDocument getClusterNodeInfo(int clusterId) {
return seeker.getClusterNodeInfo(clusterId);
}
+
+ @Test
+ public void getNonSplitDocs() throws Exception {
+ String nodeName = this.getClass().getName() + "-foo";
+ DocumentNodeStore dns = getBuilder().setDocumentStore(store).getNodeStore();
+ NodeBuilder b1 = dns.getRoot().builder();
+ b1.child(nodeName);
+ dns.merge(b1, EmptyHook.INSTANCE, CommitInfo.EMPTY);
+ //Modify and commit changes on this node 100 times to create a split document
+ for (int i = 0; i < NUM_REVS_THRESHOLD; i++) {
+ b1 = dns.getRoot().builder();
+ b1.child(nodeName).setProperty("prop",i);
+ dns.merge(b1, EmptyHook.INSTANCE, CommitInfo.EMPTY);
+ }
+ dns.runBackgroundOperations();
+ int docs = 0;
+ //seeker should return only non split documents
+ for(Document doc : seeker.getCandidates(0)) {
+ docs++;
+ }
+ assertEquals(2, docs);
+ }
Review comment:
Actually, the test _should_ dispose the `DocumentNodeStore` when it is not needed anymore. Some tests use a `DocumentMKBuilderProvider` rule that takes care of disposing the node store automatically after the test, but this test creates the node store manually.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [jackrabbit-oak] Vinod-holani commented on a change in pull request #258: OAK-9265 : Recovery utility function of LastRevRecoveryAgent
Posted by GitBox <gi...@apache.org>.
Vinod-holani commented on a change in pull request #258:
URL: https://github.com/apache/jackrabbit-oak/pull/258#discussion_r523889859
##########
File path: oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/BasicDocumentStoreTest.java
##########
@@ -54,6 +55,18 @@ public BasicDocumentStoreTest(DocumentStoreFixture dsf) {
super(dsf);
}
+ @After
+ public void tearDown() {
+ Revision.resetClockToDefault();
+ markDocumentsForCleanup();
+ }
+
+ private void markDocumentsForCleanup() {
+ for (NodeDocument doc : Utils.getAllDocuments(ds)) {
+ removeMe.add(doc.getId());
+ }
+ }
+
Review comment:
There was one node created by this class which was not getting cleaned up and causing the newly created test to fail. Thats why I added this cleanup over here. I will dig deeper in this.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [jackrabbit-oak] Vinod-holani commented on a change in pull request #258: OAK-9265 : Recovery utility function of LastRevRecoveryAgent
Posted by GitBox <gi...@apache.org>.
Vinod-holani commented on a change in pull request #258:
URL: https://github.com/apache/jackrabbit-oak/pull/258#discussion_r524879908
##########
File path: oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/MissingLastRevSeekerTest.java
##########
@@ -216,4 +220,26 @@ public void getClusterNodeInfo() {
private ClusterNodeInfoDocument getClusterNodeInfo(int clusterId) {
return seeker.getClusterNodeInfo(clusterId);
}
+
+ @Test
+ public void getNonSplitDocs() throws Exception {
+ String nodeName = this.getClass().getName() + "-foo";
+ DocumentNodeStore dns = getBuilder().setDocumentStore(store).getNodeStore();
+ NodeBuilder b1 = dns.getRoot().builder();
+ b1.child(nodeName);
+ dns.merge(b1, EmptyHook.INSTANCE, CommitInfo.EMPTY);
+ //Modify and commit changes on this node 100 times to create a split document
+ for (int i = 0; i < NUM_REVS_THRESHOLD; i++) {
+ b1 = dns.getRoot().builder();
+ b1.child(nodeName).setProperty("prop",i);
+ dns.merge(b1, EmptyHook.INSTANCE, CommitInfo.EMPTY);
+ }
+ dns.runBackgroundOperations();
+ int docs = 0;
+ //seeker should return only non split documents
+ for(Document doc : seeker.getCandidates(0)) {
+ docs++;
+ }
Review comment:
Done
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [jackrabbit-oak] Vinod-holani commented on a change in pull request #258: OAK-9265 : Recovery utility function of LastRevRecoveryAgent
Posted by GitBox <gi...@apache.org>.
Vinod-holani commented on a change in pull request #258:
URL: https://github.com/apache/jackrabbit-oak/pull/258#discussion_r524879258
##########
File path: oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/BasicDocumentStoreTest.java
##########
@@ -54,6 +55,18 @@ public BasicDocumentStoreTest(DocumentStoreFixture dsf) {
super(dsf);
}
+ @After
+ public void tearDown() {
+ Revision.resetClockToDefault();
+ markDocumentsForCleanup();
+ }
+
+ private void markDocumentsForCleanup() {
+ for (NodeDocument doc : Utils.getAllDocuments(ds)) {
+ removeMe.add(doc.getId());
+ }
+ }
+
Review comment:
Fixed the culprit test case from BasicDocumentStoreTest class
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [jackrabbit-oak] Vinod-holani commented on a change in pull request #258: OAK-9265 : Recovery utility function of LastRevRecoveryAgent
Posted by GitBox <gi...@apache.org>.
Vinod-holani commented on a change in pull request #258:
URL: https://github.com/apache/jackrabbit-oak/pull/258#discussion_r523910361
##########
File path: oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/BasicDocumentStoreTest.java
##########
@@ -54,6 +55,18 @@ public BasicDocumentStoreTest(DocumentStoreFixture dsf) {
super(dsf);
}
+ @After
+ public void tearDown() {
+ Revision.resetClockToDefault();
+ markDocumentsForCleanup();
+ }
+
+ private void markDocumentsForCleanup() {
+ for (NodeDocument doc : Utils.getAllDocuments(ds)) {
+ removeMe.add(doc.getId());
+ }
+ }
+
Review comment:
Basically this [0] is the culprit function creating a node but not able to delete it. Need to either fix this or can add after cleanup function as already done.
[0] : https://github.com/apache/jackrabbit-oak/blob/trunk/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/BasicDocumentStoreTest.java#L1144
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [jackrabbit-oak] mreutegg commented on a change in pull request #258: OAK-9265 : Recovery utility function of LastRevRecoveryAgent
Posted by GitBox <gi...@apache.org>.
mreutegg commented on a change in pull request #258:
URL: https://github.com/apache/jackrabbit-oak/pull/258#discussion_r514241226
##########
File path: oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/LastRevRecoveryAgent.java
##########
@@ -310,6 +310,12 @@ public void sweepUpdate(Map<Path, UpdateOp> updates)
long lastLog = startOfScan;
for (NodeDocument doc : suspects) {
+
+ //Should skip previous documents
+ if(!doc.getPath().isAbsolute()) {
Review comment:
I would rather make a decision on NodeDocument.getSplitDocType(). WDYT?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [jackrabbit-oak] Vinod-holani commented on a change in pull request #258: OAK-9265 : Recovery utility function of LastRevRecoveryAgent
Posted by GitBox <gi...@apache.org>.
Vinod-holani commented on a change in pull request #258:
URL: https://github.com/apache/jackrabbit-oak/pull/258#discussion_r524879799
##########
File path: oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/MissingLastRevSeekerTest.java
##########
@@ -216,4 +220,26 @@ public void getClusterNodeInfo() {
private ClusterNodeInfoDocument getClusterNodeInfo(int clusterId) {
return seeker.getClusterNodeInfo(clusterId);
}
+
+ @Test
+ public void getNonSplitDocs() throws Exception {
+ String nodeName = this.getClass().getName() + "-foo";
+ DocumentNodeStore dns = getBuilder().setDocumentStore(store).getNodeStore();
+ NodeBuilder b1 = dns.getRoot().builder();
+ b1.child(nodeName);
+ dns.merge(b1, EmptyHook.INSTANCE, CommitInfo.EMPTY);
+ //Modify and commit changes on this node 100 times to create a split document
+ for (int i = 0; i < NUM_REVS_THRESHOLD; i++) {
+ b1 = dns.getRoot().builder();
+ b1.child(nodeName).setProperty("prop",i);
+ dns.merge(b1, EmptyHook.INSTANCE, CommitInfo.EMPTY);
+ }
+ dns.runBackgroundOperations();
Review comment:
Done
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [jackrabbit-oak] mreutegg commented on a change in pull request #258: OAK-9265 : Recovery utility function of LastRevRecoveryAgent
Posted by GitBox <gi...@apache.org>.
mreutegg commented on a change in pull request #258:
URL: https://github.com/apache/jackrabbit-oak/pull/258#discussion_r520594302
##########
File path: oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/MissingLastRevSeekerTest.java
##########
@@ -216,4 +220,26 @@ public void getClusterNodeInfo() {
private ClusterNodeInfoDocument getClusterNodeInfo(int clusterId) {
return seeker.getClusterNodeInfo(clusterId);
}
+
+ @Test
+ public void getNonSplitDocs() throws Exception {
+ String nodeName = this.getClass().getName() + "-foo";
+ DocumentNodeStore dns = getBuilder().setDocumentStore(store).getNodeStore();
+ NodeBuilder b1 = dns.getRoot().builder();
+ b1.child(nodeName);
+ dns.merge(b1, EmptyHook.INSTANCE, CommitInfo.EMPTY);
+ //Modify and commit changes on this node 100 times to create a split document
+ for (int i = 0; i < NUM_REVS_THRESHOLD; i++) {
+ b1 = dns.getRoot().builder();
+ b1.child(nodeName).setProperty("prop",i);
+ dns.merge(b1, EmptyHook.INSTANCE, CommitInfo.EMPTY);
+ }
+ dns.runBackgroundOperations();
+ int docs = 0;
+ //seeker should return only non split documents
+ for(Document doc : seeker.getCandidates(0)) {
+ docs++;
+ }
+ assertEquals(2, docs);
+ }
Review comment:
The DocumentNodeStore is not disposed.
```suggestion
dns.dispose();
}
```
##########
File path: oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/BasicDocumentStoreTest.java
##########
@@ -54,6 +55,18 @@ public BasicDocumentStoreTest(DocumentStoreFixture dsf) {
super(dsf);
}
+ @After
+ public void tearDown() {
+ Revision.resetClockToDefault();
+ markDocumentsForCleanup();
+ }
+
+ private void markDocumentsForCleanup() {
+ for (NodeDocument doc : Utils.getAllDocuments(ds)) {
+ removeMe.add(doc.getId());
+ }
+ }
+
Review comment:
Why is this needed in BasicDocumentStoreTest? AFAICS none of the tests uses a Clock. I think this should rather go to `MissingLastRevSeekerTest` and clean up documents created by the new `getNonSplitDocs()` test.
##########
File path: oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/MissingLastRevSeekerTest.java
##########
@@ -216,4 +220,26 @@ public void getClusterNodeInfo() {
private ClusterNodeInfoDocument getClusterNodeInfo(int clusterId) {
return seeker.getClusterNodeInfo(clusterId);
}
+
+ @Test
+ public void getNonSplitDocs() throws Exception {
+ String nodeName = this.getClass().getName() + "-foo";
+ DocumentNodeStore dns = getBuilder().setDocumentStore(store).getNodeStore();
+ NodeBuilder b1 = dns.getRoot().builder();
+ b1.child(nodeName);
+ dns.merge(b1, EmptyHook.INSTANCE, CommitInfo.EMPTY);
+ //Modify and commit changes on this node 100 times to create a split document
+ for (int i = 0; i < NUM_REVS_THRESHOLD; i++) {
+ b1 = dns.getRoot().builder();
+ b1.child(nodeName).setProperty("prop",i);
+ dns.merge(b1, EmptyHook.INSTANCE, CommitInfo.EMPTY);
+ }
+ dns.runBackgroundOperations();
Review comment:
When triggering background operations manually, the background threads should be disabled on the DocumentNodeStore with `DocumentNodeStoreBuilder.setAsyncDelay(0)`.
##########
File path: oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/MissingLastRevSeekerTest.java
##########
@@ -216,4 +220,26 @@ public void getClusterNodeInfo() {
private ClusterNodeInfoDocument getClusterNodeInfo(int clusterId) {
return seeker.getClusterNodeInfo(clusterId);
}
+
+ @Test
+ public void getNonSplitDocs() throws Exception {
+ String nodeName = this.getClass().getName() + "-foo";
+ DocumentNodeStore dns = getBuilder().setDocumentStore(store).getNodeStore();
+ NodeBuilder b1 = dns.getRoot().builder();
+ b1.child(nodeName);
+ dns.merge(b1, EmptyHook.INSTANCE, CommitInfo.EMPTY);
+ //Modify and commit changes on this node 100 times to create a split document
+ for (int i = 0; i < NUM_REVS_THRESHOLD; i++) {
+ b1 = dns.getRoot().builder();
+ b1.child(nodeName).setProperty("prop",i);
+ dns.merge(b1, EmptyHook.INSTANCE, CommitInfo.EMPTY);
+ }
+ dns.runBackgroundOperations();
Review comment:
At this point the test should remember the documents for the cleanup.
```suggestion
dns.runBackgroundOperations();
// remember all documents for cleanup
for (NodeDocument doc : Utils.getAllDocuments(ds)) {
removeMe.add(doc.getId());
}
```
##########
File path: oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/MissingLastRevSeekerTest.java
##########
@@ -216,4 +220,26 @@ public void getClusterNodeInfo() {
private ClusterNodeInfoDocument getClusterNodeInfo(int clusterId) {
return seeker.getClusterNodeInfo(clusterId);
}
+
+ @Test
+ public void getNonSplitDocs() throws Exception {
+ String nodeName = this.getClass().getName() + "-foo";
+ DocumentNodeStore dns = getBuilder().setDocumentStore(store).getNodeStore();
Review comment:
The DocumentNodeStore should use the clock setup by this test. Otherwise it can be unstable because `Revision` and `ClusterNodeInfo` are using the virtual clock. Unfortunately it is also necessary to wrap the store and prevent disposal of the underlying store.
```suggestion
DocumentNodeStore dns = getBuilder().clock(clock).setAsyncDelay(0)
.setDocumentStore(new DocumentStoreWrapper(store) {
@Override
public void dispose() {
// do not close underlying store, otherwise cleanup
// cannot remove documents after the test
}
}).getNodeStore();
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [jackrabbit-oak] Vinod-holani closed pull request #258: OAK-9265 : Recovery utility function of LastRevRecoveryAgent
Posted by GitBox <gi...@apache.org>.
Vinod-holani closed pull request #258:
URL: https://github.com/apache/jackrabbit-oak/pull/258
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [jackrabbit-oak] Vinod-holani commented on pull request #258: OAK-9265 : Recovery utility function of LastRevRecoveryAgent
Posted by GitBox <gi...@apache.org>.
Vinod-holani commented on pull request #258:
URL: https://github.com/apache/jackrabbit-oak/pull/258#issuecomment-723835923
@mreutegg @reschke could you please review this PR?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [jackrabbit-oak] reschke commented on pull request #258: OAK-9265 : Recovery utility function of LastRevRecoveryAgent
Posted by GitBox <gi...@apache.org>.
reschke commented on pull request #258:
URL: https://github.com/apache/jackrabbit-oak/pull/258#issuecomment-723983017
sorry, currently not working on Oak...
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [jackrabbit-oak] Vinod-holani commented on a change in pull request #258: OAK-9265 : Recovery utility function of LastRevRecoveryAgent
Posted by GitBox <gi...@apache.org>.
Vinod-holani commented on a change in pull request #258:
URL: https://github.com/apache/jackrabbit-oak/pull/258#discussion_r524879427
##########
File path: oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/MissingLastRevSeekerTest.java
##########
@@ -216,4 +220,26 @@ public void getClusterNodeInfo() {
private ClusterNodeInfoDocument getClusterNodeInfo(int clusterId) {
return seeker.getClusterNodeInfo(clusterId);
}
+
+ @Test
+ public void getNonSplitDocs() throws Exception {
+ String nodeName = this.getClass().getName() + "-foo";
+ DocumentNodeStore dns = getBuilder().setDocumentStore(store).getNodeStore();
+ NodeBuilder b1 = dns.getRoot().builder();
+ b1.child(nodeName);
+ dns.merge(b1, EmptyHook.INSTANCE, CommitInfo.EMPTY);
+ //Modify and commit changes on this node 100 times to create a split document
+ for (int i = 0; i < NUM_REVS_THRESHOLD; i++) {
+ b1 = dns.getRoot().builder();
+ b1.child(nodeName).setProperty("prop",i);
+ dns.merge(b1, EmptyHook.INSTANCE, CommitInfo.EMPTY);
+ }
+ dns.runBackgroundOperations();
Review comment:
Done
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [jackrabbit-oak] mreutegg commented on a change in pull request #258: OAK-9265 : Recovery utility function of LastRevRecoveryAgent
Posted by GitBox <gi...@apache.org>.
mreutegg commented on a change in pull request #258:
URL: https://github.com/apache/jackrabbit-oak/pull/258#discussion_r525059499
##########
File path: oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/MissingLastRevSeekerTest.java
##########
@@ -216,4 +220,26 @@ public void getClusterNodeInfo() {
private ClusterNodeInfoDocument getClusterNodeInfo(int clusterId) {
return seeker.getClusterNodeInfo(clusterId);
}
+
+ @Test
+ public void getNonSplitDocs() throws Exception {
+ String nodeName = this.getClass().getName() + "-foo";
+ DocumentNodeStore dns = getBuilder().setDocumentStore(store).getNodeStore();
Review comment:
Disposal is needed, otherwise some background threads continue to run and occupy a clusterId. E.g. the lease update thread.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org