Lucas_Werkmeister_WMDE added a comment.

  Okay, I don’t know where these bad page IDs would be coming from. 
`eu_page_id` is only written from very few places:
  
  - `AddUsagesForPageJob::run()` → `UsageUpdater::addUsagesForPage()` → 
`SqlUsageTracker::addUsedEntities()` → `EntityUsageTable::addUsages()` – but 
`AddUsagesForPageJob` asserts in the constructor that the page ID is greater 
than 0
  - `DataUpdateHookHandler::onLinksUpdateComplete()` → 
``DataUpdateHookHandler::doLinksUpdateComplete()` → 
`UsageUpdater::replaceUsagesForPage()` → 
`SqlUsageTracker::replaceUsedEntities()` → `EntityUsageTable::addUsages()` – 
but while the `LinksUpdateComplete` hook runs as a deferred update (see 
`LinksUpdate::doUpdate()`), the `DataUpdateHookHandler` gets the page ID from 
the `LinksUpdate`’s `Title` object, so even if the page is deleted in the 
meantime, as far as I can tell the page ID should still be nonzero, since I 
don’t see how the `Title` would know that its page ID was no longer valid
  
  I suggest adding some logging for when invalid page IDs are written (probably 
at Warning level) and then looking at the stack traces of those warnings in 
logstash (if they happen at all).

TASK DETAIL
  https://phabricator.wikimedia.org/T264929

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Lucas_Werkmeister_WMDE
Cc: WMDE-leszek, Lucas_Werkmeister_WMDE, Michael, Aklapper, BPirkle, Akuckartz, 
Iflorez, darthmon_wmde, alaa_wmde, Nandana, lucamauri, Lahi, Gq86, 
GoranSMilovanovic, QZanden, LawExplorer, _jensen, rosalieper, Scott_WUaS, 
Jonas, Verdy_p, Wikidata-bugs, aude, Lydia_Pintscher, Jdforrester-WMF, Mbch331, 
Rxy, Jay8g
_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to