[ 
https://issues.apache.org/jira/browse/OAK-5590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15853983#comment-15853983
 ] 

Francesco Mari commented on OAK-5590:
-------------------------------------

Since there is no way to populate {{badPaths}} from the CLI, the algorithm 
implemented by the consistency checker should probably be changed as follow.

{noformat}
for each revision in journal {
  badPath = traverse(revision)
  if badPath != null {
    print revision, badPath
  } else {
    return revision
  }
}
{noformat}

This makes the {{\--deep}} option obsolete because a deep traversal of the 
content tree is always performed.

I don't see how {{badPaths}} can be useful in the current implementation. A 
broken path in a revision might not be broken in an earlier one. As such, to 
find a good revision that is genuinely good a full traversal is required in 
every iteration of the loop.

> The check command doesn't do any check when "deep" option is not provided
> -------------------------------------------------------------------------
>
>                 Key: OAK-5590
>                 URL: https://issues.apache.org/jira/browse/OAK-5590
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: run, segment-tar
>            Reporter: Andrei Dulceanu
>            Assignee: Andrei Dulceanu
>              Labels: tooling
>             Fix For: 1.8, 1.6.1
>
>
> When the {{check}} command is used without {{--deep}} option, there is no 
> check/traversal being done against the repository.
> First relevant line in code is [1], where a check is supposed to happen, but 
> due to a mismatch between argument expected/argument provided, {{null}} is 
> always returned without checking anything. The method which should do the 
> actual check [2] expects a set of paths to be traversed, but this set is 
> always empty. Therefore, relevant code for running the check is never 
> executed [3].
> [1] 
> https://github.com/apache/jackrabbit-oak/blob/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/tooling/ConsistencyChecker.java#L120
> [2] 
> https://github.com/apache/jackrabbit-oak/blob/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/tooling/ConsistencyChecker.java#L183
> [3] 
> https://github.com/apache/jackrabbit-oak/blob/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/tooling/ConsistencyChecker.java#L194



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to