Xuanwo opened a new issue, #8729:
URL: https://github.com/apache/opendal/issues/8729

   ## Summary
   
   `ImmutableIndexLayer` answers every list call from its in-memory index, but 
`capability()` inherits the inner service's `list_with_*` flags unchanged 
except for enabling `list_with_recursive`. When the wrapped backend advertises 
`list_with_start_after` (e.g. the memory service), the layer advertises it too 
while `list()` ignores `args.start_after()` entirely.
   
   ## Reproduction
   
   On main (core `8407b3df4a`):
   
   ```rust
   let mut iil = ImmutableIndexLayer::default();
   for i in ["a", "b"] {
       iil.insert(i.to_string())
   }
   let op = Operator::from_iter::<services::Memory>(HashMap::<_, 
_>::default())?.layer(iil);
   
   // Memory advertises list_with_start_after, so the layered operator does too.
   let entries = 
op.lister_with("/").start_after("a").await?.try_collect::<Vec<_>>().await?;
   ```
   
   Actual: `["a", "b"]` — the marker is silently ignored. Expected: `["b"]`.
   
   The same applies to `list_with_limit`, `list_with_versions`, and 
`list_with_deleted`: the index cannot honor any of them (it stores paths only), 
but the flags are inherited verbatim, so `versions(true)`/`deleted(true)` pass 
the capability check and return unversioned entries instead of `Unsupported`.
   
   ## Root cause
   
   `ImmutableIndexService::list` only inspects `args.recursive()` and emits 
index entries in arbitrary order, so even the advertised `list_with_recursive` 
result is unordered — making `start_after` positions meaningless. 
`CorrectnessCheckLayer` sits below user layers, so the layer's own advertised 
capabilities are never validated against the options it actually consumes.
   
   ## Proposed fix
   
   - Sort index entries lexicographically and filter emitted entries at or 
before `start_after`, matching the memory service's semantics for both 
recursive and hierarchy listings.
   - Report only the list options the index implements: keep 
`list_with_start_after`/`list_with_recursive`, stop inheriting 
`list_with_limit`/`list_with_versions`/`list_with_deleted`.
   - Reject `versions(true)`/`deleted(true)` inside the layer since no 
correctness check sits above it.
   
   This issue was identified and this text drafted by an AI agent during 
maintenance; the reproduction above was run and verified locally.


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