Page MenuHomePhabricator

Counter of the numbers of the pages on a category shows negative result
Closed, ResolvedPublic

Description

On the Hungarian Wikipedia's recent changes ("friss változtatások") page there is a counter which shows the number of the pages on the candidates for speedy deletion category ("Azonnali törlésre váró lapok"). As you can see on the picture, sometimes it shows a negative number which is obviously wrong. How is it possible that it shows a negative number? Is it possible to fix it?

Event Timeline

Bencemac created this task.Jul 7 2017, 8:23 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 7 2017, 8:23 AM

This is probably because {{#expr:{{PAGESINCATEGORY}} ... is not properly written, so when doing the count, it displays a negative number.

({{#expr:{{PAGESINCATEGORY:Azonnali törlésre váró lapok}}-{{PAGESINCATEGORY:Azonnali törlésre váró lapok|subcats}}}})]]
MarcoAurelio removed Bencemac as the assignee of this task.Jul 7 2017, 9:48 AM

@MarcoAurelio If I think well we cannot fix it locally, right?

MarcoAurelio added a comment.EditedJul 8 2017, 9:59 AM

@Bencemac I am not sure either. Someone with more deep knowledge will look at your report and update you with what needs to be done.

The numbers of pages in categories are occasionally a bit off, mostly because the code updating them is not very reliable in case of race conditions or exceptions happening in the middle of the processing. If they ever get negative, viewing the category page should trigger recalculation of the count (this is actually special-cased). See T18036 for a longer discussion about inaccurate category counts.

binbot added a subscriber: binbot.Sep 2 2017, 2:01 PM
Bawolff added a subscriber: Bawolff.EditedMay 2 2018, 3:45 PM

We need to run recountCategories.php on huwiki. (See also T170737)

I'll look into doing that.

Mentioned in SAL (#wikimedia-operations) [2018-05-02T16:35:55Z] <bawolff> run recountCategories.php on huwiki T169964

And done.

Wow, that was much faster then i thought

@Bencemac can you confirm this is fixed now

[Note: Categories with lots of deletions suffer count drift at a high rate, so its entirely possible to get out of sync again later on]

@Bawolff Thanks! I cannot find any, so probably it solved the problem.