Page MenuHomePhabricator

A particular edit not showing on watchlist
Closed, ResolvedPublic

Description

On enwiki it's reported a particular edit is not showing up in watchlist but both edits before and after it are shown. It does look odd, and I tried many ways but can't find where the problem is. At Special:Preferences#mw-prefsection-watchlist the option to "Expand watchlist to show all changes, not just the most recent" is enabled. I also tested it on mobile device, where option to show only the most recent changes doesn't even exist.

Steps to reproduce:

  1. Add en:Llanelli to your watchlist
  2. Enable "Expand watchlist to show all changes, not just the most recent" on Special:Preferences#mw-prefsection-watchlist , (if you've not already)
  3. Go to your watchlist

Expected behavior

  1. These 3 edits should show up on Special:Watchlist. 1. Revert of the particular edit, 2. the particular edit concerned and 3. the edit before it

Current bahavior

  1. Both 1 and 3 show up. The intermediate one does not.

On mobile, you cannot choose to be shown only the most recent changes, all changes to a page are shown. But the particular edit is not shown there too. The edits before and after it are.

Event Timeline

Ammarpad created this task.Dec 13 2018, 5:57 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 13 2018, 5:57 AM
Restricted Application added a project: Growth-Team. · View Herald TranscriptDec 13 2018, 5:58 AM
Ammarpad updated the task description. (Show Details)Dec 13 2018, 7:43 AM
Ammarpad updated the task description. (Show Details)Dec 13 2018, 9:45 AM

Thanks for reporting this. I can confirm the problem.

Anomie added a subscriber: Anomie.Dec 13 2018, 4:33 PM

The watchlist itself it working fine. The row is for some reason missing from the recentchanges database table.

wikiadmin@10.64.32.115(enwiki)> select rc_id, rc_timestamp, rc_user, rc_user_text, rc_this_oldid, rc_type, rc_source, comment_text from recentchanges left join comment on (rc_comment_id=comment_id) where rc_namespace=0 and rc_title='Llanelli' order by rc_timestamp desc limit 5;
+------------+----------------+----------+----------------------------------------+---------------+---------+-----------+------------------------------------------------------------------------------------------------------------------------+
| rc_id      | rc_timestamp   | rc_user  | rc_user_text                           | rc_this_oldid | rc_type | rc_source | comment_text                                                                                                           |
+------------+----------------+----------+----------------------------------------+---------------+---------+-----------+------------------------------------------------------------------------------------------------------------------------+
| 1112905386 | 20181212161650 | 26398660 | CLCStudent                             |     873342547 |       0 | mw.edit   | Reverted edits by [[Special:Contribs/RhysWills|RhysWills]] ([[User talk:RhysWills|talk]]) to last version by Redrose64 |
| 1112736229 | 20181212003011 |  9612106 | Redrose64                              |     873244656 |       0 | mw.edit   | /* Media */ no inline ELs please                                                                                       |
| 1112623972 | 20181211155353 |        0 | 2A02:C7D:6453:DC00:DDAB:F691:9151:5F30 |     873177310 |       0 | mw.edit   | /* Media */                                                                                                            |
| 1112613991 | 20181211150507 |        0 | 2A02:C7D:6453:DC00:68F6:6F3:5EBA:8589  |     873171639 |       0 | mw.edit   | /* Media */ added correct information.                                                                                 |
| 1112280302 | 20181210135304 |        0 | wikidata>212.219.232.154               |     872925826 |       5 | wb        | /* wbsetclaim‑update:2||1 */ [[Property:P1082]]: 37,050                                                                |
+------------+----------------+----------+----------------------------------------+---------------+---------+-----------+------------------------------------------------------------------------------------------------------------------------+

Probably due to this error:

2018-12-12 16:14:48 [XBEz5QpAAE0AAEtp0bwAAACR] mw1282 enwiki 1.33.0-wmf.6 exception ERROR: [XBEz5QpAAE0AAEtp0bwAAACR] /w/api.php   Wikimedia\Rdbms\DBQueryError from line 1506 of /srv/mediawiki/php-1.33.0-wmf.6/includes/libs/rdbms/database/Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? 
Query: REPLACE INTO `tag_summary` (ts_tags,ts_rc_id,ts_rev_id) VALUES ('mobile edit,mobile web edit','1112904935','873342253')
Function: ChangeTags::updateTagSummaryRow
Error: 1205 Lock wait timeout exceeded; try restarting transaction (10.64.32.64)
 {"exception_id":"XBEz5QpAAE0AAEtp0bwAAACR","exception_url":"/w/api.php","caught_by":"mwe_handler"} 
