Page MenuHomePhabricator

Teardown of reading lists affects too many rows
Closed, ResolvedPublic

Description

The DBPerformance log in logstash has entries like

Query affected 10002 row(s):
query-m: DELETE FROM `reading_list_entry` WHERE rle_user_id = 'X'

That's not so great. And could go up to 100*5000 in theory (someone with 100 lists with 5000 entries using the teardown API).

Deletion should happen in batches; also the API request should probably only delete lists, and cleanup of list entries should be left to a maintenance script (the code for which is mostly in place already, as soft-deletions are handled in a similar way).

Event Timeline

Tgr updated the task description. (Show Details)
Tgr removed Tgr as the assignee of this task.Jun 30 2018, 11:54 AM
Jhernandez raised the priority of this task from Medium to High.Jul 5 2018, 3:14 PM

Change 472494 had a related patch set uploaded (by Jason Linehan; owner: Jason Linehan):
[mediawiki/extensions/ReadingLists@master] Ensures predictable performance for teardown and purge.

https://gerrit.wikimedia.org/r/472494

Change 472494 merged by jenkins-bot:
[mediawiki/extensions/ReadingLists@master] Ensures predictable performance for teardown and purge.

https://gerrit.wikimedia.org/r/472494

Tgr removed a project: Patch-For-Review.

Forgot to close this when the patch was merged. Thanks @jlinehan!