Page MenuHomePhabricator

Fix remaining page records with page_latest == 0 in database.
Open, Needs TriagePublic

Description

This is the follow-up ticket to T115081 There is maintenance script in Core (attachLatest.php) that fixes the references for pages with existing revisions. Pages that have no revisions can obviously not be corrected and should probably be deleted.

Event Timeline

Marostegui subscribed.

Removing the DBA tag here as there's nothing for us to do, as we don't really run maintenance scripts.
I will kept subscribed to this task in case I'm needed for something else!
As long as the script has wait for replication and isn't issuing big deletes, it should be fine tu be run anytime. But a heads-up on this task would be useful

Thanks!

Krinkle moved this task from Tracking/Watching to Inbox on the Platform Engineering board.
Krinkle edited subscribers, added: daniel, Krinkle; removed: holger.knust.

This appears to be blocking resolution of a production error (T258321), and is pending action by PE. Politely asking for re-triage as it appears to be moved to Tracking without an obvious reason or by accident.

There are just 16 of these; I call them the "Sweet Sixteen". They've been in the database "forever". Why do you need a script to deal with just 16 items? Why can't someone just manually delete them?

T281921 looks similar, so it's likely the bug also prevents creation of the pages. T46199 also looks similar, and was fixed by deleting the page - has that been attempted? If there are no revisions, nothing would be lost.

Given

[samtar@deploy2002 ~]$ mwscript-k8s -f -- attachLatest.php --wiki=enwiki
⏳ Starting attachLatest.php on Kubernetes as job mw-script.eqiad.m0m6vos4 ...
⏳ Waiting for the container to start...
🚀 Job is running.
📜 Streaming logs:
Looking for pages with page_latest set to 0...
enwiki 19113987 [[User talk:1r3gr37n0n]] can't find latest rev time?!
enwiki 19399178 [[User talk:Vd437]] can't find latest rev time?!
enwiki 20513897 [[User talk:Heelo1]] can't find latest rev time?!
enwiki 22427194 [[User talk:HOTPOCKETSG]] can't find latest rev time?!
enwiki 22427202 [[User talk:Jaeh0317]] can't find latest rev time?!
enwiki 24090446 [[User talk:Mightym53821]] can't find latest rev time?!
enwiki 33750317 [[User talk:68.148.238.76]] can't find latest rev time?!
enwiki 35711061 [[User talk:Lilyonthevalley]] can't find latest rev time?!
enwiki 36111672 [[Wikipedia:Articles for deletion/2009 Sulu kidnapping crisis]] can't find latest rev time?!
enwiki 36111674 [[Wikipedia:Articles for deletion/3 Libras (song)]] can't find latest rev time?!
enwiki 36111680 [[User talk:Ttylxox1000]] can't find latest rev time?!
enwiki 36111682 [[Wikipedia:Articles for deletion/333: A Bibliography of the Science-Fantasy Novel]] can't find latest rev time?!
enwiki 36111687 [[Wikipedia:Articles for deletion/2009 Sulu kidnapping crisis (2nd nomination)]] can't find latest rev time?!
enwiki 36111692 [[Wikipedia:Articles for deletion/2009 Sulu kidnapping crisis (3rd nomination)]] can't find latest rev time?!
enwiki 36111727 [[User talk:Vishal.gkamath]] can't find latest rev time?!
enwiki 41990041 [[User talk:71.129.57.41]] can't find latest rev time?!
Done! Processed 0 pages.
This was a dry run; rerun with --fix to update page_latest.

I've gone through and deleted some of these (the User talk pages, for now) after confirming there are no revisions nor logging table entries for them:

