github-actions[bot] commented on code in PR #68613:
URL: https://github.com/apache/doris/pull/68613#discussion_r4141000574
##########
thirdparty/patches/lance-c-foyer.patch:
##########
@@ -1087,24 +941,34 @@ index 0000000..9a10e43
+ }
+
+ async fn cached_get(&self, location: &Path, options: GetOptions) ->
Result<GetResult> {
-+ // Fetch metadata separately so the returned GetResult retains the
origin's identity while
-+ // its payload uses the same block cache as get_ranges(). This also
provides the object size
-+ // needed to resolve bounded, offset, and suffix ranges.
-+ let GetResult {
-+ meta: metadata,
-+ attributes,
-+ ..
-+ } = self
++ let metadata_key = self
+ .reader
-+ .original
-+ .get_opts(
-+ location,
-+ GetOptions {
-+ head: true,
-+ ..Default::default()
-+ },
-+ )
-+ .await?;
++ .cache
++ .size_key(&self.reader.store_prefix, location);
++ let cached_metadata = self.reader.cache.metadata.get(&metadata_key);
++ let (metadata, attributes, extensions) = if let Some(entry) =
cached_metadata {
Review Comment:
[P2] Avoid writing the size entry on warm range reads. When this new
metadata-cache hit avoids the origin HEAD, `cached_get` still reaches the
unconditional `HybridCache::insert(size_key, ...)` below. The cache uses
`WriteOnInsertion`; Foyer enqueues that same key for disk storage on every
`get_opts` call, and its block writer allocates a 4096-byte aligned entry.
Lance single-range reads use `get_opts`, so repeated scans of fully cached data
can keep writing size metadata and churn the disk tier. Populate the size key
only on a true size miss (or keep it memory-only), and verify a warm range read
causes no further storage enqueue.
--
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]