User:DWalden (WMF)/(Un)delete associated talk page
Appearance
What happens when you delete a page
[edit]Before delete
[edit]After delete
[edit]- Rows in the
revision
table are copied into thearchive
table - Rows in the
revision
,revision_actor_temp
andrevision_comment_temp
tables are deleted - Row in the
page
table is deleted - Rows deleted from
page_restrictions
,redirect
,*links
, if they existed in the first place - Row inserted into
logging
table which records the delete action - If deleted page had rows in the
recentchanges
table (e.g. for edits), they are deleted - Row inserted into
recentchanges
table which records the delete action
SQL queries
[edit](see also API:Database_field_and_API_property_associations)
What happens when you delete a file
[edit]Files on MediaWiki also have a page associated with them (whose titles are prefixed with "File:" e.g. File:Page_UML_diagram.png). So, what is written above about pages also applies to files.
In addition, there are three database tables:
image
, stores information about the most recent version of a fileoldimage
, stores information about older versions of a filefilearchive
, stores information on deleted files
When you delete
[edit]- Rows from
image
andoldimage
are copied to thefilearchive
table - Rows deleted from
image
andoldimage
tables - In the filestore, the current and old versions of the file are moved to the
$wgDeletedDirectory
SQL queries
[edit]Where to find files
[edit]- Special:NewFiles, e.g. https://en.wikipedia.beta.wmflabs.org/wiki/Special:NewFiles
Test Ideas
[edit]ACID
[edit]What bugs can we find related to ACID properties (atomicity, consistency, isolation, durability)? (see also MIT's Computer System Engineering course week 8, week 9, week 10. Video lectures [1].)
Consistency
[edit]- After deleting or restoring pages or files, does the data in the database end up in inconsistent states?
- Do all the appropriate rows get deleted or restored?
- Are all the appropriate relationships between data maintained?
- For example, I attempted to delete this image via the UI. It timed out. The rows in the
revision
andpage
tables were deleted, but the rows in theimage
table were not. Notice, for example, that even though the page appears to exist, it has a link to "Create" it. - Perhaps use ideas from chapter 7 of Explore It!
Use cases
[edit]- There are a few specialist use cases which use delete and restore which are outlined here and might be worth testing Manual:Administrators#Deletion.
Factors
[edit]Permissions
[edit]- Only users with the
delete
right (which usually is only users in the Administrator or sysop group) can delete a page/file. - Only users with the
bigdelete
right (usually those in the Stewards group) can delete a page/file with over 5000 revisions (or whatever the value of $wgDeleteRevisionsLimit). - Users can be blocked from some or all pages. For example, you can block a user from the Talk namespace, which would prevent them deleting a talk page.
"Big" pages
[edit]- When deleting pages or files with over 1000 revisions (or whatever the value of $wgDeleteRevisionsBatchSize), instead of all the revisions being deleted in one go they are done in batches.
- SQL query to list the top 10 pages with most revision: /big_page_sql.
- To add a large number of edits/revisions to a page you can use /mass_edit.
- You could combine this with #ACID test ideas above.
Redirects
[edit]- Make sure that when we delete pages which are redirects, we delete the redirect itself and not the target of the redirect (see phab:T295435).
- When you move a page over another page that already exists, the page is deleted to make way for the page you are moving. This is another way of deleting a page.
- Some users have the right
delete-redirect
which will only allow them to do this if the page they are deleting is a redirect with only one edit. See w:Wikipedia:Page_mover#delete-redirect.
- Some users have the right
Tools
[edit]- Adding a large number of revisions to a page or file /mass_edit.