Skip to content

Conversation

sigram
Copy link
Contributor

@sigram sigram commented Sep 24, 2025

This implementation is inspired by the idea described by @gus-asf:

  • parent request sends an additional parameter to the sub-requests to indicate the time already spent processing the parent req.
  • sub-requests deduct this time from timeAllowed, and further decrease it by an approximate flight time (configurable)
  • additional hook was added to the QueryLimit api to skip sending shard requests if the limit is likely to be reached when they arrive at the target replica. This api should be generic enough to allow us to discount other "used up" limits (cpu, mem) if we decide to do so for consistency.

@github-actions github-actions bot added documentation Improvements or additions to documentation tests cat:search labels Sep 24, 2025
@sigram sigram requested review from hossman and gus-asf September 24, 2025 18:59
Fix a couple NPEs due to missing result Ids or docs when all shards are skipped.
// Skip this shard since one or more limits will be tripped
if (log.isDebugEnabled()) {
log.debug("Skipping request to shard '{}' due to query limits, params {}", shard, params);
log.info("Skipping request to shard '{}' due to query limits, params {}", shard, params);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missmatch between log.isDebugEnabled and log.info

@sigram sigram merged commit 9241deb into apache:main Sep 30, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cat:search documentation Improvements or additions to documentation tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants