stefan-egli commented on code in PR #1605:
URL: https://github.com/apache/jackrabbit-oak/pull/1605#discussion_r1725101550
##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/NodeDocument.java:
##########
@@ -610,6 +610,9 @@ int purgeUncommittedRevisions(final int clusterId, final
int batchSize,
if (!Utils.isCommitted(commitValue) && r.getClusterId() ==
clusterId && olderThanLastWrittenRootRevPredicate.test(r)) {
uniqueRevisions.add(r);
removeBranchCommit(op, r);
+ if (op.getId().equals(Utils.getIdFromPath("/"))) {
+ removeCommitRoot(op, r);
+ }
Review Comment:
```suggestion
if (op.getId().equals(Utils.getIdFromPath(Path.ROOT))
&& getLocalCommitRoot().containsKey(r)) {
removeCommitRoot(op, r);
}
```
While this is somewhat of a detail, I think it would make it less intrusive
if `removeCommitRoot` was only called when the revision `r` is actually on that
document (`this`). Otherwise this is added to many unnecessary cases (where it
wouldn't necessarily do harm, but be unnecessary). Wdyt?
##########
oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/BranchTest.java:
##########
@@ -56,6 +56,12 @@ public class BranchTest {
@Rule
public DocumentMKBuilderProvider builderProvider = new
DocumentMKBuilderProvider();
+ @Before
+ public void before() {
Review Comment:
```suggestion
@After
public void after() {
```
Shouldn't this be in an after method rather than before?
--
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]