-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Make PerThreadIDAndVersionLookup per-segment #14070
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
Conversation
|
LGTM, this is a nice cleanup (1 TermsEnum per segment core, instead of 1 per top-level reader X segment core). I benchmarked indexing at defaults and it looks like any performance change is within noise. |
|
LGTM too - I think as a followup we can remove the support for payloads in master since we don't support indices with payloads anymore. |
|
I added some tests for cache eviction of readers and so on here. I think its ready. |
|
LGTM thanks for all the tests |
Closes #14070 Squashed commit of the following: commit ad5829e Author: Robert Muir <rmuir@apache.org> Date: Tue Oct 13 06:50:25 2015 -0400 Add more tests for version map caching commit 617333e Author: Robert Muir <rmuir@apache.org> Date: Mon Oct 12 13:25:51 2015 -0400 fix javadocs ref commit 9626dd0 Author: Robert Muir <rmuir@apache.org> Date: Mon Oct 12 13:23:16 2015 -0400 make the version map cache per-segment Conflicts: core/src/main/java/org/elasticsearch/common/lucene/uid/Versions.java
Closes #14070 Squashed commit of the following: commit ad5829e Author: Robert Muir <rmuir@apache.org> Date: Tue Oct 13 06:50:25 2015 -0400 Add more tests for version map caching commit 617333e Author: Robert Muir <rmuir@apache.org> Date: Mon Oct 12 13:25:51 2015 -0400 fix javadocs ref commit 9626dd0 Author: Robert Muir <rmuir@apache.org> Date: Mon Oct 12 13:23:16 2015 -0400 make the version map cache per-segment Conflicts: core/src/main/java/org/elasticsearch/common/lucene/uid/Versions.java
Closes #14070 Squashed commit of the following: commit ad5829e Author: Robert Muir <rmuir@apache.org> Date: Tue Oct 13 06:50:25 2015 -0400 Add more tests for version map caching commit 617333e Author: Robert Muir <rmuir@apache.org> Date: Mon Oct 12 13:25:51 2015 -0400 fix javadocs ref commit 9626dd0 Author: Robert Muir <rmuir@apache.org> Date: Mon Oct 12 13:23:16 2015 -0400 make the version map cache per-segment Conflicts: core/src/main/java/org/elasticsearch/common/lucene/uid/Versions.java Conflicts: core/src/main/java/org/elasticsearch/common/lucene/uid/PerThreadIDAndVersionLookup.java
Currently this caches some state per-top-level-reader.
This currently has a downside in that it makes managing the cache tricky when readers are wrapped, since the map is cleared by
addReaderClosedListener.As a per-segment cache, things are simpler for that case since we can just use
addCoreClosedListener, which will evict from this cache when the underlying segment's core is merged away. Its effectively required for reader wrappers to delegategetCoreCacheKeyfor good performance with elasticsearch (otherwise you would e.g. build fielddata and so on per-query), so its not a limitation.It also addresses the TODO in the code about handling reopen...
If @mikemccand benchmarking is ok, I will add unit tests to this PR, we should be able to easily test this thing.