tustvold commented on code in PR #6869:
URL: https://github.com/apache/arrow-rs/pull/6869#discussion_r1882877520


##########
object_store/src/azure/mod.rs:
##########
@@ -392,4 +396,99 @@ mod tests {
             azure_storage_token
         );
     }
+
+    #[tokio::test]
+    async fn azure_parallel_put_multipart_test() {
+        maybe_skip_integration!();
+        let integration = MicrosoftAzureBuilder::from_env().build().unwrap();
+
+        let rng = thread_rng();
+        let suffix = String::from_utf8(
+            rng.sample_iter(rand::distributions::Alphanumeric)
+                .take(32)
+                .collect(),
+        )
+        .unwrap();
+        let path = Path::from(format!("put_multipart_{suffix}"));
+
+        let mut multipart_upload_1 = 
integration.put_multipart(&path).await.unwrap();
+        let mut multipart_upload_2 = 
integration.put_multipart(&path).await.unwrap();
+
+        multipart_upload_1
+            .put_part(Bytes::from("1:0,").into())
+            .await
+            .unwrap();
+        multipart_upload_2
+            .put_part(Bytes::from("2:0,").into())
+            .await
+            .unwrap();
+
+        multipart_upload_2
+            .put_part(Bytes::from("2:1,").into())
+            .await
+            .unwrap();
+        multipart_upload_1
+            .put_part(Bytes::from("1:1,").into())
+            .await
+            .unwrap();
+
+        multipart_upload_1
+            .put_part(Bytes::from("1:2,").into())
+            .await
+            .unwrap();
+        multipart_upload_2
+            .put_part(Bytes::from("2:2,").into())
+            .await
+            .unwrap();
+
+        multipart_upload_2
+            .put_part(Bytes::from("2:3,").into())
+            .await
+            .unwrap();
+        multipart_upload_1
+            .put_part(Bytes::from("1:3,").into())
+            .await
+            .unwrap();
+
+        multipart_upload_1
+            .put_part(Bytes::from("1:4,").into())
+            .await
+            .unwrap();
+        multipart_upload_2
+            .put_part(Bytes::from("2:4,").into())
+            .await
+            .unwrap();
+
+        multipart_upload_1.complete().await.unwrap();
+        let err = multipart_upload_2.complete().await.unwrap_err();

Review Comment:
   Right I get that, my point is that racing multipart uploads shouldn't fail, 
they should both succeed with the last writer winning. That is the expected 
semantic, making me think this is an incomplete fix.
   
   It would be ideal if this integration test could be lifted into the generic 
test suite, to ensure all the various platforms behave consistently in this 
regard.



-- 
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