Skip to content

Commit

Permalink
Do not perform multiple source reindexes simultaneously
Browse files Browse the repository at this point in the history
  • Loading branch information
stacimc committed Feb 14, 2024
1 parent 547ace1 commit a5014aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion catalog/dags/common/elasticsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,9 @@ def trigger_and_wait_for_reindex(
es_host: str,
max_docs: int | None = None,
slices: Union[int, Literal["auto"]] = "auto",
max_active_tis_per_dagrun: int | None = None,
):
@task
@task(max_active_tis_per_dagrun=max_active_tis_per_dagrun)
def trigger_reindex(
es_host: str,
destination_index: str,
Expand Down Expand Up @@ -162,6 +163,7 @@ def _wait_for_reindex(task_id: str, expected_docs: int, es_host: str):
"expected_docs": max_docs,
"es_host": es_host,
},
max_active_tis_per_dagrun=max_active_tis_per_dagrun,
)

trigger_reindex_task >> wait_for_reindex
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ def create_proportional_by_source_staging_index():
# not work reliably and the final proportions may be incorrect.
slices=None,
es_host=es_host,
max_active_tis_per_dagrun=1,
).expand_kwargs(desired_source_counts)

point_alias = es.point_alias(
Expand Down

0 comments on commit a5014aa

Please sign in to comment.