Skip to content

feat(issues): Wire EAP double-read into issue feed search#112996

Open
shashjar wants to merge 12 commits intoshashjar/issue-feed-search-eap-parse-search-filters-into-query-stringfrom
shashjar/issue-feed-search-eap-implement-eap-double-read
Open

feat(issues): Wire EAP double-read into issue feed search#112996
shashjar wants to merge 12 commits intoshashjar/issue-feed-search-eap-parse-search-filters-into-query-stringfrom
shashjar/issue-feed-search-eap-implement-eap-double-read

Conversation

@shashjar
Copy link
Copy Markdown
Member

@shashjar shashjar commented Apr 14, 2026

PR 2/2 to implement issue feed search via EAP queries. Follow-up to #112985.

Wires run_eap_group_search() into PostgresSnubaQueryExecutor.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 for get_sample=True queries (hit estimation) and unsupported sorts (trends, recommended).

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 14, 2026
…ch' into shashjar/issue-feed-search-eap-implement-eap-double-read
@shashjar shashjar changed the title feat(occurrences on eap): Implement EAP double read for issue feed search feat(issues): Implement EAP double read for issue feed search Apr 14, 2026
…o-query-string' into shashjar/issue-feed-search-eap-implement-eap-group-search
…ch' into shashjar/issue-feed-search-eap-implement-eap-double-read
Base automatically changed from shashjar/issue-feed-search-eap-implement-eap-group-search to shashjar/issue-feed-search-eap-parse-search-filters-into-query-string April 15, 2026 18:32
…o-query-string' into shashjar/issue-feed-search-eap-implement-eap-double-read
@shashjar shashjar changed the title feat(issues): Implement EAP double read for issue feed search feat(issues): Wire EAP double-read into issue feed search Apr 15, 2026
@shashjar shashjar requested a review from a team April 15, 2026 19:51
…o-query-string' into shashjar/issue-feed-search-eap-implement-eap-double-read
@shashjar shashjar marked this pull request as ready for review April 15, 2026 20:00
@shashjar shashjar requested a review from a team as a code owner April 15, 2026 20:00
@shashjar shashjar removed the request for review from a team April 15, 2026 20:00


@dataclass
class TrendsParams:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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),
},
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 385c3e3. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant