Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(eventstore): Use more correct start date for eventstore #67070

Merged
merged 1 commit into from
Mar 15, 2024

Conversation

evanh
Copy link
Member

@evanh evanh commented Mar 15, 2024

Clickhouse behaves oddly when the normal epoch is used for dates:

ClickHouse/ClickHouse#9335 (comment)

This was working before by coincedence: an obsolete piece of code (query
splitters) in Snuba was clamping the date to a non-epoch value. When the query
splitters were removed, this started breaking.

Instead of simply asking for "all time" use a date that aligns with how our
data is actually stored.

This is also not a new issue, see #30912

Clickhouse behaves oddly when the normal epoch is used for dates:

ClickHouse/ClickHouse#9335 (comment)

This was working before by coincedence: an obsolete piece of code (query
splitters) in Snuba was clamping the date to a non-epoch value. When the query
splitters were removed, this started breaking.

Instead of simply asking for "all time" use a date that aligns with how our
data is actually stored.

This is also not a new issue, see #30912
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Mar 15, 2024
@evanh evanh requested a review from a team March 15, 2024 19:14
prev_filter.start = datetime.fromtimestamp(0)

# We only store 90 days of data, add a few extra days just in case
prev_filter.start = event.datetime - timedelta(days=100)
Copy link
Member

Choose a reason for hiding this comment

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

this is quite a few days, I don't think I quite get why we need to go back so far

Copy link
Member Author

Choose a reason for hiding this comment

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

Neither do I, but I didn't want to break any existing assumptions. The goal was to have this feature continue to work the way it was before.

@evanh evanh enabled auto-merge (squash) March 15, 2024 19:22
Copy link

codecov bot commented Mar 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.27%. Comparing base (6f043be) to head (b2e9b3c).
Report is 31 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #67070   +/-   ##
=======================================
  Coverage   84.27%   84.27%           
=======================================
  Files        5307     5307           
  Lines      237285   237301   +16     
  Branches    41054    41053    -1     
=======================================
+ Hits       199973   199987   +14     
- Misses      37094    37096    +2     
  Partials      218      218           
Files Coverage Δ
src/sentry/eventstore/snuba/backend.py 97.79% <100.00%> (ø)

... and 15 files with indirect coverage changes

@evanh evanh merged commit 91c0646 into master Mar 15, 2024
50 checks passed
@evanh evanh deleted the evanh/fix/no-epoch-times-in-conditions branch March 15, 2024 22:10
JonasBa pushed a commit that referenced this pull request Mar 17, 2024
Clickhouse behaves oddly when the normal epoch is used for dates:


ClickHouse/ClickHouse#9335 (comment)

This was working before by coincedence: an obsolete piece of code (query
splitters) in Snuba was clamping the date to a non-epoch value. When the
query
splitters were removed, this started breaking.

Instead of simply asking for "all time" use a date that aligns with how
our
data is actually stored.

This is also not a new issue, see
#30912
@github-actions github-actions bot locked and limited conversation to collaborators Mar 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants