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: Prevent all subscriptions from being logged as non-matching #2315

Merged
merged 3 commits into from
Dec 21, 2021

Conversation

lynnagara
Copy link
Member

We added "profile" to the ClickHouse result which contains information
about the query execution that will never actually be the same. Strip this
key before diffing the two queries and logging discrepancies to Sentry.

We added "profile" to the ClickHouse result which contains information
about the query execution that will never actually be the same. Strip this
key before diffing the two queries.
@lynnagara lynnagara requested a review from a team as a code owner December 20, 2021 21:49
Comment on lines +257 to +258
if "profile" in result_copy:
del result_copy["profile"]
Copy link
Member

Choose a reason for hiding this comment

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

this seems the wrong way to go about this. We're massaging the return payload so we can == it. Why not just write the comparison function to do what we want and keep the return payload the same?

Copy link
Member Author

@lynnagara lynnagara Dec 20, 2021

Choose a reason for hiding this comment

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

This is what we are doing. We are making a copy of result - not modifying the original. The variable called result_copy gets thrown away. Since this is fairly specific just to diffing for subscriptions logging I didn't want to change __eq__ on the actual Result object.

@lynnagara lynnagara changed the title fix: Prevent all subscription from being logged as non-matching fix: Prevent all subscriptions from being logged as non-matching Dec 21, 2021
@codecov-commenter
Copy link

Codecov Report

Merging #2315 (4119519) into master (35f4ea1) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2315   +/-   ##
=======================================
  Coverage   92.79%   92.79%           
=======================================
  Files         558      558           
  Lines       25642    25645    +3     
=======================================
+ Hits        23794    23797    +3     
  Misses       1848     1848           
Impacted Files Coverage Δ
snuba/subscriptions/worker.py 97.80% <100.00%> (+0.04%) ⬆️
tests/subscriptions/test_worker.py 96.26% <100.00%> (+0.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 35f4ea1...4119519. Read the comment docs.

@lynnagara lynnagara merged commit f06185a into master Dec 21, 2021
@lynnagara lynnagara deleted the consistent-subscription-logging branch December 21, 2021 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants