Skip to content

fix(identity): async_insert for profile_aliases writes - #323

Merged
ayushjhanwar-png merged 1 commit into
mainfrom
fix/alias-async-insert
Jun 17, 2026
Merged

fix(identity): async_insert for profile_aliases writes#323
ayushjhanwar-png merged 1 commit into
mainfrom
fix/alias-async-insert

Conversation

@ayushjhanwar-png

Copy link
Copy Markdown

Follow-up to #322.

Problem: upsertAlias writes one row per sign-in batch (the proxy re-emits per batch). Verified prod CLICKHOUSE_SETTINGS and the CH server default both have async_insert=0 — so these are synchronous single-row inserts. At dashreels scale (~88% signed-in) that piles up parts on the single-partition ReplicatedReplacingMergeTree and holds an API request open per insert.

Fix: set async_insert=1, wait_for_async_insert=0 on this insert only, so ClickHouse coalesces them server-side (~1 part/sec). Scoped to the alias write; nothing else changes.

Gates the prod deploy of the identity-merge write path.

upsertAlias inserts one row per sign-in batch (the proxy re-emits per
batch). Prod CLICKHOUSE_SETTINGS and the CH server default both have
async_insert=0, so these were synchronous single-row inserts — at scale
that piles up parts on the single-partition ReplacingMergeTree and ties up
an API request per insert.

Set async_insert=1, wait_for_async_insert=0 on this insert specifically so
ClickHouse coalesces them server-side (~1 part/sec). Scoped to the alias
write only; nothing else changes.
@ayushjhanwar-png
ayushjhanwar-png merged commit a9e7d01 into main Jun 17, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant