fluss icon indicating copy to clipboard operation
fluss copied to clipboard

[client] Complete lookups when the response omits a requested bucket

Open pbanakar opened this issue 3 weeks ago • 3 comments

Search before asking

  • [x] I searched in the issues and found nothing similar.

Fluss version

1.0.0 (latest release)

Please describe the bug 🐞

This is a P0 item from umbrella issue #4980.

A lookup response may omit one or more buckets that were included in the original lookup request. LookupSender processes only the buckets returned by the server, but does not reconcile the response with all requested buckets.

As a result, lookup batches for omitted buckets are never completed successfully or exceptionally. Their CompletableFutures remain pending indefinitely, causing callers to wait forever unless they configure their own timeout.

This can occur when a lookup response is incomplete because of a server-side or routing edge case. Regardless of the cause, every submitted lookup should eventually complete with either a result or an error.

Expected behavior

When a lookup response does not contain a requested bucket, the client should complete the corresponding lookup batch exceptionally instead of leaving its future pending.

The client should preserve the existing behavior for buckets that are present in the response.

Solution

Update LookupSender response handling to:

  1. Track all requested lookup batches.
  2. Track the buckets returned in the response.
  3. Complete any requested-but-missing bucket batches exceptionally with an appropriate client-side exception.
  4. Apply the same behavior consistently to normal and prefix lookups, where applicable.
  5. Add regression tests in LookupSenderTest covering:
    • A response containing all requested buckets.
    • A response omitting one requested bucket.
    • Verification that the missing bucket's future completes exceptionally rather than remaining pending.

The exact exception should follow the existing client and lookup error-handling conventions.

Are you willing to submit a PR?

  • [x] I'm willing to submit a PR!

pbanakar avatar Nov 05 '26 16:11 pbanakar

Hi @polyzos @loserwang1024 I searched the existing issues and pull requests. The related lookup issues #4971 and #5025 are already completed, but I could not find an issue covering a lookup response that omits a requested bucket and leaves its future incomplete, and i'm Willing to Submit a PR! Thanks

pbanakar avatar Nov 05 '26 17:11 pbanakar

@pbanakar Thanks for raising this. Could you clarify which server-side path could return bucket A but omit bucket B when both were included in the lookup request?

From the current code, each requested bucket should receive either a result or a per-bucket error. Missing keys still produce a bucket response, and routing or replica errors should be returned explicitly rather than silently dropping the bucket.

Do you have a concrete reproduction or a specific code path where this happens? A constructed incomplete response can demonstrate the missing client-side safeguard, but it does not establish why the server would produce such a response.

loserwang1024 avatar Nov 06 '26 03:11 loserwang1024

Thanks for checking. After reviewing the server-side response handling, I could not find a production path for this, Appolizies for miss understanding here! closing the issue now, Thanks

pbanakar avatar Nov 06 '26 06:11 pbanakar