Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

garbage collect forgotten rooms #4720

Open
ara4n opened this issue Feb 23, 2019 · 10 comments
Open

garbage collect forgotten rooms #4720

ara4n opened this issue Feb 23, 2019 · 10 comments
Labels
T-Task Z-Help-Wanted

Comments

@ara4n
Copy link
Member

ara4n commented Feb 23, 2019

if everyone on a server has left and forgotten a given room, we should GC it from the DB

@neilisfragile neilisfragile added z-p2 z-enhancement labels Feb 26, 2019
@richvdh richvdh changed the title garbage collect forgotton rooms garbage collect forgotten rooms Feb 26, 2019
@aaronraimist
Copy link
Contributor

aaronraimist commented Mar 13, 2020

This should probably get a Mozilla label https://bugzilla.mozilla.org/show_bug.cgi?id=1622403

@schildbach
Copy link

schildbach commented Aug 7, 2020

This seems like no-brainer to me. I just deleted gigabytes of data from my postgres DB just by manually removing abandoned rooms.

@peterhoeg
Copy link

peterhoeg commented Aug 11, 2020

Do you have a (relatively) safe script to do that @schildbach ?

@ptman
Copy link
Contributor

ptman commented Aug 11, 2020

@peterhoeg you can get a list of rooms and remove them via the admin api: https://github.com/matrix-org/synapse/blob/develop/docs/admin_api/rooms.md

Directly modifying the database is error prone and should not be done.

Also synapse admin ui can let you click around instead of writing code for the API: https://github.com/Awesome-Technologies/synapse-admin

@schildbach
Copy link

schildbach commented Aug 11, 2020

@peterhoeg I used the instructions provided here. Yes, it uses the admin API for write operations. Still, I think synapse could automatically purge a room if the last local user left it.

@clokep
Copy link
Member

clokep commented Aug 11, 2020

I suspect to have this done automatically we would want to:

  1. Add a background update that searches for rooms with 0 joined members.
  2. Iterates over them and calls purge.

There's a couple of tricky pieces here:

  1. Do we care how long ago this had no members in it? (Do you want to immediately purge the room or wait a few days?)
  2. Some logic to ensure only a single background update is running at once, as purging can take a while.

@clokep clokep added the Z-Help-Wanted label Aug 11, 2020
@schildbach
Copy link

schildbach commented Aug 11, 2020

Alternatively, it could simply purge immediately, within the "last member left" operation. For me, waiting a few days doesn't add any value.

@olmari
Copy link
Contributor

olmari commented Dec 5, 2020

How about following set retention minimum policy? Would be most logical, so in case of fould play it would still be there to dig if so needed within same retention policy numbers as any other related event.

@ara4n
Copy link
Member Author

ara4n commented May 1, 2021

I suspect to have this done automatically we would want to:

  1. Add a background update that searches for rooms with 0 joined members.

N.B. a room with 0 joined members is distinct from a room where all the local members have explicitly forgotten it. You should only purge/gc ones which have been explicitly forgotten, rather than just parted (given we let users read their historical rooms unless they forget them - like a recycle bin in a filemanager).

@erikjohnston erikjohnston added T-Task Z-Help-Wanted and removed z-enhancement Z-Help-Wanted z-p2 labels May 20, 2021
aaronraimist added a commit to aaronraimist/Dokumentation that referenced this issue Aug 6, 2022
Synapse does not do this. That is an open request but it has not been implemented. matrix-org/synapse#4720

I sent a message in May,https://matrix.to/#/!tIWQjETAJquswcgSTQ:tu-dresden.de/$nbbHykJfc8OJBeQ2R0hbvf3mgAtczsGSTXPidH5nzkc?via=tu-dresden.de&via=matrix.org&via=ungleich.ch, asking  if this was a custom feature implemented by your university or if this sentence was a result of misunderstanding how Synapse works. I never got a response so I am making this PR to remove the misleading information. If this is a custom feature then please clarify that in the documentation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Task Z-Help-Wanted
Projects
None yet
Development

No branches or pull requests

10 participants