mreutegg commented on code in PR #812:
URL: https://github.com/apache/jackrabbit-oak/pull/812#discussion_r1062602664
##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java:
##########
@@ -3699,6 +3714,24 @@ private static Supplier<Integer>
getDelay(DocumentNodeStore ns) {
}
}
+ /**
+ * Background unmerged branch commits & collision marker operation.
+ */
+ private static class BackgroundPurgeOperation extends NodeStoreTask {
+
+ BackgroundPurgeOperation(DocumentNodeStore nodeStore, AtomicBoolean
isDisposed) {
+ // run every 60 secs
+ super(nodeStore, isDisposed, Suppliers.ofInstance(60000));
+ }
+
+ @Override
+ protected void execute(@NotNull DocumentNodeStore nodeStore) {
+ ClusterNodeInfoDocument.all(nodeStore.nonLeaseCheckingStore)
+ .stream().filter(cluster -> !cluster.isActive())
+
.forEach(nodeStore::purgeUnmergedBranchCommitAndCollisionMarkers);
Review Comment:
I would like to see an additional safeguard here. It is possible that a
clusterId is initially inactive and while
`purgeUnmergedBranchCommitAndCollisionMarkers()` is called, the clusterId
becomes active. There is a risk that the purge interferes with new commits done
by the now active clusterId.
E.g. the purge method could consider a cut-off revision defined by
`lastWrittenRootRev` on the `ClusterNodeInfoDocument`. The implementation would
only purge revisions that are older than `lastWrittenRootRev`.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]