benroeder commented on code in PR #7212:
URL: https://github.com/apache/opendal/pull/7212#discussion_r2838755195


##########
core/services/swift/src/writer.rs:
##########
@@ -28,11 +31,19 @@ pub struct SwiftWriter {
     core: Arc<SwiftCore>,
     op: OpWrite,
     path: String,
+    /// Tracks the size of each uploaded segment by part number.
+    /// Populated by write_part(), consumed by complete_part().
+    part_sizes: Arc<Mutex<HashMap<usize, u64>>>,
 }
 
 impl SwiftWriter {
     pub fn new(core: Arc<SwiftCore>, op: OpWrite, path: String) -> Self {
-        SwiftWriter { core, op, path }
+        SwiftWriter {
+            core,
+            op,
+            path,
+            part_sizes: Arc::new(Mutex::new(HashMap::new())),

Review Comment:
   Done — added `size: Option<u64>` to `oio::MultipartPart` and removed the 
`HashMap<usize, u64>` + `Mutex` from the Swift writer.
   
   Swift's SLO manifest format requires `size_bytes` for each segment — Swift 
validates that each segment's actual size matches the manifest. S3/GCS don't 
need size in their complete calls (only part number and etag), which is why 
`MultipartPart` didn't have it before.
   
   Since this is a core struct, this required updating all 11 existing 
`MultipartPart` constructors across other services (S3, GCS, COS, OSS, OBS, B2, 
Upyun, Vercel Blob, object_store integration, and the test mock) to include 
`size: None`. Let me know if you'd prefer this split into a separate PR.
   
   Also addressed your other feedback:
   - Manifest PUT now forwards user metadata (`X-Object-Meta-*` headers) from 
`OpWrite`
   - Rebased onto current main (includes the 4 merged Swift PRs)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to