jackylee-ch opened a new pull request, #3164:
URL: https://github.com/apache/iceberg-rust/pull/3164

   ## Which issue does this PR close?
   
   None — filed directly. Related to but distinct from #1720, which is about 
the accuracy of the weigher
   `iceberg::io::ObjectCache` already has; this crate has no weigher at all.
   
   ## What changes are included in this PR?
   
   `DEFAULT_CACHE_SIZE_BYTES` (32MiB) was passed straight to 
`moka::sync::Cache::new`. Without a
   weigher `moka` treats `max_capacity` as a number of **entries**, so both 
caches admitted 33_554_432
   manifests rather than 32MiB of them — the documented budget never bound.
   
   Build them through `Cache::builder().weigher(..).max_capacity(..)`, using 
the same
   `size_of_val` weigher as `iceberg::io::ObjectCache`. No public signature 
changes.
   
   ## Are these changes tested?
   
   Yes — `test_cache_weighs_entries_by_size_not_count` inserts two 512-byte 
values and asserts
   `weighted_size() == 1024`; on the parent commit it is `2`, the entry count.
   `cargo test --release -p iceberg-cache-moka` → 2 passed.
   
   ## AI Disclosure
   
   Written with AI assistance (Claude Code); I reviewed the change and ran the 
tests above.
   Worth flagging: `size_of_val` on `Arc<Manifest>` counts the struct, not the 
heap its entries own, so
   the cap still under-counts — that is exactly what #1720 tracks. This PR only 
makes the budget a byte
   budget; improving the weight function belongs with that issue.
   


-- 
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]

Reply via email to