Page MenuHomePhabricator

File Exports: Consider storing the exports in Ceph instead of HDFS
Closed, ResolvedPublic

Description

Summary

The File Exports use HDFS only as a staging area before hdfs_rsync_job copies them to the distribution hosts, but T437463 increases their HDFS retention to 170 days while HDFS storage is short (T437605). We should find out whether the Ceph cluster with the S3 gateway is a better place for them.

Technical notes

  • The exports are in /wmf/data/exports/mediawiki_content_history and /wmf/data/exports/mediawiki_content_current. The DAGs in main/dags/mediawiki/content/export/mw_content_xml_export_dags.py write them with MediawikiDumper, HdfsFileFingerprintWriter (SHA256SUMS) and MediawikiDumperSevenZipRecompressor (7z).
  • With 170 days, HDFS keeps 6 runs. One run is 9.1 to 9.3 TB logical. This is 81.5 to 83.4 TB on-disk with replication 3, or 1.6% of the cluster.
  • In airflow-dags, only the export DAGs use these paths. hdfs_rsync_job copies them to clouddumps1001 and clouddumps1002 (dumps::web::fetches::stats), and the distribution hosts, not HDFS, serve the files to users and mirrors. We must confirm that no other job reads them.
  • The three jobs use the Hadoop FileSystem API, so an s3a:// output path can be enough for the write side. We must check the wmf-binary output format and the 7z job with s3a.
  • hdfs-rsync reads only HDFS. The distribution hosts need another tool to copy from S3 (for example rclone or s5cmd), with the same --delete behavior.
  • The HDFS purge (refinery-drop-older-than in data_purge.pp) must change to an S3 lifecycle rule or a similar cleanup.

Acceptance criteria

  • Compare the storage cost and the work for HDFS and Ceph, and decide where to store the File Exports.
  • If the decision is Ceph, make a plan for the write path, the copy to the distribution hosts, and the retention.

Event Timeline

xcollazo renamed this task from MediaWiki Content File Exports: Consider storing the exports in Ceph instead of HDFS to File Exports: Consider storing the exports in Ceph instead of HDFS.Sep 30 2026, 2:21 PM

Here is a good Ceph use case. Let's get this to prod!

CC @BTullis and @JAllemandou.

I like that! We could even think of an API layer to dowload the files directly from CephS3, bypassing the copy altogether (but this is very much scope creep :)

Just a point of note:

We should find out whether the Ceph cluster with the S3 gateway (role::cephadm::rgw) is a better place for them.

The role::cephadm::rgw is not the DPE Ceph cluster.
This refers to the apus cluster that is operated by Data Persistence.

I didn't want to go chopping about the description without discussion first.

There are also a couple of other things that I'm not sure I agree with, but maybe I am misunderstanding something. Principally...

With 170 days, HDFS keeps 6 runs.

Why do we need to keep 6 runs on HDFS? Don't we just need to keep 1 run on HDFS, but 6 runs' worth on the two distribution servers (clouddumps100[1-2])?

I totally agree that in the long-term, we need to get these files off HDFS, even as an interim solution, which is what it is today.
So getting your spark job to write to S3 instead of HDFS would be great, but it is not the only solution. With dumps_v1 we use CephFS as the interim location, then we use rsync over SSH to push the dumps to the two clouddumps hosts, from within the Airflow DAG.

There are so many different ways that we could do this, and so many different storage technologies being discussed that I am concerned we might get our wires crossed.

The role::cephadm::rgw is not the DPE Ceph cluster.
This refers to the apus cluster that is operated by Data Persistence.

Please excuse the AI slop. I should have double checked that.

Why do we need to keep 6 runs on HDFS? Don't we just need to keep 1 run on HDFS, but 6 runs' worth on the two distribution servers (clouddumps100[1-2])?

In the current hdfs-rsync pattern, that utility itself takes care of deleting older data via the --delete flag. Let me see whether a different pattern would work better here.

xcollazo claimed this task.

With 170 days, HDFS keeps 6 runs. One run is 9.1 to 9.3 TB logical. This is 81.5 to 83.4 TB on-disk with replication 3, or 1.6% of the cluster.

This is not true anymore, as in T437463 we found an alternative to keep 2 runs in HDFS, thus the urgency to move away from HDFS for generation is much slower.

We still want to eventually move to Ceph, but I don't want to block XML dumps v1 sunsetting on this, thus closing this task.