Skip to content

Commit 99f6873

Browse files
authored
Merge pull request #843 from Altinity/v2.5
release v2.5
2 parents 2692ec8 + 67d2675 commit 99f6873

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+3033
-1586
lines changed

.github/workflows/build.yaml

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
matrix:
1818
golang-version:
19-
- "1.21"
19+
- "1.22"
2020
steps:
2121
- name: Checkout project
2222
uses: actions/checkout@v4
@@ -49,7 +49,7 @@ jobs:
4949
- name: Build clickhouse-backup binary
5050
id: make-race
5151
env:
52-
GOROOT: ${{ env.GOROOT_1_20_X64 }}
52+
GOROOT: ${{ env.GOROOT_1_22_X64 }}
5353
run: |
5454
make build/linux/amd64/clickhouse-backup build/linux/arm64/clickhouse-backup
5555
make build/linux/amd64/clickhouse-backup-fips build/linux/arm64/clickhouse-backup-fips
@@ -114,15 +114,24 @@ jobs:
114114
runs-on: ubuntu-22.04
115115
strategy:
116116
matrix:
117+
golang-version:
118+
- "1.22"
117119
clickhouse:
118120
- '22.3'
119121
- '22.8'
120122
- '23.3'
121123
- '23.8'
124+
- '24.3'
122125
steps:
123126
- name: Checkout project
124127
uses: actions/checkout@v4
125128

129+
- name: Setup golang
130+
id: setup-go
131+
uses: actions/setup-go@v5
132+
with:
133+
go-version: '^${{ matrix.golang-version }}'
134+
126135
- uses: actions/download-artifact@v4
127136
with:
128137
name: build-test-artifacts
@@ -181,9 +190,12 @@ jobs:
181190
tfs --debug --no-colors report results -a "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}/" ./test/testflows/raw.log - --confidential --copyright "Altinity LTD" --logo ./test/testflows/altinity.png | ~/venv/qa/bin/tfs --debug --no-colors document convert > ./test/testflows/report.html
182191
sudo chmod -Rv +rx test/testflows/clickhouse_backup/_instances
183192
- name: Format testflows coverage
193+
env:
194+
GOROOT: ${{ env.GOROOT_1_22_X64 }}
184195
run: |
185196
sudo chmod -Rv a+rw test/testflows/_coverage_/
186-
ls -la test/testflows/_coverage_
197+
ls -la test/testflows/_coverage_
198+
go env
187199
go tool covdata textfmt -i test/testflows/_coverage_/ -o test/testflows/_coverage_/coverage.out
188200
- name: Report testflows coverage
189201
uses: coverallsapp/github-action@v2
@@ -192,7 +204,7 @@ jobs:
192204
parallel: true
193205
format: golang
194206
flag-name: testflows-${{ matrix.clickhouse }}
195-
# todo wait when resolve https://github.com/actions/upload-artifact/issues/270 and uncomment
207+
# todo possible failures https://github.com/actions/upload-artifact/issues/270
196208
- name: Upload testflows logs
197209
uses: actions/upload-artifact@v4
198210
with:
@@ -211,7 +223,7 @@ jobs:
211223
strategy:
212224
matrix:
213225
golang-version:
214-
- "1.21"
226+
- "1.22"
215227
clickhouse:
216228
- '1.1.54394'
217229
- '19.17'
@@ -223,6 +235,7 @@ jobs:
223235
- '22.8'
224236
- '23.3'
225237
- '23.8'
238+
- '24.3'
226239
steps:
227240
- name: Checkout project
228241
uses: actions/checkout@v4
@@ -256,10 +269,12 @@ jobs:
256269
257270
- name: Running integration tests
258271
env:
272+
GOROOT: ${{ env.GOROOT_1_22_X64 }}
259273
CLICKHOUSE_VERSION: ${{ matrix.clickhouse }}
260-
# just options for advanced logging
261-
# RUN_TESTS: "TestFIPS"
274+
# options for advanced debug CI/CD
275+
# RUN_TESTS: "TestIntegrationGCS"
262276
# LOG_LEVEL: "debug"
277+
# GCS_DEBUG: "true"
263278
# SFTP_DEBUG: "true"
264279
# AZBLOB_DEBUG: "true"
265280
# FTP_DEBUG: "true"
@@ -303,6 +318,8 @@ jobs:
303318
docker-compose -f test/integration/${COMPOSE_FILE} ps -a
304319
go test -timeout 60m -failfast -tags=integration -run "${RUN_TESTS:-.+}" -v test/integration/integration_test.go
305320
- name: Format integration coverage
321+
env:
322+
GOROOT: ${{ env.GOROOT_1_22_X64 }}
306323
run: |
307324
sudo chmod -Rv a+rw test/integration/_coverage_/
308325
ls -la test/integration/_coverage_

