Skip to content

Commit bde13e8

Browse files
authored
fix(deletes): some ch versions dont have setting (#7536)
FIXES [SNUBA-9X1](https://sentry.sentry.io/issues/7025379706/?project=300688&referrer=github-pr-bot) Although this wont be an issue once all the clusters are upgraded getsentry/ops#17973
1 parent de62393 commit bde13e8

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

snuba/lw_deletions/strategy.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,10 @@ def _execute_delete(self, conditions: Sequence[ConditionsType]) -> None:
9898
self._check_ongoing_mutations()
9999
query_settings = HTTPQuerySettings()
100100
# starting in 24.4 the default is 2
101-
lw_sync = get_int_config("lightweight_deletes_sync", 2)
102-
query_settings.set_clickhouse_settings({"lightweight_deletes_sync": lw_sync})
101+
lw_sync = get_int_config("lightweight_deletes_sync")
102+
if lw_sync is not None:
103+
query_settings.set_clickhouse_settings({"lightweight_deletes_sync": lw_sync})
104+
103105
for table in self.__tables:
104106
query = construct_query(self.__storage, table, construct_or_conditions(conditions))
105107
start = time.time()

tests/lw_deletions/test_lw_deletions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ def test_clickhouse_settings(mock_execute: Mock, mock_num_mutations: Mock) -> No
9696
next_step=FormatQuery(commit_step, storage, SearchIssuesFormatter(), metrics),
9797
increment_by=increment_by,
9898
)
99+
state.set_config("lightweight_deletes_sync", 2)
99100
make_message = generate_message()
100101
strategy.submit(next(make_message))
101102
strategy.submit(next(make_message))

0 commit comments

Comments
 (0)