CalvinKirs opened a new pull request, #66579:
URL: https://github.com/apache/doris/pull/66579
### What problem does this PR solve?
Issue Number: None
Related PR: None
Problem Summary:
External connector metadata caches are bounded only by entry count. A small
number of large file listings, partition maps, table metadata objects, or
manifest values can therefore consume excessive FE heap while remaining below
the configured entry capacity.
This change adds an optional byte-weighted cache path. When `max-weight` is
configured, the cache requires a typed estimator and uses Caffeine
`maximumWeight`; otherwise it preserves the existing `maximumSize(capacity)`
behavior. Hive file-listing and Iceberg table, partition, and manifest cache
values precompute their estimated retained bytes when the value is built, so
Caffeine's final weighing callback remains O(1).
Paimon is not included in the production estimator scope because its lazy
snapshot value can grow after insertion without causing Caffeine to recompute
the entry weight.
### Release note
External metadata caches can opt into byte-based limits with
`meta.cache.<engine>.<entry>.max-weight` properties.
### Check List (For Author)
- Test
- [ ] Regression test
- [x] Unit Test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason
`CacheSpecTest` and `MetaCacheEntryTest`: 28 tests passed. Hive, Paimon,
and Iceberg production modules compiled successfully in the FE unit-test
reactor before the remaining full-reactor run was stopped.
- Behavior changed:
- [ ] No.
- [x] Yes. Configured caches can use byte-weighted eviction; count-based
capacity remains the default.
- Does this need documentation?
- [x] No.
- [ ] Yes.
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
--
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]