.github/workflows/release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
matrix:
1414
golang-version:
15-
- "1.21"
15+
- "1.22"
1616

1717
steps:
1818
- name: Checkout project
@@ -55,7 +55,7 @@ jobs:
5555
- name: Prepare binaries
5656
id: make
5757
env:
58-
GOROOT: ${{ env.GOROOT_1_20_X64 }}
58+
GOROOT: ${{ env.GOROOT_1_22_X64 }}
5959
run: |
6060
make build build-fips config test
6161
#make build-fips-darwin

ChangeLog.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,39 @@
1+
# v2.5.0
2+
IMPROVEMENTS
3+
- complete removed support for legacy backups, created with version prior v1.0
4+
- removed `disable_progress_bar` config option and related progress bar code
5+
- added `--delete-source` parameter for `upload` and `create_remote` commands to explicitly delete local backup during upload, fix [777](https://github.com/Altinity/clickhouse-backup/issues/777)
6+
- added support for `--env ENV_NAME=value` cli parameter for allow dynamically override any config parameter, fix [821](https://github.com/Altinity/clickhouse-backup/issues/821)
7+
- added support for `use_embedded_backup_restore: true` with empty `embedded_backup_disk` value, tested on S3/GCS over S3/AzureBlobStorage, fix [695](https://github.com/Altinity/clickhouse-backup/issues/695)
8+
- `--rbac, --rbac-only, --configs, --configs-only` now works with `use_embedded_backup_restore: true`
9+
-- `--data` for `restore` with `use_embedded_backup_restore: true` will use `allow_non_empty_tables=true` to allow fix [756](https://github.com/Altinity/clickhouse-backup/issues/756)
10+
- added `--diff-from-remote` parameter for `create` command, will copy only new data parts object disk data, also allows to download properly object disk data from required backup during `restore`, fix [865](https://github.com/Altinity/clickhouse-backup/issues/865)
11+
- added support of native Clickhouse incremental backup for `use_embedded_backup_restore: true` fix [735](https://github.com/Altinity/clickhouse-backup/issues/735)
12+
- added `GCS_CHUNK_SIZE` config parameter, try to speedup GCS upload fix [874](https://github.com/Altinity/clickhouse-backup/pull/874), thanks @dermasmid
13+
- added `--remote-backup` cli parameter to `tables` command and `GET /backup/table`, fix [778](https://github.com/Altinity/clickhouse-backup/issues/778)
14+
- added `rbac_always_backup: true` option to default config, will create backup for RBAC objects automatically, restore still require `--rbac` to avoid destructive actions, fix [793](https://github.com/Altinity/clickhouse-backup/issues/793)
15+
- added `rbac_conflict_resolution: recreate` option for RBAC object name conflicts during restore, fix [851](https://github.com/Altinity/clickhouse-backup/issues/851)
16+
- added `upload_max_bytes_per_seconds` and `download_max_bytes_per_seconds` config options to allow throttling without CAP_SYS_NICE, fix [817](https://github.com/Altinity/clickhouse-backup/issues/817)
17+
- added `clickhouse_backup_in_progress_commands` metric, fix [836](https://github.com/Altinity/clickhouse-backup/issues/836)
18+
- switched to golang 1.22
19+
- updated all third-party SDK to latest versions
20+
- added `clickhouse/clickhouse-server:24.3` to CI/CD
21+
22+
BUG FIXES
23+
- continue `S3_MAX_PARTS_COUNT` default value from `2000` to `4000` to continue decrease memory usage for S3
24+
- changed minimal part size for multipart upload in CopyObject from `5Mb` to `10Mb`
25+
- restore SQL UDF functions after restore tables
26+
- execute `ALTER TABLE ... DROP PARTITION` instead of `DROP TABLE` for `restore` and `restore_remote` with parameters `--data --partitions=...`, fix [756](https://github.com/Altinity/clickhouse-backup/issues/756)
27+
- fix wrong behavior for `freeze_by_part` + `freeze_by_part_where`, fix [855](https://github.com/Altinity/clickhouse-backup/issues/855)
28+
- apply `CLICKHOUSE_SKIP_TABLES_ENGINES` during `create` command
29+
- fixed behavior for upload / download when .inner. table missing for MATERIALIZED VIEW by table pattern, fix [765](https://github.com/Altinity/clickhouse-backup/issues/765)
30+
- fixed `ObjectDisks` + `CLICKHOUSE_USE_EMBEDDED_BACKUP_RESTORE: true` - shall skip upload object disk content, fix [799](https://github.com/Altinity/clickhouse-backup/issues/799)
31+
- fixed connection to clickhouse-server behavior when long clickhouse-server startup time and `docker-entrypoint.d` processing, will infinite reconnect each 5 seconds, until success, fix [857](https://github.com/Altinity/clickhouse-backup/issues/857)
32+
- fixed `USE_EMBEDDED_BACKUP_RESTORE=true` behavior to allow use backup disk with type `local`, fix [882](https://github.com/Altinity/clickhouse-backup/issues/882)
33+
- fixed wrong list command behavior, it shall scann all system.disks path not only default disk to find pratially created backups, fix [873](https://github.com/Altinity/clickhouse-backup/issues/873)
34+
- fixed create `--rbac` behavior, don't create access folder if no RBAC objects is present
35+
- fixed behavior when `system.disks` contains disk which not present in any `storage_policies`, fix [845](https://github.com/Altinity/clickhouse-backup/issues/845)
36+
137
# v2.4.35
238
IMPROVEMENTS
339
- set part size for `s3:CopyObject` minimum 128Mb, look details https://repost.aws/questions/QUtW2_XaALTK63wv9XLSywiQ/s3-sync-command-is-slow-to-start-on-some-data

Dockerfile

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,22 @@ RUN rm -fv /etc/apt/sources.list.d/clickhouse.list && \
99
find /etc/apt/ -type f -name *.list -exec sed -i 's/ru.archive.ubuntu.com/archive.ubuntu.com/g' {} + && \
1010
( apt-get update || true ) && \
1111
apt-get install -y --no-install-recommends gnupg ca-certificates wget && update-ca-certificates && \
12-
for srv in "keyserver.ubuntu.com" "pool.sks-keyservers.net" "keys.gnupg.net"; do apt-key adv --keyserver $srv --recv-keys 52B59B1571A79DBC054901C0F6BC817356A3D45E; if [[ $? -eq 0 ]]; then break; fi; done && \
12+
for srv in "keyserver.ubuntu.com" "pool.sks-keyservers.net" "keys.gnupg.net"; do apt-key adv --keyserver $srv --recv-keys 52B59B1571A79DBC054901C0F6BC817356A3D45E; if [ $? -eq 0 ]; then break; fi; done && \
1313
DISTRIB_CODENAME=$(cat /etc/lsb-release | grep DISTRIB_CODENAME | cut -d "=" -f 2) && \
1414
echo ${DISTRIB_CODENAME} && \
1515
echo "deb https://ppa.launchpadcontent.net/longsleep/golang-backports/ubuntu ${DISTRIB_CODENAME} main" > /etc/apt/sources.list.d/golang.list && \
1616
echo "deb-src https://ppa.launchpadcontent.net/longsleep/golang-backports/ubuntu ${DISTRIB_CODENAME} main" >> /etc/apt/sources.list.d/golang.list && \
1717
( apt-get update || true ) && \
18-
apt-get install -y --no-install-recommends libc-dev golang-1.21 make git gcc musl-dev musl-tools && \
18+
apt-get install -y --no-install-recommends libc-dev golang-1.22 make git gcc musl-dev musl-tools && \
1919
wget -q -P /root/ https://musl.cc/aarch64-linux-musl-cross.tgz && \
2020
tar -xvf /root/aarch64-linux-musl-cross.tgz -C /root/ && \
2121
mkdir -p /root/go/
2222

23-
RUN ln -nsfv /usr/lib/go-1.21/bin/go /usr/bin/go
23+
RUN ln -nsfv /usr/lib/go-1.22/bin/go /usr/bin/go
2424
VOLUME /root/.cache/go
2525
ENV GOCACHE=/root/.cache/go
2626
ENV GOPATH=/root/go/
27-
ENV GOROOT=/usr/lib/go-1.21/
27+
ENV GOROOT=/usr/lib/go-1.22/
2828
RUN go env
2929
WORKDIR /src/
3030
# cache modules when go.mod go.sum changed
@@ -76,16 +76,17 @@ COPY --from=builder-fips /src/build/ /src/build/
7676
CMD /src/build/${TARGETPLATFORM}/clickhouse-backup-fips --help
7777

7878

79-
FROM alpine:3.18 AS image_short
79+
FROM alpine:3.19 AS image_short
8080
ARG TARGETPLATFORM
8181
MAINTAINER Eugene Klimov <[email protected]>
8282
RUN addgroup -S -g 101 clickhouse \
8383
&& adduser -S -h /var/lib/clickhouse -s /bin/bash -G clickhouse -g "ClickHouse server" -u 101 clickhouse
84-
RUN apk update && apk add --no-cache ca-certificates tzdata bash curl && update-ca-certificates
84+
RUN apk update && apk add --no-cache ca-certificates tzdata bash curl libcap-setcap && update-ca-certificates
8585
COPY entrypoint.sh /entrypoint.sh
8686
RUN chmod +x /entrypoint.sh
8787
COPY build/${TARGETPLATFORM}/clickhouse-backup /bin/clickhouse-backup
8888
RUN chmod +x /bin/clickhouse-backup
89+
RUN setcap cap_sys_nice=+ep /bin/clickhouse-backup
8990
# USER clickhouse
9091
ENTRYPOINT ["/entrypoint.sh"]
9192
CMD [ "/bin/clickhouse-backup", "--help" ]
@@ -96,6 +97,7 @@ ARG TARGETPLATFORM
9697
MAINTAINER Eugene Klimov <[email protected]>
9798
COPY build/${TARGETPLATFORM}/clickhouse-backup-fips /bin/clickhouse-backup
9899
RUN chmod +x /bin/clickhouse-backup
100+
RUN setcap cap_sys_nice=+ep /bin/clickhouse-backup
99101

100102

101103
FROM ${CLICKHOUSE_IMAGE}:${CLICKHOUSE_VERSION} AS image_full
@@ -106,14 +108,15 @@ RUN apt-get update && apt-get install -y gpg xxd bsdmainutils parallel && wget -
106108
echo "deb [signed-by=/usr/share/keyrings/kopia-keyring.gpg] https://packages.kopia.io/apt/ stable main" > /etc/apt/sources.list.d/kopia.list && \
107109
wget -c "https://github.com/mikefarah/yq/releases/latest/download/yq_linux_$(dpkg --print-architecture)" -O /usr/bin/yq && chmod +x /usr/bin/yq && \
108110
apt-get update -y && \
109-
apt-get install -y ca-certificates tzdata bash curl restic rsync rclone jq gpg kopia && \
111+
apt-get install -y ca-certificates tzdata bash curl restic rsync rclone jq gpg kopia libcap2-bin && \
110112
update-ca-certificates && \
111113
rm -rf /var/lib/apt/lists/* && rm -rf /var/cache/apt/*
112114

113115
COPY entrypoint.sh /entrypoint.sh
114116
RUN chmod +x /entrypoint.sh
115117
COPY build/${TARGETPLATFORM}/clickhouse-backup /bin/clickhouse-backup
116118
RUN chmod +x /bin/clickhouse-backup
119+
RUN setcap cap_sys_nice=+ep /bin/clickhouse-backup
117120

118121
# USER clickhouse
119122

0 commit comments

Comments
 (0)