1User talk:1r3gr37n0n - (id=19113987) (ns=3)
2Running query: select page_id, page_touched, page_namespace, page_title, page_latest from page where page_id = 19113987 limit 2;
3page_id page_touched page_namespace page_title page_latest
419113987 20220324080028 3 1r3gr37n0n 0
5
6Running query: select * from revision where rev_page = 19113987 limit 2;
7[✓] No revisions found for this page
8Running query: select * from logging where log_namespace = 3 and log_title = "1r3gr37n0n" limit 2;
9[✓] No logs found for this page
10Running query: delete from page where page_id = 19113987 and page_namespace = 3 limit 1;
11[✓] Deleted User talk:1r3gr37n0n (id=19113987)
12
13
14
15User talk:Vd437 - (id=19399178) (ns=3)
16Running query: select page_id, page_touched, page_namespace, page_title, page_latest from page where page_id = 19399178 limit 2;
17page_id page_touched page_namespace page_title page_latest
1819399178 20220324081347 3 Vd437 0
19
20Running query: select * from revision where rev_page = 19399178 limit 2;
21[✓] No revisions found for this page
22Running query: select * from logging where log_namespace = 3 and log_title = "Vd437" limit 2;
23[✓] No logs found for this page
24Running query: delete from page where page_id = 19399178 and page_namespace = 3 limit 1;
25[✓] Deleted User talk:Vd437 (id=19399178)
26
27
28
29User talk:Heelo1 - (id=20513897) (ns=3)
30Running query: select page_id, page_touched, page_namespace, page_title, page_latest from page where page_id = 20513897 limit 2;
31page_id page_touched page_namespace page_title page_latest
3220513897 20231104232017 3 Heelo1 0
33
34Running query: select * from revision where rev_page = 20513897 limit 2;
35[✓] No revisions found for this page
36Running query: select * from logging where log_namespace = 3 and log_title = "Heelo1" limit 2;
37[✓] No logs found for this page
38Running query: delete from page where page_id = 20513897 and page_namespace = 3 limit 1;
39[✓] Deleted User talk:Heelo1 (id=20513897)
40
41
42
43User talk:HOTPOCKETSG - (id=22427194) (ns=3)
44Running query: select page_id, page_touched, page_namespace, page_title, page_latest from page where page_id = 22427194 limit 2;
45page_id page_touched page_namespace page_title page_latest
4622427194 20220324080028 3 HOTPOCKETSG 0
47
48Running query: select * from revision where rev_page = 22427194 limit 2;
49[✓] No revisions found for this page
50Running query: select * from logging where log_namespace = 3 and log_title = "HOTPOCKETSG" limit 2;
51[✓] No logs found for this page
52Running query: delete from page where page_id = 22427194 and page_namespace = 3 limit 1;
53[✓] Deleted User talk:HOTPOCKETSG (id=22427194)
54
55
56
57User talk:Jaeh0317 - (id=22427202) (ns=3)
58Running query: select page_id, page_touched, page_namespace, page_title, page_latest from page where page_id = 22427202 limit 2;
59page_id page_touched page_namespace page_title page_latest
6022427202 20220324080028 3 Jaeh0317 0
61
62Running query: select * from revision where rev_page = 22427202 limit 2;
63[✓] No revisions found for this page
64Running query: select * from logging where log_namespace = 3 and log_title = "Jaeh0317" limit 2;
65[✓] No logs found for this page
66Running query: delete from page where page_id = 22427202 and page_namespace = 3 limit 1;
67[✓] Deleted User talk:Jaeh0317 (id=22427202)
68
69
70
71User talk:Mightym53821 - (id=24090446) (ns=3)
72Running query: select page_id, page_touched, page_namespace, page_title, page_latest from page where page_id = 24090446 limit 2;
73page_id page_touched page_namespace page_title page_latest
7424090446 20220324080028 3 Mightym53821 0
75
76Running query: select * from revision where rev_page = 24090446 limit 2;
77[✓] No revisions found for this page
78Running query: select * from logging where log_namespace = 3 and log_title = "Mightym53821" limit 2;
79[✓] No logs found for this page
80Running query: delete from page where page_id = 24090446 and page_namespace = 3 limit 1;
81[✓] Deleted User talk:Mightym53821 (id=24090446)
82
83
84
85User talk:68.148.238.76 - (id=33750317) (ns=3)
86Running query: select page_id, page_touched, page_namespace, page_title, page_latest from page where page_id = 33750317 limit 2;
87page_id page_touched page_namespace page_title page_latest
8833750317 20220324080028 3 68.148.238.76 0
89
90Running query: select * from revision where rev_page = 33750317 limit 2;
91[✓] No revisions found for this page
92Running query: select * from logging where log_namespace = 3 and log_title = "68.148.238.76" limit 2;
93[✓] No logs found for this page
94Running query: delete from page where page_id = 33750317 and page_namespace = 3 limit 1;
95[✓] Deleted User talk:68.148.238.76 (id=33750317)
96
97
98
99User talk:Lilyonthevalley - (id=35711061) (ns=3)
100Running query: select page_id, page_touched, page_namespace, page_title, page_latest from page where page_id = 35711061 limit 2;
101page_id page_touched page_namespace page_title page_latest
10235711061 20220324080028 3 Lilyonthevalley 0
103
104Running query: select * from revision where rev_page = 35711061 limit 2;
105[✓] No revisions found for this page
106Running query: select * from logging where log_namespace = 3 and log_title = "Lilyonthevalley" limit 2;
107[✓] No logs found for this page
108Running query: delete from page where page_id = 35711061 and page_namespace = 3 limit 1;
109[✓] Deleted User talk:Lilyonthevalley (id=35711061)
110
111
112
113User talk:Ttylxox1000 - (id=36111680) (ns=3)
114Running query: select page_id, page_touched, page_namespace, page_title, page_latest from page where page_id = 36111680 limit 2;
115page_id page_touched page_namespace page_title page_latest
11636111680 20220324080028 3 Ttylxox1000 0
117
118Running query: select * from revision where rev_page = 36111680 limit 2;
119[✓] No revisions found for this page
120Running query: select * from logging where log_namespace = 3 and log_title = "Ttylxox1000" limit 2;
121[✓] No logs found for this page
122Running query: delete from page where page_id = 36111680 and page_namespace = 3 limit 1;
123[✓] Deleted User talk:Ttylxox1000 (id=36111680)
124
125
126
127User talk:Vishal.gkamath - (id=36111727) (ns=3)
128Running query: select page_id, page_touched, page_namespace, page_title, page_latest from page where page_id = 36111727 limit 2;
129page_id page_touched page_namespace page_title page_latest
13036111727 20220324082013 3 Vishal.gkamath 0
131
132Running query: select * from revision where rev_page = 36111727 limit 2;
133[✓] No revisions found for this page
134Running query: select * from logging where log_namespace = 3 and log_title = "Vishal.gkamath" limit 2;
135[✓] No logs found for this page
136Running query: delete from page where page_id = 36111727 and page_namespace = 3 limit 1;
137[✓] Deleted User talk:Vishal.gkamath (id=36111727)
138
139
140
141User talk:71.129.57.41 - (id=41990041) (ns=3)
142Running query: select page_id, page_touched, page_namespace, page_title, page_latest from page where page_id = 41990041 limit 2;
143page_id page_touched page_namespace page_title page_latest
14441990041 20250319202707 3 71.129.57.41 0
145
146Running query: select * from revision where rev_page = 41990041 limit 2;
147[✓] No revisions found for this page
148Running query: select * from logging where log_namespace = 3 and log_title = "71.129.57.41" limit 2;
149[✓] No logs found for this page
150Running query: delete from page where page_id = 41990041 and page_namespace = 3 limit 1;
151[✓] Deleted User talk:71.129.57.41 (id=41990041)