Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Feature: Purge local room history. #911
Conversation
erikjohnston
added some commits
Jul 4, 2016
erikjohnston
assigned
NegativeMjark
Jul 6, 2016
NegativeMjark
commented on an outdated diff
Jul 7, 2016
| + # state_groups_state | ||
| + | ||
| + # First ensure that we're not about to delete all the forward extremeties | ||
| + txn.execute( | ||
| + "SELECT e.event_id, e.depth FROM events as e " | ||
| + "INNER JOIN event_forward_extremities as f " | ||
| + "ON e.event_id = f.event_id " | ||
| + "AND e.room_id = f.room_id " | ||
| + "WHERE f.room_id = ?", | ||
| + (room_id,) | ||
| + ) | ||
| + rows = txn.fetchall() | ||
| + max_depth = max(row[0] for row in rows) | ||
| + | ||
| + if max_depth <= topological_ordering: | ||
| + raise Exception("topological_ordering is greater than forward extremeties") |
NegativeMjark
Contributor
|
|
What happens when clients try to backfill using tokens from before the purge? |
erikjohnston
referenced this pull request
in matrix-org/sytest
Jul 7, 2016
Merged
Add basic /admin/purge_history tests #260
erikjohnston
added some commits
Jul 7, 2016
It (successfully) returns 0 events. It probably triggers backfill to remote servers, so eventually it would probably return some events once the sever had backpaginated enough. |
|
LGTM |
erikjohnston
merged commit 70d650b
into
develop
Jul 7, 2016
10 checks passed
rubo77
commented
Jul 10, 2016
•
|
Is this already a solution for #890 - delete old data to clean up database ? |
|
@rubo77 Yes, though its only a basic, manual per room API atm |
|
@erikjohnston is this manual per room API documented somewhere or can anyone can give an example? |
rubo77
commented
Aug 19, 2016
|
In #916 I posted a gist, that could work. If it works, we should add that in the api-rst file |
|
@4nd3r It's briefly documented at: https://github.com/matrix-org/synapse/blob/master/docs/admin_api/purge_history_api.rst |
rubo77
commented
Aug 19, 2016
|
@erikjohnston can you take part of my example gist from #916 into that documentation? https://gist.github.com/rubo77/458eb4808d665e619feeaf556476f73f |
|
@erikjohnston thanks. does this API also delete uploaded media from disk? |
rubo77
commented
Aug 20, 2016
|
I updated to 0.17 now, and now my gist file works fine |
rubo77
commented
Aug 21, 2016
|
#1034 will add an example to the API Documentation |
erikjohnston commentedJul 6, 2016
No description provided.