-
-
Notifications
You must be signed in to change notification settings - Fork 62
fix(deletes): some ch versions dont have setting #7536
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
Conversation
| lw_sync = get_int_config("lightweight_deletes_sync") | ||
| if lw_sync: | ||
| query_settings.set_clickhouse_settings({"lightweight_deletes_sync": lw_sync}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: The change to get_int_config removes the default, causing lightweight_deletes_sync to be None and not set, leading to a KeyError in test_clickhouse_settings.
Severity: CRITICAL | Confidence: 1.00
🔍 Detailed Analysis
The get_int_config("lightweight_deletes_sync") call in the new code returns None when the config is not explicitly set, unlike the old code which defaulted to 2. This causes the if lw_sync: condition to evaluate to False, preventing query_settings.set_clickhouse_settings() from being called. Consequently, the test_clickhouse_settings assertion assert clickhouse_settings["lightweight_deletes_sync"] == 2 fails with a KeyError because the lightweight_deletes_sync key is missing from clickhouse_settings.
💡 Suggested Fix
Update test_clickhouse_settings to align with the new behavior where lightweight_deletes_sync is only set if explicitly configured, or reintroduce a default value to get_int_config if the old behavior is intended.
🤖 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: snuba/lw_deletions/strategy.py#L101-L103
Potential issue: The `get_int_config("lightweight_deletes_sync")` call in the new code
returns `None` when the config is not explicitly set, unlike the old code which
defaulted to `2`. This causes the `if lw_sync:` condition to evaluate to `False`,
preventing `query_settings.set_clickhouse_settings()` from being called. Consequently,
the `test_clickhouse_settings` assertion `assert
clickhouse_settings["lightweight_deletes_sync"] == 2` fails with a `KeyError` because
the `lightweight_deletes_sync` key is missing from `clickhouse_settings`.
Did we get this right? 👍 / 👎 to inform future reviews.
Reference_id: 2665648
❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
FIXES SNUBA-9X1
Although this wont be an issue once all the clusters are upgraded https://github.com/getsentry/ops/pull/17973