Skip to content

Add message_queue_disable_insertion - #104911

Merged
kssenii merged 12 commits into
ClickHouse:masterfrom
JiaQiTang98:kafka-disable-streaming
May 26, 2026
Merged

kssenii merged 12 commits into
ClickHouse:masterfrom
JiaQiTang98:kafka-disable-streaming

Conversation

@JiaQiTang98

@JiaQiTang98 JiaQiTang98 commented May 14, 2026 •

Copy link
Copy Markdown
Contributor

Changelog category (leave one):

  • New Feature

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Add message_queue_disable_insertion server setting to disable insertion from message queue engines (Kafka, RabbitMQ, NATS) into attached materialized views. Useful for read-only replica scenarios.

Why: Previously, read-only nodes could rely on the disable_insertion_and_mutation server setting to block data ingestion from Kafka tables. After ClickHouse PR #88549, disable_insertion_and_mutation no longer provides this functionality. To support read-only nodes, the new server setting message_queue_disable_insertion has been added to enable blocking data ingestion from Kafka tables.

@clickhouse-gh

clickhouse-gh Bot commented May 14, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [7ce00f2]

Summary: ✅


AI Review

Summary

This PR adds message_queue_disable_insertion as a reloadable server setting, applies it in InterpreterInsertQuery::execute only for message-queue internal streaming (no_destination path), and adds integration coverage for Kafka/RabbitMQ plus a non-regression check for S3Queue. I reviewed the current diff and all prior discussion threads; previously raised issues are addressed, and I did not find remaining correctness, safety, or performance concerns.

Final Verdict
  • Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-feature Pull request with new product feature label May 14, 2026
Comment thread src/Core/ServerSettings.cpp Resolved
@JiaQiTang98
JiaQiTang98 marked this pull request as draft May 15, 2026 10:38
@JiaQiTang98
JiaQiTang98 marked this pull request as ready for review May 16, 2026 09:07
@JiaQiTang98
JiaQiTang98 requested a review from kssenii May 16, 2026 10:26
@kssenii kssenii self-assigned this May 16, 2026
@alexey-milovidov

Copy link
Copy Markdown
Member

This was fixed by #105146. Let's update the branch.

@clickhouse-gh

clickhouse-gh Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 84.10% 84.10% +0.00%
Functions 91.40% 91.40% +0.00%
Branches 76.60% 76.60% +0.00%

Changed lines: 96.67% (29/30) | lost baseline coverage: 28 line(s) · Uncovered code

Full report · Diff report

@kssenii
kssenii added this pull request to the merge queue May 26, 2026
Merged via the queue into ClickHouse:master with commit e9aad78 May 26, 2026
166 of 167 checks passed
@clickgapai

Copy link
Copy Markdown
Contributor

Hi @JiaQiTang98 — a quick suggestion to make this PR easier for reviewers and the changelog reader.

Description (currently incomplete):

  • Why: The PR body is effectively empty (no description beyond the template). While the changelog entry is good, the body should explain the motivation and design decisions.

  • Suggested addition:

    This setting is useful for read-only replica scenarios where the server should not consume messages from external queues into materialized views, but direct writes to the queues (INSERT INTO kafka_table) should still be allowed. When enabled, the streaming background task throws QUERY_IS_PROHIBITED and reschedules, similar to how s3queue_disable_streaming works for S3Queue.

Ignore this if the current title/body is intentional.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-feature Pull request with new product feature pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants