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


##########
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:
   This seems to be at odds with the documentation? 
https://learn.microsoft.com/en-us/rest/api/storageservices/put-block-list?tabs=microsoft-entra-id
   
   In particular
   
   > Any uncommitted blocks are garbage collected if there are no successful 
calls to Put Block or Put Block List on the blob within a week following the 
last successful Put Block operation. If [Put 
Blob](https://learn.microsoft.com/en-us/rest/api/storageservices/put-blob) is 
called on the blob, any uncommitted blocks are garbage collected.
   
   Have you tried this against Azure proper, or just azurite? 



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