-
-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix concurrency issues in Performance Stats code #4910
base: develop
Are you sure you want to change the base?
Fix concurrency issues in Performance Stats code #4910
Conversation
%test:assertXPath("$result//stats:index[@type = 'range'][@optimization = 2]") | ||
%test:assertXPath("$result//stats:index[@type eq 'range'][@optimization-level eq 'Optimized']") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will code that expects the performance stats to return <stats:index optimization="2">
need to be updated to read <stats:index optimization-level="Optimized"/>
etc.? Monex, for example reads @optimization
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joewiz yes, indeed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmmm ok. then we need to have a plan to update monex here as well, whilst keeping that app compatible with older exist versions?
Codewise it looks OK to me. Better JMX support? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
build fails :-(
a405132
to
783cbdd
Compare
Please update the description of this PR to include information about the breaking change(s) that it introduces. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR introduces breaking changes and fails to communicate that clearly in the commit messages.
Please extract the breaking changes into a single commit so that we can discuss them separately.
This is not something we have ever done before! So why do you believe that this PR is "special" in some way to any others that target an upcoming major release? |
As the changes are not necessary to fix concurrency issues they should not be part of this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah ok, so some additional updates need to be put in place in apps to keep things compatible.
When has that ever been a requirement of PRs against a major version? It might be sensible to put them in separate commits perhaps, but separate PRs is unnecessary! |
exist-core/src/main/java/org/exist/xquery/PerformanceStats.java
Outdated
Show resolved
Hide resolved
exist-core/src/main/java/org/exist/xquery/PerformanceStats.java
Outdated
Show resolved
Hide resolved
b138c00
to
eebf365
Compare
@adamretter In yesterdays community call I was convinced that speaking labels are favourable over magical integer constants. We also found that the attribute name returned by the stats package should stay |
I intentionally changed this because it was misleading. It does not describe the optimization that was performed, which is what it previously implied. Rather it describes the "level of optimization" that was able to be applied - and this is how it was described in the Java code. So I corrected it so that it actually reflects what it is. |
eebf365
to
c769150
Compare
during the teleconference we talked about the naming: enum IndexOptimizationLevel { OptimizationLevel= OPTIMIZED does not reflect i kind of "amount" of optimisation was applied. "FULL" would do that much better, or "OPTIMAL". Maybe it is a kind language thingy ? |
@dizzzz I agree that I think we need better words than This is not a good suggestion, but the only one that comes to mind: Perhaps @joewiz has an idea for phrasing here? |
How about if we expressed this information using 2 boolean attributes instead of 1 string attribute:
So there are still 3 possibilities, but they're expressed explicitly through the combination of these two boolean attributes:
|
@joewiz I like your proposed approach but would like to shorten the attribute names.
|
@joewiz My thoughts:
That seems fine.
I don't think this is a good term. There are "degrees" of optimisation. There are also optimisations that can be applied without an index, and IMHO we should not close the door of being able to report on them in future. |
@line-o My thoughts:
This has the same problem as before. This does not express the degrees of optimisation possible. |
@adamretter there is only one level of optimisation possible and only if an index is found/used. |
I am afraid that is not correct. |
SonarCloud Quality Gate failed. |
@adamretter @line-o I would suggest to discuss this on with all commenters on a community meeting if possible as it seems to me easier to exchange the intends and possible approaches.... |
As discussed on the Community Call today, we seem agreed on the idea of returning two boolean attributes and that one should be called |
As far as I am aware from studying the code it is not possible to present a result like The Lucene Index in eXist-db in fact does not actually know if there is an index or not for the particular expression it is looking up, instead it queries Lucene based on just the element or attribute name (ignoring fields and facets for now), which often returns more results than it should, later in other expressions these results are filtered out so that hopefully you end up with the correct results... although I am finding plenty of cases lately (not related to facets) which were inspired by #3207 whereby eXist-db returns far too many results |
If the index use is not really consistent, then it is misleading to even present that data under <stats:optimization level="[none|basic|full]"> |
c769150
to
1ee9ba7
Compare
I am not sure that makes sense as these optimizations are index guided. As this has been open now for 6 months, and is a clear improvement on the status quo, I suggest we just merge this and move on; rather than splitting hairs over naming! It can always be improved in the future as can everything else in eXist-db. @dizzzz @reinhapa Can you discuss together, and consider merging this please? |
SonarCloud Quality Gate failed. 1 Bug 72.4% Coverage Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
Does this require an money update? if not, I am happy. |
@dizzzz I am happy to receive any money! |
I ment.... Monex :-P |
Cleanup the code and fix concurrency issues in the Performance Stats code