You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(issue-search): Check max_candidates to push Postgres fields to post-filtering (#74531)
When applying query filters from Postgres, pre-filtering the results
before passing the query to Snuba can break if it hits the max size that
ClickHouse is able to process ([sentry
issue](https://sentry.sentry.io/issues/5419972487/events/e14ff2501904443eb1c38f7600509b4f/?project=1&referrer=slack)).
This also manifests as a possible
[bug](https://sentry.sentry.io/issues/5419971969/events/9f65f1ff493a47858d91c2f9951e59a7/?referrer=issue_details.related_trace_issue)
in the serializer, though that's more of a red herring since ClickHouse
won't be able to handle the query either way.
To work around this, I'm applying the pattern used in the
`PostgresSnubaQueryExecutor` to determine whether to pre- or post-filter
the results based on the number of group_ids in the filter. If the
number of groups in the pre-filter exceeds the `max_candidates`, we'll
apply the filter after the Snuba query in a post-filtering step right
before the pagination happens.
The tests confirm that the `is:linked` and `is:unlinked` queries work as
a pre- and post-filter dependent on the value configured in
`snuba.search.max-pre-snuba-candidates`.
---------
Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
0 commit comments