Page MenuHomePhabricator

Move SpecialUnusedTemplates computation to Hadoop
Closed, ResolvedPublic

Description

See parent and current code.

Event Timeline

Ladsgroup triaged this task as Medium priority.Apr 7 2026, 8:40 AM
Ladsgroup edited projects, added: DBA; removed: Data-Persistence.
Ladsgroup moved this task from Triage to Ready on the DBA board.

Change #1276836 had a related patch set uploaded (by Zabe; author: Zabe):

[analytics/refinery@master] Add UnusedTemplates.hql

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

Change #1276836 merged by Xcollazo:

[analytics/refinery@master] querypage: Add UnusedTemplates.hql

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

@JAllemandou the DAG is failing, but only for commonswiki. Any idea why that is the case?

@JAllemandou the DAG is failing, but only for commonswiki. Any idea why that is the case?

I have reviewed some failure logs, and it seems that for commonswiki the job resources are too small.
I suggest you try growing the executor-memory to 8G, and the nubmer of maximum-executors to 64.
Here's an example of spark job resource settings in airflow: https://gitlab.wikimedia.org/repos/data-engineering/airflow-dags/-/blob/main/main/dags/api_requests/refine_api_requests_hourly_dag.py?ref_type=heads&plain=1

@JAllemandou the DAG is failing, but only for commonswiki. Any idea why that is the case?

I have reviewed some failure logs, and it seems that for commonswiki the job resources are too small.
I suggest you try growing the executor-memory to 8G, and the nubmer of maximum-executors to 64.
Here's an example of spark job resource settings in airflow: https://gitlab.wikimedia.org/repos/data-engineering/airflow-dags/-/blob/main/main/dags/api_requests/refine_api_requests_hourly_dag.py?ref_type=heads&plain=1

The patch has been deployed, but it looks like it is still OOMing.

@JAllemandou would it be reasonable to increase the quota further?

I have checked the job, and the problem is deeper than just memory resources.
The job was suffering from data-skew and Spark couldn't optimize it due to the way the query was written: doing a left outer join and filtering for null in the right table can't be optimized in Spark, while using LEFT ANTI JOIN does exactly that and can be optimized.
I'm sending a PR with that change, which in addition doesn't require resource bumping.

Change #1345865 had a related patch set uploaded (by Joal; author: Joal):

[analytics/refinery@master] Update querypage queries with join optimizations

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

One more note: I have paused the airflow job to prevent alerts to be sent while testing. Let's not forget to unpause it after we merge the patch.

Change #1345865 merged by Joal:

[analytics/refinery@master] Update querypage queries with join optimizations

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

Change #1353155 had a related patch set uploaded (by Zabe; author: Zabe):

[operations/mediawiki-config@master] Use Hadoop for UnusedTemplates on commonswiki

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

Change #1353155 merged by jenkins-bot:

[operations/mediawiki-config@master] Use Hadoop for UnusedTemplates on commonswiki

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

Mentioned in SAL (#wikimedia-operations) [2026-10-08T12:20:47Z] <zabe@deploy1003> Started scap sync-world: Backport for [[gerrit:1353155|Use Hadoop for UnusedTemplates on commonswiki (T422443)]]

Mentioned in SAL (#wikimedia-operations) [2026-10-08T12:24:43Z] <zabe@deploy1003> zabe: Backport for [[gerrit:1353155|Use Hadoop for UnusedTemplates on commonswiki (T422443)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2026-10-08T12:30:34Z] <zabe@deploy1003> Finished scap sync-world: Backport for [[gerrit:1353155|Use Hadoop for UnusedTemplates on commonswiki (T422443)]] (duration: 09m 47s)