Page MenuHomePhabricator

Special:BrokenRedirects on tr.wikipedia is displaying ambiguous records
Open, NormalPublic

Description

"Valid" redirects keep coming up as "broken". See this for details.

Event Timeline

Superyetkin raised the priority of this task from to Normal.
Superyetkin updated the task description. (Show Details)
Superyetkin added a subscriber: Superyetkin.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 6 2015, 5:59 PM

Thanks for the report! What are "ambiguous records" exactly in this context? Which specific items listed on https://tr.wikipedia.org/wiki/%C3%96zel:BozukY%C3%B6nlendirmeler are problematic and why?
Please see https://www.mediawiki.org/wiki/How_to_report_a_bug

Aklapper renamed this task from Special:BrokenRedirects is displaying ambiguous records to Special:BrokenRedirects on tr.wikipedia is displaying ambiguous records.Oct 6 2015, 8:41 PM
Aklapper set Security to None.

Which specific items listed on https://tr.wikipedia.org/wiki/%C3%96zel:BozukY%C3%B6nlendirmeler are problematic and why?

The fifth item on that page is not correct. There is no redirect from the page Yasemin Yalçın to AB'nin Yolları Taştan. However, such a link exists and one can find the corresponding record in pagelinks table.

Florian added a subscriber: Florian.Oct 8 2015, 4:51 PM

Hmm, if the tool labs db replication isn't broken (as far as I can see, it's working well for dewiki :P), this seems to be any kind of caching issue. See the following queries:

florianschmidtwelzow@tools-bastion-01:~$ sql trwiki
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 43042800
Server version: 10.0.16-MariaDB Source distribution

Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [trwiki_p]> SELECT  p1.page_namespace AS namespace, p1.page_title AS title, p1.page_title AS value, rd_namespace,rd_title FROM `redirect` JOIN  `page` `p1` ON (rd_from=p1.page_id) LEFT JOIN `page` `p2` ON ((rd_namespace=p2.page_namespace) AND (rd_title=p2.page_title)) WHERE rd_namespace >= 0 AND rd_interwiki IS NULL OR rd_interwiki = '' AND p2.page_namespace IS NULL ORDER BY rd_namespace, rd_title, rd_from;
+-----------+---------------------------------------------+---------------------------------------------+--------------+------------------------------------------------+
| namespace | title                                       | value                                       | rd_namespace | rd_title                                       |
+-----------+---------------------------------------------+---------------------------------------------+--------------+------------------------------------------------+
|         2 | Firnasser/katkılarım                        | Firnasser/katkılarım                        |           -1 | Contributions/Firnasser                        |
|         2 | AyBars/Katkılar                             | AyBars/Katkılar                             |           -1 | Katkılar/AyBars                                |
|         2 | Eftal_GEZER/Katkılar                        | Eftal_GEZER/Katkılar                        |           -1 | Katkılar/Eftal_GEZER                           |
|         2 | Uur93/Katkılar                              | Uur93/Katkılar                              |           -1 | Katkılar/Uur93                                 |
|         0 | Rastgele_madde                              | Rastgele_madde                              |           -1 | Rastgele                                       |
|        12 | Özel_sayfaya_yönlendirme_denemesi           | Özel_sayfaya_yönlendirme_denemesi           |           -1 | Specialpages                                   |
|         0 | Ezik_fenerbahçe                             | Ezik_fenerbahçe                             |            0 | Aaagr                                          |
|         6 | CT_of_brain_of_Mikael_Häggström_large.png   | CT_of_brain_of_Mikael_Häggström_large.png   |            6 | Computed_tomography_of_human_brain_-_large.png |
+-----------+---------------------------------------------+---------------------------------------------+--------------+------------------------------------------------+
8 rows in set (2.65 sec)

MariaDB [trwiki_p]> select rd_title from redirect where rd_from = "989670";
Empty set (0.00 sec)

MariaDB [trwiki_p]> select rd_title from redirect where rd_title = "AB'nin Yolları Taştan";
Empty set (0.09 sec)

The redirect is already resolved, but is cached (like you can see in the message above the list), I'm wondering why the cache wasn't recreated for 4 days? :/

The problem, why the redirect isn't marked as resolved seems to be this code line:

$blinks = $fromObj->getBrokenLinksFrom(); # TODO: check for redirect, not for links

That seems to be false, getBrokenLinksFrom() includes _real_ links, too. And if you run the query behind that, you'll get:

MariaDB [trwiki_p]> SELECT pl_namespace, pl_title FROM `pagelinks` LEFT JOIN `page` ON ((pl_namespace=page_namespace) AND (pl_title=page_title)) WHERE pl_from = "989670" AND page_namespace IS NULL;
+--------------+---------------------------------------------+
| pl_namespace | pl_title                                    |
+--------------+---------------------------------------------+
|            0 | AB'nin_Yolları_Taştan                       |
|            0 | Aman_Annem_Görmesin                         |
|            0 | Artiz_Mektebi                               |
|            0 | Babamız_Eğleniyor                           |
|            0 | Bir_Başka_Gece_-_Mesela_Dedik               |
|            0 | Haşlama_Taşlama                             |
|            0 | Michael_Frayn                               |
|            0 | Oyunun_Oyunu                                |
|            0 | Sana_Bayılıyorum                            |
|            0 | Yasemin_Yalçın_İle_Yılbaşı_Özel_2011        |
|            0 | Yasemince_2000                              |
|            0 | Yaseminname                                 |
|            0 | Şan_Tiyatrosu                               |
+--------------+---------------------------------------------+
13 rows in set (0.02 sec)

Special:BrokenRedirects will use the first link (ordered like above), only, that's why the linked page (AB'nin_Yolları_Taştan is linked by Yasemin Yalçın) is identified as the (non-existent) redirect target.

Btw.: A solution could be, to use the content object to get the correct redirect target (Revision::newFromTitle($title)->getContent()->getRedirectTarget()). But there would be performance problems I think? :/