summary refs log tree commit diff
diff options
context:
space:
mode:
authorJason Little <realtyem@gmail.com>2024-10-30 20:16:49 -0500
committerGitHub <noreply@github.com>2024-10-30 20:16:49 -0500
commit034d472688a83c5a41bda8a27c485111ecf95138 (patch)
tree14e478537287ca8fcf10a1763319120dfa5cc5c2
parentRemove `Generator` in `update_cached_last_access_time` (#17816) (diff)
downloadsynapse-034d472688a83c5a41bda8a27c485111ecf95138.tar.xz
Remove `Generator` in `_purge_unreferenced_state_groups` twice (#17815)
Context: https://github.com/matrix-org/synapse/issues/15439
(https://github.com/element-hq/synapse/issues/15439)

Also see discussion in https://github.com/element-hq/synapse/pull/17813
Diffstat (limited to '')
-rw-r--r--changelog.d/17815.bugfix1
-rw-r--r--synapse/storage/databases/state/store.py4
2 files changed, 3 insertions, 2 deletions
diff --git a/changelog.d/17815.bugfix b/changelog.d/17815.bugfix
new file mode 100644

index 0000000000..5dd276709b --- /dev/null +++ b/changelog.d/17815.bugfix
@@ -0,0 +1 @@ +Avoid lost data on some database query retries. diff --git a/synapse/storage/databases/state/store.py b/synapse/storage/databases/state/store.py
index aea71b8fcc..875dba3349 100644 --- a/synapse/storage/databases/state/store.py +++ b/synapse/storage/databases/state/store.py
@@ -804,11 +804,11 @@ class StateGroupDataStore(StateBackgroundUpdateStore, SQLBaseStore): 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