Skip to content

Commit

Permalink
add CLICKHOUSE_MAX_CONNECTIONS config parameter to allow parallel e…
Browse files Browse the repository at this point in the history
…xecution `FREEZE` / `UNFREEZE`
  • Loading branch information
Slach committed Jan 23, 2024
1 parent 7f2d8a1 commit ac00bae
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# v2.4.20
IMPROVEMENTS
- refactoring of `create` command to allow parallel execution of `FREEZE` and `UNFREEZE` and table level parallelization `object_disk.CopyObject`
- add `CLICKHOUSE_MAX_CONNECTIONS` config parameter to allow parallel execution `FREEZE` / `UNFREEZE`

# v2.4.19
BUG FIXES
Expand Down
1 change: 1 addition & 0 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ clickhouse:
backup_mutations: true # CLICKHOUSE_BACKUP_MUTATIONS, allow backup mutations from system.mutations WHERE is_done AND apply it during restore
restore_as_attach: false # CLICKHOUSE_RESTORE_AS_ATTACH, allow restore tables which have inconsistent data parts structure and mutations in progress
check_parts_columns: true # CLICKHOUSE_CHECK_PARTS_COLUMNS, check data types from system.parts_columns during create backup to guarantee mutation is complete
max_connections: 0 # CLICKHOUSE_MAX_CONNECTIONS, how many parallel connections could be opened during operations
azblob:
endpoint_suffix: "core.windows.net" # AZBLOB_ENDPOINT_SUFFIX
account_name: "" # AZBLOB_ACCOUNT_NAME
Expand Down
4 changes: 2 additions & 2 deletions pkg/clickhouse/clickhouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ func (ch *ClickHouse) Connect() error {
"receive_timeout": int(timeout.Seconds()),
"send_timeout": int(timeout.Seconds()),
},
MaxOpenConns: 1,
ConnMaxLifetime: 0,
MaxOpenConns: ch.Config.MaxConnections,
ConnMaxLifetime: timeout,
MaxIdleConns: 0,
DialTimeout: timeout,
ReadTimeout: timeout,
Expand Down
1 change: 1 addition & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ type ClickHouseConfig struct {
TLSKey string `yaml:"tls_key" envconfig:"CLICKHOUSE_TLS_KEY"`
TLSCert string `yaml:"tls_cert" envconfig:"CLICKHOUSE_TLS_CERT"`
TLSCa string `yaml:"tls_ca" envconfig:"CLICKHOUSE_TLS_CA"`
MaxConnections int `yaml:"max_connections" envconfig:"CLICKHOUSE_MAX_CONNECTIONS"`
Debug bool `yaml:"debug" envconfig:"CLICKHOUSE_DEBUG"`
}

Expand Down

0 comments on commit ac00bae

Please sign in to comment.