Skip to content

Commit

Permalink
added clickhouse-server:24.3 to CI/CD pipelines, fix ClickHouse/Cli…
Browse files Browse the repository at this point in the history
  • Loading branch information
Slach committed Mar 29, 2024
1 parent 594da6d commit fc8ab15
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ jobs:
- '22.8'
- '23.3'
- '23.8'
# wait when resolve https://github.com/ClickHouse/ClickHouse/issues/62018
# - '24.3'
- '24.3'
steps:
- name: Setup golang
id: setup-go
Expand Down Expand Up @@ -236,8 +235,7 @@ jobs:
- '22.8'
- '23.3'
- '23.8'
# wait when resolve https://github.com/ClickHouse/ClickHouse/issues/62018
# - '24.3'
- '24.3'
steps:
- name: Checkout project
uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ IMPROVEMENTS
- added support of native Clickhouse incremental backup for `use_embedded_backup_restore: true` fix [735](https://github.com/Altinity/clickhouse-backup/issues/735)
- added `GCS_CHUNK_SIZE` config parameter, try to speedup GCS upload fix [874](https://github.com/Altinity/clickhouse-backup/pull/874), thanks @dermasmid
- switched to golang 1.22
- added `clickhouse/clickhouse-server:24.3` to CI/CD

BUG FIXES
- continue `S3_MAX_PARTS_COUNT` default value from `2000` to `4000` to continue decrease memory usage for S3
Expand Down
12 changes: 9 additions & 3 deletions pkg/clickhouse/clickhouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,13 +251,15 @@ func (ch *ClickHouse) getDisksFromSystemDisks(ctx context.Context) ([]Disk, erro
return nil, ctx.Err()
default:
type DiskFields struct {
DiskTypePresent uint64 `ch:"is_disk_type_present"`
FreeSpacePresent uint64 `ch:"is_free_space_present"`
StoragePolicyPresent uint64 `ch:"is_storage_policy_present"`
DiskTypePresent uint64 `ch:"is_disk_type_present"`
ObjectStorageTypePresent uint64 `ch:"is_object_storage_type_present"`
FreeSpacePresent uint64 `ch:"is_free_space_present"`
StoragePolicyPresent uint64 `ch:"is_storage_policy_present"`
}
diskFields := make([]DiskFields, 0)
if err := ch.SelectContext(ctx, &diskFields,
"SELECT countIf(name='type') AS is_disk_type_present, "+
"countIf(name='object_storage_type') AS is_object_storage_type_present, "+
"countIf(name='free_space') AS is_free_space_present, "+
"countIf(name='disks') AS is_storage_policy_present "+
"FROM system.columns WHERE database='system' AND table IN ('disks','storage_policies') ",
Expand All @@ -268,6 +270,10 @@ func (ch *ClickHouse) getDisksFromSystemDisks(ctx context.Context) ([]Disk, erro
if len(diskFields) > 0 && diskFields[0].DiskTypePresent > 0 {
diskTypeSQL = "any(d.type)"
}
if len(diskFields) > 0 && diskFields[0].ObjectStorageTypePresent > 0 {
diskTypeSQL = "any(lower(if(d.type='ObjectStorage',d.object_storage_type,d.type)))"
}

diskFreeSpaceSQL := "toUInt64(0)"
if len(diskFields) > 0 && diskFields[0].FreeSpacePresent > 0 {
diskFreeSpaceSQL = "min(d.free_space)"
Expand Down

0 comments on commit fc8ab15

Please sign in to comment.