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

Commit

Permalink
Remove the last reference to event_txn_id. (#16521)
Browse files Browse the repository at this point in the history
This table was no longer used, except for a background process
which purged old entries in it.
  • Loading branch information
clokep committed Oct 23, 2023
1 parent 478a6c6 commit 12ca87f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions changelog.d/16521.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Stop deleting from an unused table.
6 changes: 0 additions & 6 deletions synapse/storage/databases/main/events_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -2095,12 +2095,6 @@ async def _cleanup_old_transaction_ids(self) -> None:

def _cleanup_old_transaction_ids_txn(txn: LoggingTransaction) -> None:
one_day_ago = self._clock.time_msec() - 24 * 60 * 60 * 1000
sql = """
DELETE FROM event_txn_id
WHERE inserted_ts < ?
"""
txn.execute(sql, (one_day_ago,))

sql = """
DELETE FROM event_txn_id_device_id
WHERE inserted_ts < ?
Expand Down
5 changes: 4 additions & 1 deletion synapse/storage/schema/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

SCHEMA_VERSION = 82 # remember to update the list below when updating
SCHEMA_VERSION = 83 # remember to update the list below when updating
"""Represents the expectations made by the codebase about the database schema
This should be incremented whenever the codebase changes its requirements on the
Expand Down Expand Up @@ -121,6 +121,9 @@
Changes in SCHEMA_VERSION = 82
- The insertion_events, insertion_event_extremities, insertion_event_edges, and
batch_events tables are no longer purged in preparation for their removal.
Changes in SCHEMA_VERSION = 83
- The event_txn_id is no longer used.
"""


Expand Down

0 comments on commit 12ca87f

Please sign in to comment.