-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
delete_local_events for purge_room_history #2858
Conversation
07d3b8b
to
3201ba8
Compare
retest this please |
synapse/storage/events.py
Outdated
): | ||
"""Deletes room history before a certain point | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't this too much whitespace?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes.
lgtm other than stupid whitespace query. I assume the new 'allow_empty_body' thing is necessary because previously we just crashed on trying to parse '' as JSON. finally: i always feel a bit scared of the purge API; when we first implemented it there were dire warnings about "this will lock your synapse solid" or "you must restart once you've purged" etc. If this is no longer true, we might want to call it out in the doc. |
we'd return a 400 NOT_JSON error or something. Sending an empty body seems like a thing that people would have been likely to do, so I'm trying to keep that working.
It is, evidently, still true. There's an argument that should be called out in the doc... |
synapse/storage/events.py
Outdated
@@ -2330,6 +2324,16 @@ def _purge_history_txn( | |||
] | |||
) | |||
|
|||
# the event peristence loop takes out an exclusive lock on room_depth |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i stared at this stupidly thinking that "event persistence loop" meant the loop immediately above which is purging and persisting the new events... rather than the general BAU activity of persisting events.
If you can clarify that you're talking about "synapse takes out an exclusive lock on room_depth whenever it persists events..." it would avoid confusing bears of very little brain such as I
re-lgtm other than the comment-which-i-found-confusing |
(beacause it deletes more than state)
this thing takes ages and the only sign of any progress is the logs, so having some logs is useful.
it was a bit of a non-sequitur there
Add a flag which makes the purger delete local events
... to avoid locking the table for too long
5da0285
to
39a6b35
Compare
Add a flag which makes the purger delete local events