Do not wait for reindex completion on filtered index creation #2980
Labels
💻 aspect: code
Concerns the software code in the repository
✨ goal: improvement
Improvement to an existing user-facing feature
🟨 priority: medium
Not blocking but should be addressed soon
🧱 stack: catalog
Related to the catalog and Airflow DAGs
🧱 stack: ingestion server
Related to the ingestion/data refresh server
🔧 tech: airflow
Involves Apache Airflow
🐍 tech: python
Involves Python
Problem
The filtered index creation has recently been throttled due to its affect on production API performance (#2975). This has extended the time it takes to complete the
create_and_populate_filtered_index
step, namely thereindex
call here:openverse/ingestion_server/ingestion_server/indexer.py
Lines 506 to 526 in 6cdf20b
The step appears to have a default timeout of 43200 seconds (12 hours) per a recent exception:
Description
We should remove the
wait_for_completion=True
parameter ofreindex
and instead wait on the task using Elasticsearch's task management API (or using existing alternative mechanisms the ingestion server might have at its disposal to do so). This will require adding steps in the create filtered media index DAG in order to wait on the step to complete before issuing therefresh
command (which ensures replicas exist). We may also need to add aREFRESH
action to the ingestion server API which can be called by Airflow once the reindex step is complete.Alternatives
We could alternatively override the
request_timeout
parameter available to all elasticsearch-py methods to a value greater than 43200. This could be a short-term workaround.Additional context
The text was updated successfully, but these errors were encountered: