[ https://issues.apache.org/jira/browse/OAK-8449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16878441#comment-16878441 ]
Marcel Reutegger commented on OAK-8449: --------------------------------------- Thanks [~vholani] for the patch. This looks already quite good. I have a few suggestions. - Add a NotNull annotation to the path parameter of DocumentNodeStoreMBean.recover() - Use Guava's Preconditions.checkNotNull() in the implementation to ensure the path is not null - The check for clusterId == 0 and subsequently throwing a NullPointerException is strange. It would be good to check the clusterId is greater than 0, otherwise throw an IllegalArgumentException - Add a note to the description of DocumentNodeStoreMBean.recover() that recover can only run on inactive clusterIds and what the behaviour is when the DocumentNodeStore is read-only. - The for loop in the recover() implementation throws a DocumentStoreException when a document does not exist while traversing up the hierarchy. However, there may be valid gaps in the document hierarchy when descendant nodes are bundled. See https://jackrabbit.apache.org/oak/docs/nodestore/document/node-bundling.html - Please extend the test or add more tests for cases like a read-only DocumentNodeStore and when an attempt is made to recover for an active clusterId. I would basically like to see full statement and branch coverage by the tests. > LastRev check/fix in DocumentNodeStore MBean > -------------------------------------------- > > Key: OAK-8449 > URL: https://issues.apache.org/jira/browse/OAK-8449 > Project: Jackrabbit Oak > Issue Type: Task > Components: documentmk > Reporter: Vinod Holani > Assignee: Marcel Reutegger > Priority: Minor > Attachments: OAK-8449_1.patch > > > There is existing tooling to check _lastRev consistency of documents in the > DocumentStore. Some of the tooling is limited to MongoDB because it is > implemented as utility functions for the MongoDB shell > ([oak-mongo.js|https://jackrabbit.apache.org/oak/docs/oak-mongo-js/oak.html]). > The oak-run > [recovery|https://github.com/apache/jackrabbit-oak/tree/trunk/oak-run#recovery-mode] > command was initially only available on MongoDB as well, but recently RDB > support was added (OAK-8004). The recovery command however has some > drawbacks. It scans the entire nodes collection, which can be a rather > expensive operation and when started in read-write mode. > This improvement is about adding _lastRev check and fix functionality to the > DocumentNodeStore MBean. The scope of the check and fix would be limited to > some path(s) in order to keep the runtime of the operation low. -- This message was sent by Atlassian JIRA (v7.6.3#76005)