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

Delete room API doesn't remove all entries from state_groups/state_groups state #14757

Closed
jakemoroni opened this issue Jan 2, 2023 · 2 comments

Comments

@jakemoroni
Copy link

Description

When using the delete room API (as per https://matrix-org.github.io/synapse/v1.41/admin_api/rooms.html#delete-room-api), I've noticed that there are still entries related to the room in question in state_groups and state_groups_state (and probably elsewhere) even after the operation has apparently completed successfully.

The logs even indicate that the room was supposedly deleted:

synapse.storage.databases.state.store - 728 - INFO - DELETE-915 - [purge] removing !REDACTED:matrix.org from state_groups

But inspection of the DB proves otherwise. The room is no longer listed in the rooms table, so perhaps those entries can be safely deleted manually?

The actual command used is as follows:

curl --header "Authorization: Bearer REDACTED" -H "Content-Type: application/json" -X DELETE -d '{"block": true, "purge": true, "force_purge": true}' 'https://example.com/_synapse/admin/v1/rooms/!REDACTED:matrix.org'

I came across the "synapse-find-unreferenced-state-groups" utility, but this seems to be for instances using PostgreSQL, but I'm using SQLite (using the latest docker image).

I also found the "nuke room from DB" script, but that seems way too risky to attempt and is unsupported.

Steps to reproduce

  • Join a room on a remote server
  • Leave the room
  • Use the delete room API
  • Find that there are still entries related to the room in the state_groups table

Homeserver

Personal homeserver

Synapse Version

1.74.0

Installation Method

Docker (matrixdotorg/synapse)

Database

SQLite

Workers

Single process

Platform

Docker, on Linux

Configuration

No response

Relevant log output

2023-01-02 02:39:13,887 - synapse.storage.databases.state.store - 706 - INFO - DELETE-915 - [purge] removing !REDACTED:matrix.org from state_groups_state

2023-01-02 02:39:13,888 - synapse.storage.databases.state.store - 717 - INFO - DELETE-915 - [purge] removing !REDACTED:matrix.org from state_group_edges

2023-01-02 02:39:13,888 - synapse.storage.databases.state.store - 728 - INFO - DELETE-915 - [purge] removing !REDACTED:matrix.org from state_groups

Anything else that would be useful to know?

No response

@ankit-pn
Copy link

ankit-pn commented Jan 3, 2023

I can confirm , entries of deleted rooms are not deleting from state_groups!

@clokep
Copy link
Member

clokep commented Jan 3, 2023

I believe this is a duplicate of #12821.

@clokep clokep closed this as completed Jan 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants