feat(issues): Wire EAP double-read into issue feed search#112996
Conversation
…o-query-string' into shashjar/issue-feed-search-eap-implement-eap-group-search
…ch' into shashjar/issue-feed-search-eap-implement-eap-double-read
…o-query-string' into shashjar/issue-feed-search-eap-implement-eap-group-search
…ch' into shashjar/issue-feed-search-eap-implement-eap-double-read
…o-query-string' into shashjar/issue-feed-search-eap-implement-eap-double-read
…o-query-string' into shashjar/issue-feed-search-eap-implement-eap-double-read
|
|
||
|
|
||
| @dataclass | ||
| class TrendsParams: |
There was a problem hiding this comment.
Bug: When the experimental search path is enabled, it returns a total count of 0, causing pagination logic to fail and return incomplete results.
Severity: HIGH
Suggested Fix
The experimental search path should not return a hardcoded 0 for the total count. Instead, it should provide an accurate total count, or the pagination logic should be adapted to handle cases where the total is unknown or zero without prematurely terminating the search.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: src/sentry/search/snuba/executors.py#L111
Potential issue: When the experimental search path (EAP) is activated via the
`use_experimental_data_callsite_allowlist` configuration, it returns a hardcoded total
count of `0`. The pagination logic uses this total to determine if there are more
results to fetch with the condition `(offset + limit) < total`. When `total` is `0`,
this condition is always false, causing the result-fetching loop to break prematurely.
This prevents the search from fetching additional chunks of results, leading to
incomplete search results for any query that requires pagination.
Did we get this right? 👍 / 👎 to inform future reviews.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 385c3e3. Configure here.
| "num_group_ids": len(group_ids) if group_ids else 0, | ||
| "num_filters": len(snuba_search_filters), | ||
| }, | ||
| ) |
There was a problem hiding this comment.
EAP result's hardcoded zero total breaks pagination
Medium Severity
run_eap_group_search hardcodes total to 0 in its return tuple. When check_and_choose decides to use the experimental data (once the callsite is added to the use_experimental_data_callsite_allowlist), the caller at the chunked search loop receives total=0. This makes the more_results = count >= limit and (offset + limit) < total check always False, causing pagination to stop after the first chunk and potentially returning incomplete search results.
Reviewed by Cursor Bugbot for commit 385c3e3. Configure here.


PR 2/2 to implement issue feed search via EAP queries. Follow-up to #112985.
Wires
run_eap_group_search()intoPostgresSnubaQueryExecutor.snuba_search()as a double-read for issue feed search. The EAP query runs alongside the legacy Snuba query for supported sort strategies. The EAP path is currently skipped forget_sample=Truequeries (hit estimation) and unsupported sorts (trends,recommended).