Skip to content

async inserts article refresh - #192

Open
lesandie wants to merge 1 commit into
mainfrom
docs/refresh-async-inserts
Open

async inserts article refresh#192
lesandie wants to merge 1 commit into
mainfrom
docs/refresh-async-inserts

Conversation

@lesandie

@lesandie lesandie commented Sep 7, 2026

Copy link
Copy Markdown
Member

Refresh Async INSERTs knowledge base article

Updates the Async INSERTs article for current ClickHouse behavior and operational guidance.

Changes

  • Documents the 26.2.4 default enablement of async_insert.
  • Explains adaptive and fixed busy-timeout modes, including the async_insert_busy_timeout_ms alias.
  • Adds async_insert_threads configuration and background-pool monitoring guidance.
  • Documents per-table async-insert behavior and a SQL SECURITY DEFINER recipe for disabling async inserts in one materialized-view pipeline.
  • Restores async-insert metric discovery and current-pool queries.
  • Adds 26.x deduplication changes:
    • deduplicate_insert unifies synchronous and asynchronous insert deduplication.
    • Materialized-view deduplication compatibility limitations.
    • insert_deduplication_version migration stages, including the Keeper overhead of compatible_double_hashes.
    • Version progression from 26.2–26.5 through 26.7.

I have read the CLA Document and I hereby sign the CLA

@lesandie lesandie self-assigned this Sep 7, 2026
@lesandie
lesandie removed the request for review from hodgesrm September 7, 2026 14:46
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 7, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-07T14:52:53.633196Z b1759af PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b1759afef5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +85 to +87
CREATE USER mv_sync_definer
IDENTIFIED WITH no_password
SETTINGS PROFILE mv_sync_insert;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Prevent login as the passwordless definer

When the ClickHouse HTTP or native interface is reachable by untrusted clients, IDENTIFIED WITH no_password creates a credential-free login that receives SELECT on the source and INSERT on the destination. The security warning does not mitigate that exposure; make this an internal-only identity with HOST NONE, or require strong authentication and an explicit host restriction.

AGENTS.md reference: AGENTS.md:L122-L128

Useful? React with 👍 / 👎.

WHERE name = 'insert_deduplication_version';
```

Do not move directly from `old_separate_hashes` to `new_unified_hash`. First run `compatible_double_hashes` on every replica. For Replicated* tables, keep it for at least the largest effective `replicated_deduplication_window_seconds` (one hour by default). For non-replicated tables, run enough inserts to cover the count-based `non_replicated_deduplication_window`. Then change to `new_unified_hash`. This period lets ClickHouse record unified IDs for data that a client might still retry.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Correct the replicated deduplication window default

For installations that have not overridden replicated_deduplication_window_seconds, the documented default is 604800 seconds (seven days), not one hour. Following this parenthetical can therefore move replicas to new_unified_hash almost a week too early and allow retries of older inserts to bypass deduplication; state seven days and still direct operators to verify every table's effective setting.

AGENTS.md reference: AGENTS.md:L53-L55

Useful? React with 👍 / 👎.

Comment on lines +38 to +41
Set `async_insert_use_adaptive_busy_timeout = 0` to use a fixed busy timeout. In this mode, ClickHouse uses `async_insert_busy_timeout_max_ms`.

`async_insert_busy_timeout_ms` is an alias for `async_insert_busy_timeout_max_ms`, not a separate setting. You can use either name, but use `async_insert_busy_timeout_max_ms` in new
configurations.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Scope the fixed-timeout settings to ClickHouse 24.2+

On pre-24.2 releases, async_insert_busy_timeout_max_ms does not exist and async_insert_busy_timeout_ms is the actual timeout setting rather than its alias, so the shown fixed-mode recipe fails despite this article explicitly discussing earlier releases. Mark this section as 24.2+ and retain async_insert_busy_timeout_ms as the fallback for older versions.

AGENTS.md reference: AGENTS.md:L108-L111

Useful? React with 👍 / 👎.

Async INSERTs let ClickHouse® batch many small inserts in server memory before writing them to storage. Use them when clients cannot form sufficiently large batches themselves. Client-side batching remains preferable when you control the writers because it keeps buffering outside ClickHouse.

**Key Documentation:** [Official Async Inserts Documentation](https://clickhouse.com/docs/en/optimize/asynchronous-inserts)
Starting with the 26.2.4 release line, ClickHouse [enables async inserts by default](https://github.com/ClickHouse/ClickHouse/pull/97590). Earlier releases default to synchronous inserts. Set it explicitly in an ingestion user's profile when you need stable behavior across versions:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Qualify the pre-26.2 default for ClickHouse Cloud

For ClickHouse Cloud deployments, async inserts were already enabled by default before 26.2.4, so the unconditional statement that all earlier releases default to synchronous inserts gives Cloud operators an incorrect historical boundary. Scope the transition to the upstream/self-managed server default and note the earlier Cloud override.

AGENTS.md reference: AGENTS.md:L100-L108

Useful? React with 👍 / 👎.

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