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


##########
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:
   Without the changes to `object_store/src/azure/client.rs`, the final file 
shows it has parts from both streams. With the changes, the file is completely 
from the first stream to complete. 



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