ClickHouse / ClickHouse/ClickHouse

A `ddl_mode` setting for the `Remote` and `Cluster` database engines

Open
#114,412 0 comments 0 reactions 0 assignees View on GitHub
comp-database-engines feature
Dominant language
C++
Stars
49.9k
Forks
9k
Avg merge
21h 32m
Merged PRs (30d)
515

Description

A follow-up to the `Remote` database engine (https://github.com/ClickHouse/ClickHouse/issues/59304, implemented in https://github.com/ClickHouse/ClickHouse/pull/110975).

Add a database engine setting `ddl_mode` with two options, `readonly` and `direct`, for the `Remote` database engine (and the upcoming `Cluster` database engine, https://github.com/ClickHouse/ClickHouse/issues/114411):

- `readonly` — the current behavior: DDL statements against the database are rejected, the database is a read-through view of the remote server.
- `direct` — DDL operations such as `CREATE TABLE`, `DROP TABLE`, `RENAME TABLE`, `ALTER`, etc. are forwarded to the remote server or cluster and executed there.

```sql
CREATE DATABASE db ENGINE = Remote('host:port', 'database', 'user', 'password') SETTINGS ddl_mode = 'direct';
```

Related: https://github.com/ClickHouse/ClickHouse/issues/59304
Related: https://github.com/ClickHouse/ClickHouse/pull/110975
Related: https://github.com/ClickHouse/ClickHouse/issues/114411

Contributor guide

Open the contributing guide

Research direction

Start with the existing Remote database engine implementation and the behavior described in issue #59304 and PR #110975; compare the upcoming Cluster engine in issue #114411. Trace how database settings and DDL rejection are handled, then verify that readonly preserves current rejection while direct forwards the listed DDL operations to the remote server or cluster.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, sql
Domain
databases, distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.