Repository navigation
Check s3_min_upload_part_size also when s3_strict_upload_part_size is set - #129747
Conversation
… set S3RequestSettings::validateUploadSettings ran the "min_upload_part_size cannot be zero" and "max_upload_part_size can't be less than min_upload_part_size" checks only when no strict part size was set. Writes with a strict size use fixed-size parts and never read the min, but copyS3File / copyDataToS3File ignore the strict size and split by min and max in calculatePartSize. So such a configuration was accepted, and a native copy (a BACKUP to S3, a copy between S3 disks) failed later with INVALID_CONFIG_PARAMETER. Run both checks in both modes, as Azure's RequestSettings::validateUploadSettings already does (ClickHouse#103394). Only the multiply-factor checks stay strict-only; without a strict size nothing changes. Test 05508: the three existing statements set s3_min_upload_part_size to 1 MiB, since the default 16 MiB min is now rejected with a 1 MiB max; this also keeps the strict > max cases testing only that check. New cases: an S3 disk and s3() for each check, and a BACKUP. Requested in ClickHouse#129578 (comment) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 1 finding) plus my own review (2 nits).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-10:20261106-142900 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-40:20261106-134300 |
|
Workflow [PR], commit [e40ee1e] Summary: ✅
AI ReviewSummaryPR #129747, reviewed at Missing context / blind spots
Final Verdict✅ Approve — no new inline findings or required changes. |
|
cc @alesapin @scanhex12, could you review this and add the |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units7 translation units recompiled, 9 s compile time in total, 7 of them have a recent master baseline. |
c4912ea
Related: #129578
Related: #103394
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
With
s3_strict_upload_part_sizeset, an S3 disk, ans3query or an S3 backup whoses3_min_upload_part_sizeis zero or greater thans3_max_upload_part_sizeis now rejected up front withINVALID_SETTING_VALUE, as Azure already does. Before, such a configuration was accepted and a native copy (for example aBACKUPto S3 or a copy between S3 disks) failed later withINVALID_CONFIG_PARAMETER. To keep such a configuration working, sets3_min_upload_part_sizeto a non-zero value not greater thans3_max_upload_part_size.Description
Follow-up requested in #129578 (comment).
S3RequestSettings::validateUploadSettingschecksmin_upload_part_size(not zero, not abovemax_upload_part_size) only whenstrict_upload_part_sizeis 0. Writes with a strict size never read the min, butcopyS3Fileignores the strict size and splits by min and max incalculatePartSize, which throwsINVALID_CONFIG_PARAMETER. On master, withs3_strict_upload_part_size = 1048576ands3_max_single_part_upload_size = 1024(forces a multipart copy),s3()writes are accepted andBACKUP TABLE ... TO S3(...)fails with:s3_min_upload_part_size = 0:Code: 318 ... min_upload_part_size must not be 0;s3_max_upload_part_size = 1048576, s3_min_upload_part_size = 16777216:Code: 318 ... max_upload_part_size must not be less than min_upload_part_size.The two checks now run in both modes, as in Azure's
RequestSettings::validateUploadSettings. Only the multiply-factor checks stay strict-only, and nothing changes when no strict size is set.Category
Improvement: the only symptom on released versions is a late, clear error from a contradictory configuration.Behaviour change: such settings are now rejected when the disk, the
s3()query or the backup is set up. A server whose config has such an S3 disk no longer starts, as master already does for the same values without a strict size.Test: extends
05508. Its three existing statements gains3_min_upload_part_size = 1048576, because the default 16 MiB min is now rejected with a 1 MiB max. Each new check has its own failing case. 50/50 with randomized settings.Not changed: settings are still validated per
<s3>endpoint layer (#129670).Workflow [PR]
Sync PR [sync-upstream/pr/129747]
Version info
26.11.1.1553-master(included in26.11and later)