clintropolis opened a new pull request #12293:
URL: https://github.com/apache/druid/pull/12293
### Description
On very large historical servers with a lot of processors, queries using
lookups can find a decent amount of time being wasted on lock contention, when
the majority of these lookups are populated offline and then swapped to the new
version, making this synchronization unnecessary, at least when using 'on heap'
lookups.
I've re-arranged some code in `lookups-cached-global` to allow the
"versioned" family of lookups to now "allocate" a cache and then later "attach"
it after it is fully populated, which for on-heap lookups means that a
non-concurrent map will be used, and wrapped in a `Collections.unmodifiableMap`
when "attaching" it to the lookups cache. Since all consumers after initial
population are read only, and version updates populate a completely new cache
prior to attaching, this should be safe as far as I can tell. Off heap lookups
have not been changed and will continue to use the concurrent map
implementation at this time.
Kafka extraction lookups still use the old "createCache" method, since they
do in fact incrementally update lookups as the consumer finds new values, so
they should be unchanged by this patch.
<hr>
<!-- Check the items by putting "x" in the brackets for the done things. Not
all of these items apply to every PR. Remove the items which are not done or
not relevant to the PR. None of the items from the checklist below are strictly
necessary, but it would be very helpful if you at least self-review the PR. -->
This PR has:
- [ ] been self-reviewed.
- [ ] using the [concurrency
checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md)
(Remove this item if the PR doesn't have any relation to concurrency.)
- [ ] added documentation for new or modified features or behaviors.
- [ ] added Javadocs for most classes and all non-trivial methods. Linked
related entities via Javadoc links.
- [ ] added or updated version, license, or notice information in
[licenses.yaml](https://github.com/apache/druid/blob/master/dev/license.md)
- [ ] added comments explaining the "why" and the intent of the code
wherever would not be obvious for an unfamiliar reader.
- [ ] added unit tests or modified existing tests to cover new code paths,
ensuring the threshold for [code
coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md)
is met.
- [ ] added integration tests.
- [ ] been tested in a test Druid cluster.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]