You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It makes sense to use clamp to make the value to keep in range.
But it doesn't make sense to divide the max_size with MIN_MULTIPART_SIZE.
Since we are calculating how many bytes are required for the part not how many part counts are required, why do we divide max bytes with minimum mulitpart bytes?
If that part was to keep the parts count to be less than MAX_UPLOAD_PARTS, shouldn't the code be like this?
let bytes_per_upload_part =
(max_size / (MAX_UPLOAD_PARTS as u64 - 1)).clamp(MIN_MULTIPART_SIZE, MAX_MULTIPART_SIZE);
I've checked this line's history and it had been there from old times.
Frankly, I'm not sure if this is a real issue and I misunderstood something.
Hope you to check this issue's validity. I will raise a PR if my solution is correct. Thank you.
This is the code of S3 Store's bytes per upload part calculation.
nativelink/nativelink-store/src/s3_store.rs
Lines 530 to 533 in 712608c
We've declared constant variables as this.
nativelink/nativelink-store/src/s3_store.rs
Lines 67 to 77 in 712608c
It makes sense to use
clamp
to make the value to keep in range.But it doesn't make sense to divide the
max_size
withMIN_MULTIPART_SIZE
.Since we are calculating how many bytes are required for the part not how many part counts are required, why do we divide max bytes with minimum mulitpart bytes?
If that part was to keep the parts count to be less than
MAX_UPLOAD_PARTS
, shouldn't the code be like this?I've checked this line's history and it had been there from old times.
Frankly, I'm not sure if this is a real issue and I misunderstood something.
Hope you to check this issue's validity. I will raise a PR if my solution is correct. Thank you.
cc: @allada, @MarcusSorealheis
The text was updated successfully, but these errors were encountered: