From 5603397f701a8d185752b4acf92f99f28ff9f2ce Mon Sep 17 00:00:00 2001 From: suguanYang Date: Sat, 28 Nov 2026 21:36:23 -0700 Subject: [PATCH] Raise production lexical indexing input limit --- deploy/ecs/render_task_definitions.py | 8 +++++--- deploy/ecs/test_render_task_definitions.py | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/deploy/ecs/render_task_definitions.py b/deploy/ecs/render_task_definitions.py index 956cb1534..9c914c107 100644 --- a/deploy/ecs/render_task_definitions.py +++ b/deploy/ecs/render_task_definitions.py @@ -231,8 +231,8 @@ def render_template(template_path: Path, output_path: Path, variables: dict[str, configure_staging_opensearch(rendered, variables) configure_production_opensearch(rendered, variables) qstash_base_url: str = variables.get("QSTASH_BASE_URL", "") - is_staging: bool = variables.get("DEPLOYMENT_ENVIRONMENT") == "staging" - if qstash_base_url or is_staging: + deployment_environment: str = variables.get("DEPLOYMENT_ENVIRONMENT", "") + if qstash_base_url or deployment_environment in ("staging", "prod"): if not isinstance(rendered, dict): raise ValueError("Task definition must be an object") containers: object = rendered.get("containerDefinitions") @@ -246,8 +246,10 @@ def render_template(template_path: Path, output_path: Path, variables: dict[str, raise ValueError("Task container must contain environment entries") if qstash_base_url: environment.append({"name": "QSTASH_BASE_URL", "value": qstash_base_url}) - if is_staging and container.get("name") == "api": + if deployment_environment == "staging" and container.get("name") == "api": environment.append({"name": "DB_POOL_RECYCLE", "value": "-1"}) + if deployment_environment == "prod": + environment.append({"name": "KNOWHERE_INDEXING_MAXIMUM_UNIT_CHARACTERS", "value": "1048576"}) validate_rendered_definition(rendered) output_path.parent.mkdir(parents=True, exist_ok=True) output_path.write_text(json.dumps(rendered, indent=2) + "\n", encoding="utf-8") diff --git a/deploy/ecs/test_render_task_definitions.py b/deploy/ecs/test_render_task_definitions.py index 0a7c11121..987fb0ad0 100644 --- a/deploy/ecs/test_render_task_definitions.py +++ b/deploy/ecs/test_render_task_definitions.py @@ -272,6 +272,7 @@ def test_staging_templates_preserve_expected_staging_configuration( for name, value in expected_environment.items(): assert environment_values[name] == value + assert "KNOWHERE_INDEXING_MAXIMUM_UNIT_CHARACTERS" not in environment_values def test_staging_worker_preserves_evidence_selected_capacity(tmp_path: Path) -> None: @@ -377,6 +378,7 @@ def test_production_cli_renders_the_backend_read_by_the_release( environment = {item["name"]: item["value"] for item in container["environment"]} secrets = {item["name"]: item["valueFrom"] for item in container["secrets"]} assert environment["KNOWHERE_LEXICAL_BACKEND"] == backend + assert environment["KNOWHERE_INDEXING_MAXIMUM_UNIT_CHARACTERS"] == "1048576" assert environment["KNOWHERE_OPENSEARCH_URL"] == PRODUCTION_OPENSEARCH["PROD_OPENSEARCH_URL"] assert environment["KNOWHERE_OPENSEARCH_INDEX_PREFIX"] == "knowhere-prod-lexical-v1" assert (environment["KNOWHERE_OPENSEARCH_OPEN_INDEX_LIMIT"], environment["KNOWHERE_OPENSEARCH_IDLE_HIGH_WATERMARK"], @@ -399,6 +401,7 @@ def test_production_cli_without_opensearch_keeps_the_postgresql_default( environment = {item["name"]: item["value"] for item in container["environment"]} secrets = {item["name"]: item["valueFrom"] for item in container["secrets"]} assert "KNOWHERE_LEXICAL_BACKEND" not in environment + assert environment["KNOWHERE_INDEXING_MAXIMUM_UNIT_CHARACTERS"] == "1048576" assert "KNOWHERE_PROD_NATIVE_TLS" not in secrets