Skip to content

Refs/heads/s3 chunksize#1248

Merged
Slach merged 5 commits intoAltinity:masterfrom
KimDoKy:s3-chunksize
Sep 18, 2025
Merged

Refs/heads/s3 chunksize#1248
Slach merged 5 commits intoAltinity:masterfrom
KimDoKy:s3-chunksize

Conversation

@KimDoKy
Copy link
Copy Markdown
Contributor

@KimDoKy KimDoKy commented Sep 18, 2025

Background
We are backing up ClickHouse databases to MINIo object storage in a private cloud environment.

Problem
When using the existing max_parts_count configuration, we encountered excessive load during backup operations. This caused resource contention issues and slowed down uploads, especially with larger backups.

Solution
I added a new option to control chunk size during object storage uploads. By adjusting the chunk size, we can optimize resource usage and avoid spikes in network or disk load. This feature has been tested successfully in our environment.

Update
When the file size was divided based on chunk_size, it was modified not to exceed 10000.
Update the variables you refer to when calculating partSize.

Request
I hope this chunk size control feature can be officially included in the project to provide better flexibility for MINIo and similar scenarios.

Please let me know if any changes are needed or if further testing is required. Thank you!

- Introduced chunk size control for object storage backups.
- Tested successfully with various chunk sizes.
    - Introduced chunk size control for object storage backups.
    - Tested successfully with various chunk sizes.
    - When the file size was divided based on chunk_size, it was modified not to exceed 10000.
    - Introduced chunk size control for object storage backups.
    - Tested successfully with various chunk sizes.
    - When the file size was divided based on chunk_size, it was modified not to exceed 10000.
    - Update the variables you refer to when calculating partSize.
@Slach
Copy link
Copy Markdown
Collaborator

Slach commented Sep 18, 2025

you don't need open new pull request for every commit

@Slach
Copy link
Copy Markdown
Collaborator

Slach commented Sep 18, 2025

to fix
https://github.com/Altinity/clickhouse-backup/actions/runs/17820069799/job/50667655755?pr=1248#step:8:10858

use following commdands

git pull upstream master
touch ./test/testflows/.env 
rm -rf ./test/testflows/clickhouse_backup/tests/snapshots/cli.py.cli.snapshot
RUN_TESTS="/clickhouse backup/cli/*" ./test/testflows/run.sh

then commit changed cli.py.cli.snapshot

Signed-off-by: Slach <bloodjazman@gmail.com>
@Slach
Copy link
Copy Markdown
Collaborator

Slach commented Sep 18, 2025

i changed,let's wait CI/CD

@coveralls
Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 17823211847

Details

  • 17 of 31 (54.84%) changed or added relevant lines in 2 files are covered.
  • 268 unchanged lines in 10 files lost coverage.
  • Overall coverage decreased (-1.7%) to 66.732%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/storage/s3.go 16 30 53.33%
Files with Coverage Reduction New Missed Lines %
pkg/backup/restore.go 1 70.66%
cmd/clickhouse-backup/main.go 2 77.27%
pkg/storage/object_disk/object_disk.go 5 66.48%
pkg/config/config.go 8 72.12%
pkg/server/server.go 9 58.49%
pkg/status/status.go 9 67.43%
pkg/backup/backuper.go 17 72.18%
pkg/storage/general.go 24 60.66%
pkg/storage/s3.go 25 47.48%
pkg/storage/gcs.go 168 0.0%
Totals Coverage Status
Change from base Build 17818027766: -1.7%
Covered Lines: 10621
Relevant Lines: 15916

💛 - Coveralls

@Slach Slach merged commit 4df8f8e into Altinity:master Sep 18, 2025
68 of 75 checks passed
Slach added a commit that referenced this pull request Sep 18, 2025
Signed-off-by: Slach <bloodjazman@gmail.com>
Slach added a commit that referenced this pull request Sep 18, 2025
Signed-off-by: Slach <bloodjazman@gmail.com>
@aidvu
Copy link
Copy Markdown

aidvu commented Sep 29, 2025

This also fixes #1142. Just linking it so we don't remove it again. 🙇🏻 thanks for fixing @KimDoKy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants