Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Log when we delete rows that do not match constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston committed Jun 12, 2023
1 parent 2d04988 commit 0fe647a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions synapse/storage/background_updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -931,9 +931,15 @@ def validate_constraint_in_background_check(

to_delete = [row[:-1] for row in rows if not row[-1]]

self.db_pool.simple_delete_many_batch_txn(
txn, table=table, keys=unique_columns, values=to_delete
)
if to_delete:
logger.warning(
"Deleting %d rows that do not pass new constraint",
len(to_delete),
)

self.db_pool.simple_delete_many_batch_txn(
txn, table=table, keys=unique_columns, values=to_delete
)

self._background_update_progress_txn(
txn, update_name, new_progress.dict()
Expand Down

0 comments on commit 0fe647a

Please sign in to comment.