Skip to content

Commit

Permalink
fix hangs create and restore when CLICKHOUSE_MAX_CONNECTIONS=0, fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Slach committed Jun 19, 2024
1 parent 7e84f9f commit 7707ecd
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# v2.5.15
BUG FIXES
- fix hangs `create` and `restore` when CLICKHOUSE_MAX_CONNECTIONS=0, fix [933](https://github.com/Altinity/clickhouse-backup/issues/933)

# v2.5.14
IMPROVEMENTS
- add http_send_timeout=300, http_receive_timeout=300 to embedded backup/restore operations
Expand Down
6 changes: 5 additions & 1 deletion ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,12 @@ A more detailed description is available here: https://www.youtube.com/watch?v=m

## Default Config

By default, the config file is located at `/etc/clickhouse-backup/config.yml`, but it can be redefined via the `CLICKHOUSE_BACKUP_CONFIG` environment variable.
By default, the config file is located at `/etc/clickhouse-backup/config.yml`, but it can be redefined via the `CLICKHOUSE_BACKUP_CONFIG` environment variable or via `--config` command line parameter.
All options can be overwritten via environment variables.
Use `clickhouse-backup default-config` to print default config.

## Explain config parameters
following values is not default, it just explain which each config parameter actually means
Use `clickhouse-backup print-config` to print current config.

```yaml
Expand Down
2 changes: 1 addition & 1 deletion pkg/backup/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ func (b *Backuper) createBackupLocal(ctx context.Context, backupName, diffFromRe
var backupDataSize, backupObjectDiskSize, backupMetadataSize uint64
var metaMutex sync.Mutex
createBackupWorkingGroup, createCtx := errgroup.WithContext(ctx)
createBackupWorkingGroup.SetLimit(b.cfg.ClickHouse.MaxConnections)
createBackupWorkingGroup.SetLimit(max(b.cfg.ClickHouse.MaxConnections,1))

var tableMetas []metadata.TableTitle
for tableIdx, tableItem := range tables {
Expand Down
2 changes: 1 addition & 1 deletion pkg/backup/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -1196,7 +1196,7 @@ func (b *Backuper) restoreDataRegular(ctx context.Context, backupName string, ba
return fmt.Errorf("%s is not created. Restore schema first or create missing tables manually", strings.Join(missingTables, ", "))
}
restoreBackupWorkingGroup, restoreCtx := errgroup.WithContext(ctx)
restoreBackupWorkingGroup.SetLimit(b.cfg.ClickHouse.MaxConnections)
restoreBackupWorkingGroup.SetLimit(max(b.cfg.ClickHouse.MaxConnections,1))

for i := range tablesForRestore {
tableRestoreStartTime := time.Now()
Expand Down

0 comments on commit 7707ecd

Please sign in to comment.