[Exception Wikimedia\Rdbms\DBQueryError] (/srv/mediawiki/php-1.33.0-wmf.6/includes/libs/rdbms/database/Database.php:1506) A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? 
Query: REPLACE INTO `tag_summary` (ts_tags,ts_rc_id,ts_rev_id) VALUES ('mobile edit,mobile web edit','1112904935','873342253')
Function: ChangeTags::updateTagSummaryRow
Error: 1205 Lock wait timeout exceeded; try restarting transaction (10.64.32.64)

  #0 /srv/mediawiki/php-1.33.0-wmf.6/includes/libs/rdbms/database/Database.php(1476): Wikimedia\Rdbms\Database->makeQueryException(string, integer, string, string)
  #1 /srv/mediawiki/php-1.33.0-wmf.6/includes/libs/rdbms/database/Database.php(1236): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)
  #2 /srv/mediawiki/php-1.33.0-wmf.6/includes/libs/rdbms/database/Database.php(2852): Wikimedia\Rdbms\Database->query(string, string)
  #3 /srv/mediawiki/php-1.33.0-wmf.6/includes/libs/rdbms/database/DatabaseMysqlBase.php(498): Wikimedia\Rdbms\Database->nativeReplace(string, array, string)
  #4 /srv/mediawiki/php-1.33.0-wmf.6/includes/changetags/ChangeTags.php(505): Wikimedia\Rdbms\DatabaseMysqlBase->replace(string, array, array, string)
  #5 /srv/mediawiki/php-1.33.0-wmf.6/includes/changetags/ChangeTags.php(340): ChangeTags::updateTagSummaryRow(array, array, integer, integer, boolean, array)
  #6 /srv/mediawiki/php-1.33.0-wmf.6/includes/changetags/ChangeTags.php(227): ChangeTags::updateTags(array, array, integer, integer, boolean, NULL, RecentChange)
  #7 /srv/mediawiki/php-1.33.0-wmf.6/includes/changes/RecentChange.php(448): ChangeTags::addTags(array, integer, integer, boolean, NULL, RecentChange)
  #8 /srv/mediawiki/php-1.33.0-wmf.6/includes/changes/RecentChange.php(725): RecentChange->save()
  #9 /srv/mediawiki/php-1.33.0-wmf.6/includes/deferred/MWCallableUpdate.php(34): Closure$RecentChange::notifyEdit()
  #10 /srv/mediawiki/php-1.33.0-wmf.6/includes/deferred/DeferredUpdates.php(270): MWCallableUpdate->doUpdate()
  #11 /srv/mediawiki/php-1.33.0-wmf.6/includes/deferred/DeferredUpdates.php(216): DeferredUpdates::runUpdate(MWCallableUpdate, Wikimedia\Rdbms\LBFactoryMulti, string, integer)
  #12 /srv/mediawiki/php-1.33.0-wmf.6/includes/deferred/DeferredUpdates.php(140): DeferredUpdates::execute(array, string, integer)
  #13 /srv/mediawiki/php-1.33.0-wmf.6/includes/MediaWiki.php(905): DeferredUpdates::doUpdates(string)
  #14 /srv/mediawiki/php-1.33.0-wmf.6/includes/MediaWiki.php(728): MediaWiki->restInPeace(string, boolean)
  #15 [internal function]: Closure$MediaWiki::doPostOutputShutdown()
  #16 {main}

Note, there was some relatively recent changes to the schema for change tags - T185355

Yes, it's probably caused by my changes. One thing here though is that ChangeTags::updateTagSummaryRow is being dropped now. Which makes this bug solved automatically. https://gerrit.wikimedia.org/r/c/mediawiki/core/+/477610
Should we try to get it merged and backport the needed bits or fix this until the next train that removes everything?

I double checked everything. The code itself is not problematic and not touched by my changes and the error is "lock wait timeout exceeding" which seems like a random failure in grabbing the lock (correct me if I'm wrong).

Ladsgroup closed this task as Resolved.Dec 18 2018, 12:43 PM
Ladsgroup claimed this task.

ChangeTags::updateTagSummaryRow has been already deleted and will go live this week. So there shouldn't be any part that holds any lock (other parts inserts on other tables, this code path does replace). So after deploying wmf.9 this should not happen anymore.

Restricted Application added a project: User-Ladsgroup. · View Herald TranscriptDec 18 2018, 12:43 PM
Nnvu added a comment.Dec 21 2018, 6:58 PM
This comment was removed by Nnvu.
Pruem reopened this task as Open.EditedDec 22 2018, 1:19 PM
Pruem added a subscriber: Pruem.

The bug T212078 (which has been marked as duplicate) is definitely not solved in 1.33.0-wmf.9, which is the currently running version on dewiki per https://de.wikipedia.org/wiki/Spezial:Version. Therefore I reopened this task.

It's possible that this was caused by https://gerrit.wikimedia.org/r/c/mediawiki/core/+/452708/. Shouldn't happen, but who knows. Perhaps we should just revert the patch and see what happens.

Page categorisation seems to show on RC and watchlist again, although the Mediawiki version has not changed. A configuration issue, perhaps?

Nnvu added a comment.Dec 27 2018, 2:49 PM

On itwiki both Watchlist and RC shows page categorization correctly.

Tgr closed this task as Resolved.Jan 2 2019, 7:48 PM
Tgr added a subscriber: Krinkle.

T192691: [Commons] A new image added to a category is not shown in Watchlist/T212432: Category membership and wikidata not showing up in recent changes is a separate issue, the first has been merged here incorrectly. It affected all the RC entries which are not real edits but populated by some script. This task is about a single lock wait timeout error; those happen from time to time, so nothing to do here.

On a generic level, the frailty of RC notifications is ultimately caused by rMW97b2a1dfdafb: Made RecentChange defer the save() method via DeferredUpdates which moved recentchanges updates out of the transaction, but presumably we don't want to go back on that. IIRC @Krinkle wanted to address that making deferred updates and jobs more interchangeable; not sure if there is a task for that. (T149239 and T212482 are very tangentially related.)