Page MenuHomePhabricator

[Iceberg Migration] Extend Iceberg table maintenance mechanism to support multiple Airflow instances
Closed, ResolvedPublic

Description

In T338065: [Iceberg Migration] Implement mechanism for automatic Iceberg table maintenance we developed a mechanism that can do typical table maintenance for Iceberg table.

However, we limited support to the Analytics Airflow instance to control the scope of that task.

In this task, we should extend this mechanism to support all the other Airflow instances.

Teams that can benefit from this:

  • Research. (No ticket yet)
  • Structured data (This team no longer exists).
  • Perhaps for any iceberg dataset currently running on platform_eng ?
  • Product Analytics (For T391135 and future use cases).
  • WMDE (Draft MR adding all their Iceberg assets. T412808 and T412809)

Details

Related Changes in GitLab:
TitleReferenceAuthorSource BranchDest Branch
Add Iceberg maintenance DAG and Spark 3.3.2 defaults for all instances having iceberg datasetsrepos/data-engineering/airflow-dags!1992ebysanswmde_table_maintenancemain
Support Multi-Instance Iceberg table maintenancerepos/data-engineering/airflow-dags!1977ebysansmulti_instance_maintenance_icebergmain
Customize query in GitLab

Event Timeline

As part of T370898: [L] Track commons deletion requests the structured data team will be needing support for automatic table maintenance for their new Iceberg table.

Considering the table will be ~1M rows, and thus relatively small, the availability of this mechanism should not block going into production. However, we should make this mechanism available to them ASAP so that the performance of their lambda architecture doesn't degrade over time.

CC @Ahoelzl

So, now that T383931 has been completed, what else is there that should be done with regards to this ticket? We now do have all the Iceberg table maintenance configuration available in a single file shared by all instances, plus the actual maintenance DAG that reads this configuration and executes on it is running in our main instance and takes care of all configured tables.

So, now that T383931 has been completed, what else is there that should be done with regards to this ticket? We now do have all the Iceberg table maintenance configuration available in a single file shared by all instances, plus the actual maintenance DAG that reads this configuration and executes on it is running in our main instance and takes care of all configured tables.

Roughly, we have to:

  • Move the table_maintenance DAG to wmf_airflow_common
  • Modify DAG code to be aware of the instance it is being run on.
  • Make it so that each instance runs table maintenance for the tables that its service user owns. So, say, the research Airflow instance (which is run with the analytics_research service user) would run maintenance for all of their tables, and no other. So we will filter the datasets.yaml by the produced_by tag.

ebysans merged https://gitlab.wikimedia.org/repos/data-engineering/airflow-dags/-/merge_requests/1992

Add Iceberg maintenance DAG and Spark 3.3.2 defaults for all instances having iceberg datasets