JingsongLi commented on code in PR #1014:
URL: https://github.com/apache/paimon-rust/pull/1014#discussion_r4586306325


##########
crates/paimon/src/io/file_io.rs:
##########
@@ -1797,9 +2128,14 @@ impl InputFile {
     }
 
     pub async fn read(&self) -> crate::Result<Bytes> {
-        let (op, relative_path, cache_path) = 
self.source.resolve(&self.path).await?;
+        let (op, relative_path, cache_path) =
+            self.source.resolve(&self.path, OpClass::Read).await?;

Review Comment:
   [P2] Route cached-read size lookups by the meta policy
   
   Resolving only `OpClass::Read` here loses the target when 
`io-cache.policy=meta` excludes reads. On a cold local-cache read, the later 
`op.operator(OpClass::Meta).stat(...)` therefore uses the origin-only operator. 
`reader_with_size_hint` has the same issue after resolving Read at lines 
2171–2172.
   
   Reproduced with a persisted immutable manifest, two local OSS HTTP 
endpoints, and local caching enabled: both `InputFile::read()` and 
`InputFile::reader()` send HEAD and GET to origin, with no request to the 
configured metadata target. The same probe on 319f3668 sends HEAD to target and 
GET to origin as intended. Thus the latest operation-aware change stops 
offloading the metadata requests in a supported metadata-only configuration, 
even though standalone metadata() still follows the policy.
   
   Please resolve `OpClass::Meta` separately when a cache miss needs file size 
(while retaining lazy, operation-specific target construction), and cover both 
read APIs with a meta-only policy regression.



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

Reply via email to