Compare commits

..

3 Commits

Author SHA1 Message Date
Eric Eastwood
3dc37e43dc
Merge 90780763c874f9ce47dca68e03a8f38a236fc515 into cc8da2c5ed0cecc771919d76533704a04de9a41e 2025-07-02 09:25:42 -05:00
Erik Johnston
cc8da2c5ed
Log the room ID we're purging state for (#18625)
So we can see what we're deleting.
2025-07-02 15:02:12 +01:00
reivilibre
c17fd947f3
Fix documentation of the Delete Room Admin API's status field. (#18519)
Fixes: #18502

---------

Signed-off-by: Olivier 'reivilibre <oliverw@matrix.org>
2025-07-01 17:55:38 +01:00
4 changed files with 13 additions and 4 deletions

1
changelog.d/18519.doc Normal file
View File

@ -0,0 +1 @@
Fix documentation of the Delete Room Admin API's status field.

1
changelog.d/18625.misc Normal file
View File

@ -0,0 +1 @@
Log the room ID we're purging state for.

View File

@ -806,7 +806,7 @@ A response body like the following is returned:
}, { }, {
"delete_id": "delete_id2", "delete_id": "delete_id2",
"room_id": "!roomid:example.com", "room_id": "!roomid:example.com",
"status": "purging", "status": "active",
"shutdown_room": { "shutdown_room": {
"kicked_users": [ "kicked_users": [
"@foobar:example.com" "@foobar:example.com"
@ -843,7 +843,7 @@ A response body like the following is returned:
```json ```json
{ {
"status": "purging", "status": "active",
"delete_id": "bHkCNQpHqOaFhPtK", "delete_id": "bHkCNQpHqOaFhPtK",
"room_id": "!roomid:example.com", "room_id": "!roomid:example.com",
"shutdown_room": { "shutdown_room": {
@ -876,8 +876,8 @@ The following fields are returned in the JSON response body:
- `delete_id` - The ID for this purge - `delete_id` - The ID for this purge
- `room_id` - The ID of the room being deleted - `room_id` - The ID of the room being deleted
- `status` - The status will be one of: - `status` - The status will be one of:
- `shutting_down` - The process is removing users from the room. - `scheduled` - The deletion is waiting to be started
- `purging` - The process is purging the room and event data from database. - `active` - The process is purging the room and event data from database.
- `complete` - The process has completed successfully. - `complete` - The process has completed successfully.
- `failed` - The process is aborted, an error has occurred. - `failed` - The process is aborted, an error has occurred.
- `error` - A string that shows an error message if `status` is `failed`. - `error` - A string that shows an error message if `status` is `failed`.

View File

@ -34,6 +34,7 @@ from synapse.metrics.background_process_metrics import wrap_as_background_proces
from synapse.storage.database import LoggingTransaction from synapse.storage.database import LoggingTransaction
from synapse.storage.databases import Databases from synapse.storage.databases import Databases
from synapse.types.storage import _BackgroundUpdates from synapse.types.storage import _BackgroundUpdates
from synapse.util.stringutils import shortstr
if TYPE_CHECKING: if TYPE_CHECKING:
from synapse.server import HomeServer from synapse.server import HomeServer
@ -167,6 +168,12 @@ class PurgeEventsStorageController:
break break
(room_id, groups_to_sequences) = next_to_delete (room_id, groups_to_sequences) = next_to_delete
logger.info(
"[purge] deleting state groups for room %s: %s",
room_id,
shortstr(groups_to_sequences.keys(), maxitems=10),
)
made_progress = await self._delete_state_groups( made_progress = await self._delete_state_groups(
room_id, groups_to_sequences room_id, groups_to_sequences
) )