Skip to content

Commit

Permalink
Remove Generator in _purge_unreferenced_state_groups twice (#17815)
Browse files Browse the repository at this point in the history
Context: matrix-org/synapse#15439
(#15439)

Also see discussion in #17813
  • Loading branch information
realtyem authored Oct 31, 2024
1 parent 0c429fa commit 034d472
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.d/17815.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Avoid lost data on some database query retries.
4 changes: 2 additions & 2 deletions synapse/storage/databases/state/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -804,11 +804,11 @@ def _purge_unreferenced_state_groups(
logger.info("[purge] removing redundant state groups")
txn.execute_batch(
"DELETE FROM state_groups_state WHERE state_group = ?",
((sg,) for sg in state_groups_to_delete),
[(sg,) for sg in state_groups_to_delete],
)
txn.execute_batch(
"DELETE FROM state_groups WHERE id = ?",
((sg,) for sg in state_groups_to_delete),
[(sg,) for sg in state_groups_to_delete],
)

@trace
Expand Down

0 comments on commit 034d472

Please sign in to comment.