[jira] [Comment Edited] (OAK-8035) Debug logging when two or more indices have same or very close cost amounts doesn't work in case both indices belong to the same type of Query Index

2019-02-13 Thread Nitin Gupta (JIRA)


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

Nitin Gupta edited comment on OAK-8035 at 2/13/19 10:09 AM:


[~tmueller] - yup -  I don't have commit rights . This is actually my first 
contribution here. 

So I will be glad if you or [~teofili] can commit for me . Thanks a lot for the 
help .


was (Author: nitigup):
[~tmueller] - yup -  I don't have commit rights . This is actually my first 
contribution here. 

So - yeah you or [~teofili] can commit for me . Thanks a lot for the help .

> Debug logging when two or more indices have same or very close cost amounts 
> doesn't work in case both indices belong to the same type of Query Index
> 
>
> Key: OAK-8035
> URL: https://issues.apache.org/jira/browse/OAK-8035
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: query
>Reporter: Nitin Gupta
>Assignee: Nitin Gupta
>Priority: Major
> Attachments: OAK-8035.patch, OAK-8035_2.patch
>
>
> Steps to reproduce -
>  # You would need two index definitions of same query index type , let's say 
> fullText index , having similar cost evaluations.
>  # Now while the index plan is evaluated you will notice that there should 
> have been a debug log saying that selected index has similar cost - this 
> serves as an important warning to either change the index definitions or the 
> query 
> ([https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryImpl.java#L1069#L1072)]
>  
> However If we have a look at this code block here - 
> [https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryImpl.java#L1017#L1041]
>  , there is no comparison for near best costs for index plans having same 
> query index type .
>  
> cc : [~teofili]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Comment Edited] (OAK-8035) Debug logging when two or more indices have same or very close cost amounts doesn't work in case both indices belong to the same type of Query Index

2019-02-15 Thread Julian Reschke (JIRA)


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

Julian Reschke edited comment on OAK-8035 at 2/15/19 4:08 PM:
--

With this change, the build fails for me:

{noformat}
[WARNING] Corrupted STDOUT by directly writing to native stream in forked JVM 
1. See FAQ web page and the dump file 
/mnt/c/projects/apache/oak/trunk/oak-core/target/surefire-reports/2019-02-15T15-44-24_303-jvmRun1.dumpstream
[ERROR] Tests run: 42, Failures: 0, Errors: 18, Skipped: 0, Time elapsed: 
80.928 s <<< FAILURE! - in 
org.apache.jackrabbit.oak.security.authorization.accesscontrol.AccessControlImporterIgnoreTest
[ERROR] 
testImportWithRestrictionNodeInfo(org.apache.jackrabbit.oak.security.authorization.accesscontrol.AccessControlImporterIgnoreTest)
  Time elapsed: 9.922 s  <<< ERROR!
java.lang.OutOfMemoryError: Java heap space

[ERROR] 
testImportWithRestrictionNodeInfo(org.apache.jackrabbit.oak.security.authorization.accesscontrol.AccessControlImporterIgnoreTest)
  Time elapsed: 9.922 s  <<< ERROR!
java.lang.NullPointerException

[ERROR] 
testEndChildInfoIncompleteAce(org.apache.jackrabbit.oak.security.authorization.accesscontrol.AccessControlImporterIgnoreTest)
  Time elapsed: 5.238 s  <<< ERROR!
java.lang.OutOfMemoryError: Java heap space
{noformat}

Backing out the change is fixing he build for me.



was (Author: reschke):
With this change, the build fails for me:

{noformat}
[WARNING] Corrupted STDOUT by directly writing to native stream in forked JVM 
1. See FAQ web page and the dump file 
/mnt/c/projects/apache/oak/trunk/oak-core/target/surefire-reports/2019-02-15T15-44-24_303-jvmRun1.dumpstream
[ERROR] Tests run: 42, Failures: 0, Errors: 18, Skipped: 0, Time elapsed: 
80.928 s <<< FAILURE! - in 
org.apache.jackrabbit.oak.security.authorization.accesscontrol.AccessControlImporterIgnoreTest
[ERROR] 
testImportWithRestrictionNodeInfo(org.apache.jackrabbit.oak.security.authorization.accesscontrol.AccessControlImporterIgnoreTest)
  Time elapsed: 9.922 s  <<< ERROR!
java.lang.OutOfMemoryError: Java heap space

[ERROR] 
testImportWithRestrictionNodeInfo(org.apache.jackrabbit.oak.security.authorization.accesscontrol.AccessControlImporterIgnoreTest)
  Time elapsed: 9.922 s  <<< ERROR!
java.lang.NullPointerException

[ERROR] 
testEndChildInfoIncompleteAce(org.apache.jackrabbit.oak.security.authorization.accesscontrol.AccessControlImporterIgnoreTest)
  Time elapsed: 5.238 s  <<< ERROR!
java.lang.OutOfMemoryError: Java heap space
{noformat}


> Debug logging when two or more indices have same or very close cost amounts 
> doesn't work in case both indices belong to the same type of Query Index
> 
>
> Key: OAK-8035
> URL: https://issues.apache.org/jira/browse/OAK-8035
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: query
>Reporter: Nitin Gupta
>Assignee: Nitin Gupta
>Priority: Major
> Fix For: 1.11.0
>
> Attachments: OAK-8035.patch, OAK-8035_2.patch
>
>
> Steps to reproduce -
>  # You would need two index definitions of same query index type , let's say 
> fullText index , having similar cost evaluations.
>  # Now while the index plan is evaluated you will notice that there should 
> have been a debug log saying that selected index has similar cost - this 
> serves as an important warning to either change the index definitions or the 
> query 
> ([https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryImpl.java#L1069#L1072)]
>  
> However If we have a look at this code block here - 
> [https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryImpl.java#L1017#L1041]
>  , there is no comparison for near best costs for index plans having same 
> query index type .
>  
> cc : [~teofili]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Comment Edited] (OAK-8035) Debug logging when two or more indices have same or very close cost amounts doesn't work in case both indices belong to the same type of Query Index

2019-02-15 Thread Julian Reschke (JIRA)


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

Julian Reschke edited comment on OAK-8035 at 2/15/19 7:27 PM:
--

trunk: [r1853659|http://svn.apache.org/r1853659] 
[r1853626|http://svn.apache.org/r1853626]


was (Author: reschke):
trunk: [r1853626|http://svn.apache.org/r1853626]

> Debug logging when two or more indices have same or very close cost amounts 
> doesn't work in case both indices belong to the same type of Query Index
> 
>
> Key: OAK-8035
> URL: https://issues.apache.org/jira/browse/OAK-8035
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: query
>Reporter: Nitin Gupta
>Assignee: Julian Reschke
>Priority: Major
> Fix For: 1.12, 1.11.0
>
> Attachments: OAK-8035.patch, OAK-8035_2.patch, OAK-8035_3.patch
>
>
> Steps to reproduce -
>  # You would need two index definitions of same query index type , let's say 
> fullText index , having similar cost evaluations.
>  # Now while the index plan is evaluated you will notice that there should 
> have been a debug log saying that selected index has similar cost - this 
> serves as an important warning to either change the index definitions or the 
> query 
> ([https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryImpl.java#L1069#L1072)]
>  
> However If we have a look at this code block here - 
> [https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryImpl.java#L1017#L1041]
>  , there is no comparison for near best costs for index plans having same 
> query index type .
>  
> cc : [~teofili]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Comment Edited] (OAK-8035) Debug logging when two or more indices have same or very close cost amounts doesn't work in case both indices belong to the same type of Query Index

2019-02-19 Thread Julian Reschke (JIRA)


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

Julian Reschke edited comment on OAK-8035 at 2/19/19 8:58 AM:
--

[~nitigup]:

 

FWIW, I find it unfortunate that we introduce a new test dependency here 
([http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/pom.xml?r1=1850878&r2=1853626&pathrev=1853626&diff_format=h).]
 Is this really needed? And if it is, shouldn't we use the latest version? (see 
[https://mvnrepository.com/artifact/org.assertj/assertj-core])


was (Author: reschke):
FWIW, I find it unfortunate that we introduce a new test dependency here 
([http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/pom.xml?r1=1850878&r2=1853626&pathrev=1853626&diff_format=h).]
 Is this really needed? And if it is, shouldn't we use the latest version? (see 
https://mvnrepository.com/artifact/org.assertj/assertj-core)

> Debug logging when two or more indices have same or very close cost amounts 
> doesn't work in case both indices belong to the same type of Query Index
> 
>
> Key: OAK-8035
> URL: https://issues.apache.org/jira/browse/OAK-8035
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: query
>Reporter: Nitin Gupta
>Assignee: Julian Reschke
>Priority: Major
> Fix For: 1.12, 1.11.0
>
> Attachments: OAK-8035.patch, OAK-8035_2.patch, OAK-8035_3.patch
>
>
> Steps to reproduce -
>  # You would need two index definitions of same query index type , let's say 
> fullText index , having similar cost evaluations.
>  # Now while the index plan is evaluated you will notice that there should 
> have been a debug log saying that selected index has similar cost - this 
> serves as an important warning to either change the index definitions or the 
> query 
> ([https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryImpl.java#L1069#L1072)]
>  
> However If we have a look at this code block here - 
> [https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryImpl.java#L1017#L1041]
>  , there is no comparison for near best costs for index plans having same 
> query index type .
>  
> cc : [~teofili]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Comment Edited] (OAK-8035) Debug logging when two or more indices have same or very close cost amounts doesn't work in case both indices belong to the same type of Query Index

2019-02-19 Thread Julian Reschke (JIRA)


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

Julian Reschke edited comment on OAK-8035 at 2/19/19 11:17 AM:
---

{quote}[~reschke] - Just find it a bit more fluent with assertions - makes the 
test code a bit more clean to look at and I used the version that I had used 
before to make sure it works as I expect . But I can remove it - I also need to 
refactor the test to use the LogCustomizer as you suggested - so will remove 
this dependency also along with that.
{quote}

Done that already, and I don't thik the test is harder to read. See 
[r1853872|http://svn.apache.org/r1853872]

bq. But just for my future reference - do we not introduce any new test 
dependencies in oak ? or is there some RTC process that I bypassed  and needed 
to follow before introducing one  ? 

No, adding new test dependencies is fine. We just should do it consciously and 
coordinated. My preference would be not to add new dependencies just because 
somebody liked a particular library. In the end, the whole team needs to be 
able to support the code in the future.


was (Author: reschke):
{quote}[~reschke] - Just find it a bit more fluent with assertions - makes the 
test code a bit more clean to look at and I used the version that I had used 
before to make sure it works as I expect . But I can remove it - I also need to 
refactor the test to use the LogCustomizer as you suggested - so will remove 
this dependency also along with that.
{quote}

Done that already, and I don't thik the test is harder to read. Will apply 
patch soonish.

bq. But just for my future reference - do we not introduce any new test 
dependencies in oak ? or is there some RTC process that I bypassed  and needed 
to follow before introducing one  ? 

No, adding new test dependencies is fine. We just should do it consciously and 
coordinated. My preference would be not to add new dependencies just because 
somebody liked a particular library. In the end, the whole team needs to be 
able to support the code in the future.

> Debug logging when two or more indices have same or very close cost amounts 
> doesn't work in case both indices belong to the same type of Query Index
> 
>
> Key: OAK-8035
> URL: https://issues.apache.org/jira/browse/OAK-8035
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: query
>Reporter: Nitin Gupta
>Assignee: Julian Reschke
>Priority: Major
> Fix For: 1.12, 1.11.0
>
> Attachments: OAK-8035.patch, OAK-8035_2.patch, OAK-8035_3.patch
>
>
> Steps to reproduce -
>  # You would need two index definitions of same query index type , let's say 
> fullText index , having similar cost evaluations.
>  # Now while the index plan is evaluated you will notice that there should 
> have been a debug log saying that selected index has similar cost - this 
> serves as an important warning to either change the index definitions or the 
> query 
> ([https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryImpl.java#L1069#L1072)]
>  
> However If we have a look at this code block here - 
> [https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryImpl.java#L1017#L1041]
>  , there is no comparison for near best costs for index plans having same 
> query index type .
>  
> cc : [~teofili]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Comment Edited] (OAK-8035) Debug logging when two or more indices have same or very close cost amounts doesn't work in case both indices belong to the same type of Query Index

2019-02-19 Thread Julian Reschke (JIRA)


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

Julian Reschke edited comment on OAK-8035 at 2/19/19 11:18 AM:
---

{quote}[~reschke] - Just find it a bit more fluent with assertions - makes the 
test code a bit more clean to look at and I used the version that I had used 
before to make sure it works as I expect . But I can remove it - I also need to 
refactor the test to use the LogCustomizer as you suggested - so will remove 
this dependency also along with that.
{quote}

Done that already, and I don't thik the test is harder to read. See 
[r1853872|http://svn.apache.org/r1853872].

bq. But just for my future reference - do we not introduce any new test 
dependencies in oak ? or is there some RTC process that I bypassed  and needed 
to follow before introducing one  ? 

No, adding new test dependencies is fine. We just should do it consciously and 
coordinated. My preference would be not to add new dependencies just because 
somebody liked a particular library. In the end, the whole team needs to be 
able to support the code in the future.


was (Author: reschke):
{quote}[~reschke] - Just find it a bit more fluent with assertions - makes the 
test code a bit more clean to look at and I used the version that I had used 
before to make sure it works as I expect . But I can remove it - I also need to 
refactor the test to use the LogCustomizer as you suggested - so will remove 
this dependency also along with that.
{quote}

Done that already, and I don't thik the test is harder to read. See 
[r1853872|http://svn.apache.org/r1853872]

bq. But just for my future reference - do we not introduce any new test 
dependencies in oak ? or is there some RTC process that I bypassed  and needed 
to follow before introducing one  ? 

No, adding new test dependencies is fine. We just should do it consciously and 
coordinated. My preference would be not to add new dependencies just because 
somebody liked a particular library. In the end, the whole team needs to be 
able to support the code in the future.

> Debug logging when two or more indices have same or very close cost amounts 
> doesn't work in case both indices belong to the same type of Query Index
> 
>
> Key: OAK-8035
> URL: https://issues.apache.org/jira/browse/OAK-8035
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: query
>Reporter: Nitin Gupta
>Assignee: Julian Reschke
>Priority: Major
> Fix For: 1.12, 1.11.0
>
> Attachments: OAK-8035.patch, OAK-8035_2.patch, OAK-8035_3.patch
>
>
> Steps to reproduce -
>  # You would need two index definitions of same query index type , let's say 
> fullText index , having similar cost evaluations.
>  # Now while the index plan is evaluated you will notice that there should 
> have been a debug log saying that selected index has similar cost - this 
> serves as an important warning to either change the index definitions or the 
> query 
> ([https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryImpl.java#L1069#L1072)]
>  
> However If we have a look at this code block here - 
> [https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryImpl.java#L1017#L1041]
>  , there is no comparison for near best costs for index plans having same 
> query index type .
>  
> cc : [~teofili]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Comment Edited] (OAK-8035) Debug logging when two or more indices have same or very close cost amounts doesn't work in case both indices belong to the same type of Query Index

2019-02-19 Thread Nitin Gupta (JIRA)


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

Nitin Gupta edited comment on OAK-8035 at 2/19/19 11:59 AM:


[~reschke] - agreed . 

I was just about to add this patch here [^OAK-8035_4.patch]  for the changes as 
per your suggestions - but you beat me to it . Thanks for the help :)


was (Author: nitigup):
[~reschke] - agreed . 

I was just about to add this patch here [^OAK-8035_4.patch]  for the changes as 
per your suggestions - but you beat me to it :)

> Debug logging when two or more indices have same or very close cost amounts 
> doesn't work in case both indices belong to the same type of Query Index
> 
>
> Key: OAK-8035
> URL: https://issues.apache.org/jira/browse/OAK-8035
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: query
>Reporter: Nitin Gupta
>Assignee: Julian Reschke
>Priority: Major
> Fix For: 1.12, 1.11.0
>
> Attachments: OAK-8035.patch, OAK-8035_2.patch, OAK-8035_3.patch, 
> OAK-8035_4.patch
>
>
> Steps to reproduce -
>  # You would need two index definitions of same query index type , let's say 
> fullText index , having similar cost evaluations.
>  # Now while the index plan is evaluated you will notice that there should 
> have been a debug log saying that selected index has similar cost - this 
> serves as an important warning to either change the index definitions or the 
> query 
> ([https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryImpl.java#L1069#L1072)]
>  
> However If we have a look at this code block here - 
> [https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryImpl.java#L1017#L1041]
>  , there is no comparison for near best costs for index plans having same 
> query index type .
>  
> cc : [~teofili]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Comment Edited] (OAK-8035) Debug logging when two or more indices have same or very close cost amounts doesn't work in case both indices belong to the same type of Query Index

2019-02-19 Thread Nitin Gupta (JIRA)


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

Nitin Gupta edited comment on OAK-8035 at 2/19/19 12:03 PM:


[~reschke] - agreed - will keep this in mind in future .
{noformat}
No, adding new test dependencies is fine. We just should do it consciously and 
coordinated. My preference would be not to add new dependencies just because 
somebody liked a particular library. In the end, the whole team needs to be 
able to support the code in the future{noformat}
 

I was just about to add this patch here [^OAK-8035_4.patch]  for the changes as 
per your suggestions - but you beat me to it . Thanks for the help :)


was (Author: nitigup):
[~reschke] - agreed . 

I was just about to add this patch here [^OAK-8035_4.patch]  for the changes as 
per your suggestions - but you beat me to it . Thanks for the help :)

> Debug logging when two or more indices have same or very close cost amounts 
> doesn't work in case both indices belong to the same type of Query Index
> 
>
> Key: OAK-8035
> URL: https://issues.apache.org/jira/browse/OAK-8035
> Project: Jackrabbit Oak
>  Issue Type: Bug
>  Components: query
>Reporter: Nitin Gupta
>Assignee: Julian Reschke
>Priority: Major
> Fix For: 1.12, 1.11.0
>
> Attachments: OAK-8035.patch, OAK-8035_2.patch, OAK-8035_3.patch, 
> OAK-8035_4.patch
>
>
> Steps to reproduce -
>  # You would need two index definitions of same query index type , let's say 
> fullText index , having similar cost evaluations.
>  # Now while the index plan is evaluated you will notice that there should 
> have been a debug log saying that selected index has similar cost - this 
> serves as an important warning to either change the index definitions or the 
> query 
> ([https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryImpl.java#L1069#L1072)]
>  
> However If we have a look at this code block here - 
> [https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryImpl.java#L1017#L1041]
>  , there is no comparison for near best costs for index plans having same 
> query index type .
>  
> cc : [~teofili]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)