Page MenuHomePhabricator

The rdf-streaming-updater does not reconcile missed page-undelete events
Closed, ResolvedPublic

Description

Receiving a revision-create events after page-delete events should be dealt as an inconsistency and be processed by the reconciliation job.

This did not work as expected as reported here the entity Q115608572 remained deleted after subsequent edits were made to it after a contributor un-deleted it on 2023-01-12T00:18:53 and subsequent edits happened.

The corresponding page-undelete was not emitted because of T329064 but further edits should have helped to reconstruct this entity in WDQS but this was not the case.

AC:

  • understand why such inconsistencies are not treated properly
  • a revision-create event entering the updater while having a state saying that the entity is deleted should trigger an event in the rdf-streaming-updater.state-inconsistency stream
  • the event sent in the rdf-streaming-updater.state-inconsistency should properly trigger an "reconcile" event and restore the entity in WDQS

Event Timeline

The inconsistencies were properly detected by the updater:

select * from rdf_streaming_updater_state_inconsistency where year=2023 AND month=01 AND day=12 AND meta.domain="www.wikidata.org" AND item="Q115608572" AND datacenter="codfw";
_schema	meta	item	dt	original_ingestion_dt	revision_id	original_event_info	action_type	parent_revision_id	inconsistency	state_revision_id	state_status	is_wmf_domain	normalized_host	datacenter	year	month	day	hour
NULL	{"uri":null,"request_id":null,"id":"5eae0041-d477-4231-a31d-fe60d09b1992","dt":"2023-01-12T00:21:02.243793Z","domain":"www.wikidata.org","stream":"rdf-streaming-updater.state-inconsistency"}	Q115608572	2023-01-12T00:21:02.243557Z	2023-01-12T00:18:54.174Z	1785108184	{"_schema":null,"meta":{"uri":null,"request_id":"ab00575f-7a12-43cb-9f73-a50bf7e98540","id":"748301dd-194a-40c5-8db1-8bf79f67c797","dt":"2023-01-12T00:18:53Z","domain":"www.wikidata.org","stream":"mediawiki.revision-create"},"dt":"2023-01-12T00:18:53Z"}	revision-create	1785104250	newer_revision_seen	1785111610	DELETED	true	{"project_class":"wikidata","project":"-","qualifiers":[],"tld":"org","project_family":"wikidata"}	codfw	2023	1	12	0
NULL	{"uri":null,"request_id":null,"id":"fdfdef74-0249-4c56-adeb-aab5834f8e3a","dt":"2023-01-12T00:25:17.876264Z","domain":"www.wikidata.org","stream":"rdf-streaming-updater.state-inconsistency"}	Q115608572	2023-01-12T00:25:17.875852Z	2023-01-12T00:22:40.864Z	1809645267	{"_schema":null,"meta":{"uri":null,"request_id":"089f327e-e5f5-4bb4-b5db-dd7163a0c3fc","id":"e0779cda-3936-4705-baa6-a7bb9e21122f","dt":"2023-01-12T00:22:40Z","domain":"www.wikidata.org","stream":"mediawiki.revision-create"},"dt":"2023-01-12T00:22:40Z"}	revision-create	1785111610	newer_revision_seen	1785111610	DELETED	true	{"project_class":"wikidata","project":"-","qualifiers":[],"tld":"org","project_family":"wikidata"}	codfw	2023	1	12	0
NULL	{"uri":null,"request_id":null,"id":"eb6219c5-9d08-4148-b046-9b829fb7840e","dt":"2023-01-12T00:21:02.235752Z","domain":"www.wikidata.org","stream":"rdf-streaming-updater.state-inconsistency"}	Q115608572	2023-01-12T00:21:02.235069Z	2023-01-12T00:18:54.174Z	1785104250	{"_schema":null,"meta":{"uri":null,"request_id":"ab00575f-7a12-43cb-9f73-a50bf7e98540","id":"372a8237-b3cc-43a1-bd53-9d81f8ed3a9c","dt":"2023-01-12T00:18:53Z","domain":"www.wikidata.org","stream":"mediawiki.revision-create"},"dt":"2023-01-12T00:18:53Z"}	revision-create	NULL	newer_revision_seen	1785111610	DELETED	true	{"project_class":"wikidata","project":"-","qualifiers":[],"tld":"org","project_family":"wikidata"}	codfw	2023	1	12	0
NULL	{"uri":null,"request_id":null,"id":"ca728ff4-7bbe-4d25-9862-56494aac1c2c","dt":"2023-01-12T00:35:24.918556Z","domain":"www.wikidata.org","stream":"rdf-streaming-updater.state-inconsistency"}	Q115608572	2023-01-12T00:35:24.918252Z	2023-01-12T00:33:23.599Z	1809650380	{"_schema":null,"meta":{"uri":null,"request_id":"708615f4-e67c-4cc0-85fe-0a8dfb73f1fc","id":"e546995d-0120-4b1f-a9d4-f82fb9af88e4","dt":"2023-01-12T00:33:23Z","domain":"www.wikidata.org","stream":"mediawiki.revision-create"},"dt":"2023-01-12T00:33:23Z"}	revision-create	1809649800	newer_revision_seen	1785111610	DELETED	true	{"project_class":"wikidata","project":"-","qualifiers":[],"tld":"org","project_family":"wikidata"}	codfw	2023	1	12	0
NULL	{"uri":null,"request_id":null,"id":"197fc474-7793-495b-b34b-b14df361fb4c","dt":"2023-01-12T00:38:51.435003Z","domain":"www.wikidata.org","stream":"rdf-streaming-updater.state-inconsistency"}	Q115608572	2023-01-12T00:38:51.434637Z	2023-01-12T00:36:45.418Z	1809652184	{"_schema":null,"meta":{"uri":null,"request_id":"8b2822eb-2c55-478e-bbb9-dbd70a2ebadb","id":"3f1a8d11-4dc2-49a3-b536-80a532d11d68","dt":"2023-01-12T00:36:44Z","domain":"www.wikidata.org","stream":"mediawiki.revision-create"},"dt":"2023-01-12T00:36:44Z"}	revision-create	1809650380	newer_revision_seen	1785111610	DELETED	true	{"project_class":"wikidata","project":"-","qualifiers":[],"tld":"org","project_family":"wikidata"}	codfw	2023	1	12	0
NULL	{"uri":null,"request_id":null,"id":"a1682210-27d0-43aa-b73a-dab169db6d09","dt":"2023-01-12T00:29:48.706526Z","domain":"www.wikidata.org","stream":"rdf-streaming-updater.state-inconsistency"}	Q115608572	2023-01-12T00:29:48.706271Z	2023-01-12T00:27:47.489Z	1809647736	{"_schema":null,"meta":{"uri":null,"request_id":"9189d7bf-6a8c-4076-a20e-d6f2b19223a1","id":"db3a7565-4f37-45cd-b8c7-995bb123c23c","dt":"2023-01-12T00:27:47Z","domain":"www.wikidata.org","stream":"mediawiki.revision-create"},"dt":"2023-01-12T00:27:47Z"}	revision-create	1809646313	newer_revision_seen	1785111610	DELETED	true	{"project_class":"wikidata","project":"-","qualifiers":[],"tld":"org","project_family":"wikidata"}	codfw	2023	1	12	0
NULL	{"uri":null,"request_id":null,"id":"e3f7a0ec-e592-466a-8cb0-4762db119ab5","dt":"2023-01-12T00:34:46.957749Z","domain":"www.wikidata.org","stream":"rdf-streaming-updater.state-inconsistency"}	Q115608572	2023-01-12T00:34:46.957575Z	2023-01-12T00:32:02.218Z	1809649627	{"_schema":null,"meta":{"uri":null,"request_id":"8ded7e5c-c8e0-47f3-a798-fb963434d36c","id":"d79048d7-ce32-44b8-ae3e-7112ef988b0a","dt":"2023-01-12T00:32:01Z","domain":"www.wikidata.org","stream":"mediawiki.revision-create"},"dt":"2023-01-12T00:32:01Z"}	revision-create	1809647736	newer_revision_seen	1785111610	DELETED	true	{"project_class":"wikidata","project":"-","qualifiers":[],"tld":"org","project_family":"wikidata"}	codfw	2023	1	12	0
NULL	{"uri":null,"request_id":null,"id":"194c0316-111c-4510-82c1-29b6002d88d7","dt":"2023-01-12T00:34:46.959180Z","domain":"www.wikidata.org","stream":"rdf-streaming-updater.state-inconsistency"}	Q115608572	2023-01-12T00:34:46.959053Z	2023-01-12T00:32:19.613Z	1809649800	{"_schema":null,"meta":{"uri":null,"request_id":"a154604e-a1f3-493f-8747-2ef96e508fbf","id":"89284866-1c87-4fed-9bf3-e3c3cf923997","dt":"2023-01-12T00:32:19Z","domain":"www.wikidata.org","stream":"mediawiki.revision-create"},"dt":"2023-01-12T00:32:19Z"}	revision-create	1809649627	newer_revision_seen	1785111610	DELETED	true	{"project_class":"wikidata","project":"-","qualifiers":[],"tld":"org","project_family":"wikidata"}	codfw	2023	1	12	0
NULL	{"uri":null,"request_id":null,"id":"a98d0811-9d1c-45b8-b139-0d39afc06d18","dt":"2023-01-12T00:42:09.402992Z","domain":"www.wikidata.org","stream":"rdf-streaming-updater.state-inconsistency"}	Q115608572	2023-01-12T00:42:09.402405Z	2023-01-12T00:39:52.536Z	1809653947	{"_schema":null,"meta":{"uri":null,"request_id":"d019b288-3a13-4024-a934-3d4db9b63852","id":"e876202c-be0d-4894-87d0-fab7fc1893a8","dt":"2023-01-12T00:39:52Z","domain":"www.wikidata.org","stream":"mediawiki.revision-create"},"dt":"2023-01-12T00:39:52Z"}	revision-create	1809653618	newer_revision_seen	1785111610	DELETED	true	{"project_class":"wikidata","project":"-","qualifiers":[],"tld":"org","project_family":"wikidata"}	codfw	2023	1	12	0
NULL	{"uri":null,"request_id":null,"id":"f0e648e0-59b1-4569-b62e-c111e75cc178","dt":"2023-01-12T00:42:09.406318Z","domain":"www.wikidata.org","stream":"rdf-streaming-updater.state-inconsistency"}	Q115608572	2023-01-12T00:42:09.406068Z	2023-01-12T00:39:56.528Z	1809653984	{"_schema":null,"meta":{"uri":null,"request_id":"313b92c9-500e-4b1d-8feb-913ed2ce7098","id":"6a746531-76a0-48ff-954f-33c118b6cdc9","dt":"2023-01-12T00:39:56Z","domain":"www.wikidata.org","stream":"mediawiki.revision-create"},"dt":"2023-01-12T00:39:56Z"}	revision-create	1809653947	newer_revision_seen	1785111610	DELETED	true	{"project_class":"wikidata","project":"-","qualifiers":[],"tld":"org","project_family":"wikidata"}	codfw	2023	1	12	0
NULL	{"uri":null,"request_id":null,"id":"130d0162-65ba-4bd7-be5d-4828ce278e09","dt":"2023-01-12T00:26:47.884125Z","domain":"www.wikidata.org","stream":"rdf-streaming-updater.state-inconsistency"}	Q115608572	2023-01-12T00:26:47.883671Z	2023-01-12T00:24:46.864Z	1809646313	{"_schema":null,"meta":{"uri":null,"request_id":"883d110b-61ba-43c1-b510-82a62b5c5cd4","id":"2052e478-bc42-44b3-870a-a276975b96ce","dt":"2023-01-12T00:24:46Z","domain":"www.wikidata.org","stream":"mediawiki.revision-create"},"dt":"2023-01-12T00:24:46Z"}	revision-create	1809645267	newer_revision_seen	1785111610	DELETED	true	{"project_class":"wikidata","project":"-","qualifiers":[],"tld":"org","project_family":"wikidata"}	codfw	2023	1	12	0
NULL	{"uri":null,"request_id":null,"id":"79900880-73f1-40cb-9691-e59d1cd1ef8d","dt":"2023-01-12T00:21:02.246341Z","domain":"www.wikidata.org","stream":"rdf-streaming-updater.state-inconsistency"}	Q115608572	2023-01-12T00:21:02.246120Z	2023-01-12T00:18:54.174Z	1785111610	{"_schema":null,"meta":{"uri":null,"request_id":"ab00575f-7a12-43cb-9f73-a50bf7e98540","id":"f2cee9ac-db27-4393-9978-985b14db0c29","dt":"2023-01-12T00:18:53Z","domain":"www.wikidata.org","stream":"mediawiki.revision-create"},"dt":"2023-01-12T00:18:53Z"}	revision-create	1785108184	newer_revision_seen	1785111610	DELETED	true	{"project_class":"wikidata","project":"-","qualifiers":[],"tld":"org","project_family":"wikidata"}	codfw	2023	1	12	0
NULL	{"uri":null,"request_id":null,"id":"242e1923-36a9-4bf1-8104-d9d737427082","dt":"2023-01-12T00:41:42.180087Z","domain":"www.wikidata.org","stream":"rdf-streaming-updater.state-inconsistency"}	Q115608572	2023-01-12T00:41:42.179762Z	2023-01-12T00:39:36.675Z	1809653618	{"_schema":null,"meta":{"uri":null,"request_id":"8426bbf9-8bae-4d03-8ab7-368c387b4fb3","id":"0fe708d9-21b3-436b-b8e8-59cdfa266abc","dt":"2023-01-12T00:39:36Z","domain":"www.wikidata.org","stream":"mediawiki.revision-create"},"dt":"2023-01-12T00:39:36Z"}	revision-create	1809653202	newer_revision_seen	1785111610	DELETED	true	{"project_class":"wikidata","project":"-","qualifiers":[],"tld":"org","project_family":"wikidata"}	codfw	2023	1	12	0
NULL	{"uri":null,"request_id":null,"id":"b1bab8e7-2941-4a50-b719-934d91eb6e0d","dt":"2023-01-12T00:40:42.860127Z","domain":"www.wikidata.org","stream":"rdf-streaming-updater.state-inconsistency"}	Q115608572	2023-01-12T00:40:42.859739Z	2023-01-12T00:38:38.662Z	1809653202	{"_schema":null,"meta":{"uri":null,"request_id":"e70af5d6-6fde-4de7-9438-c216d0ec4e11","id":"ff9c5ed9-4a98-4a90-b683-98c588539072","dt":"2023-01-12T00:38:38Z","domain":"www.wikidata.org","stream":"mediawiki.revision-create"},"dt":"2023-01-12T00:38:38Z"}	revision-create	1809652184	newer_revision_seen	1785111610	DELETED	true	{"project_class":"wikidata","project":"-","qualifiers":[],"tld":"org","project_family":"wikidata"}	codfw	2023	1	12	0
Time taken: 0.253 seconds, Fetched: 14 row(s)

So events are properly flowing in the rdf-streaming-updater.state-inconsistency stream.

The reconcile batch job seems the one to blame, it reports:
23/01/12 03:29:25 INFO ReconcileCollector: Collected 0 inconsistencies from event.rdf_streaming_updater_state_inconsistency/datacenter=eqiad/year=2023/month=1/day=12/hour=0

While clearly there was entries in this table...

Change 887375 had a related patch set uploaded (by DCausse; author: DCausse):

[wikidata/query/rdf@master] UpdaterReconcile: reconcile newer_revision_seen inconsistencies

https://gerrit.wikimedia.org/r/887375

Change 887375 merged by jenkins-bot:

[wikidata/query/rdf@master] UpdaterReconcile: reconcile newer_revision_seen inconsistencies

https://gerrit.wikimedia.org/r/887375

Change 887745 had a related patch set uploaded (by DCausse; author: DCausse):

[wikidata/query/rdf@master] streaming-updater: specifically detect missed undelete events

https://gerrit.wikimedia.org/r/887745

Change 887745 merged by jenkins-bot:

[wikidata/query/rdf@master] streaming-updater: specifically detect missed undelete events

https://gerrit.wikimedia.org/r/887745

Change 887975 had a related patch set uploaded (by DCausse; author: DCausse):

[wikimedia/discovery/analytics@master] rdf-spark-tools: bump to version 0.3.120

https://gerrit.wikimedia.org/r/887975

Mentioned in SAL (#wikimedia-operations) [2023-02-09T14:14:00Z] <dcausse> T329089: re-playing detected inconsistencies (missing mediawiki.page-undelete events) from 2022-10-31 to 2023-02-07 to WDQS

Q115608572 was restored after applying the fix, items that were not edited after being undeleted will sadly remain absent from WDQS until an edit is made or after a full reload.

Change 887975 merged by jenkins-bot:

[wikimedia/discovery/analytics@master] rdf-spark-tools: bump to version 0.3.120

https://gerrit.wikimedia.org/r/887975

Mentioned in SAL (#wikimedia-operations) [2023-02-09T14:25:57Z] <dcausse@deploy1002> Started deploy [wikimedia/discovery/analytics@dc3cd56]: T329089: proper reconciliation of missed page-undelete events

Mentioned in SAL (#wikimedia-operations) [2023-02-09T14:46:45Z] <dcausse@deploy1002> Finished deploy [wikimedia/discovery/analytics@dc3cd56]: T329089: proper reconciliation of missed page-undelete events (duration: 20m 48s)

Mentioned in SAL (#wikimedia-operations) [2023-02-09T16:36:34Z] <dcausse@deploy1002> Started deploy [wikimedia/discovery/analytics@caf4808]: T329089: proper reconciliation of missed page-undelete events

Mentioned in SAL (#wikimedia-operations) [2023-02-09T16:38:58Z] <dcausse@deploy1002> Finished deploy [wikimedia/discovery/analytics@caf4808]: T329089: proper reconciliation of missed page-undelete events (duration: 02m 24s)