Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion infra/openstack/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ variable "bootstrap_healthcheck_path" {
variable "bootstrap_waitress_threads" {
type = number
description = "VON_WAITRESS_THREADS value written to the managed environment file."
default = 16
default = 32

validation {
condition = var.bootstrap_waitress_threads >= 4 && var.bootstrap_waitress_threads <= 256
Expand Down
57 changes: 54 additions & 3 deletions src/backend/db/mongo_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -990,9 +990,9 @@ def _fallback_candidate(
)


def _try_preferred_fallback_candidate() -> (
tuple[_MongoConnectionCandidate | None, bool]
):
def _try_preferred_fallback_candidate() -> tuple[
_MongoConnectionCandidate | None, bool
]:
"""Build, but do not publish, a client for the recent fallback route."""

preferred_kind = _preferred_fallback_kind
Expand Down Expand Up @@ -2098,6 +2098,57 @@ def _ensure_chat_prompt_queue_indexes(coll: Collection) -> None:
],
name="scope_session_status_created_at",
)
if "active_conversation_key_unique" not in existing_indexes:
coll.create_index(
[("active_conversation_key", ASCENDING)],
name="active_conversation_key_unique",
unique=True,
partialFilterExpression={
"active_conversation_key": {"$exists": True, "$type": "string"}
},
)
if "queued_global_slot_unique" not in existing_indexes:
coll.create_index(
[("queued_global_slot", ASCENDING)],
name="queued_global_slot_unique",
unique=True,
partialFilterExpression={"queued_global_slot": {"$exists": True}},
)
if "queued_user_slot_unique" not in existing_indexes:
coll.create_index(
[("queued_user_slot", ASCENDING)],
name="queued_user_slot_unique",
unique=True,
partialFilterExpression={"queued_user_slot": {"$exists": True}},
)
if "conversation_status_created_queue" not in existing_indexes:
coll.create_index(
[
("conversation_key", ASCENDING),
("status", ASCENDING),
("created_at", ASCENDING),
("queue_id", ASCENDING),
],
name="conversation_status_created_queue",
)
if "user_status_created_at" not in existing_indexes:
coll.create_index(
[
("user_concept_id", ASCENDING),
("status", ASCENDING),
("created_at", ASCENDING),
],
name="user_status_created_at",
)
if "request_user_namespace" not in existing_indexes:
coll.create_index(
[
("client_request_id", ASCENDING),
("user_concept_id", ASCENDING),
("namespace", ASCENDING),
],
name="request_user_namespace",
)
if "updated_at_-1" not in existing_indexes:
coll.create_index([("updated_at", DESCENDING)], name="updated_at_-1")

Expand Down
Loading
Loading