You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2025/02/01 13:51:14 UTC

Re: [PR] Add test of out of order UploadPart [arrow-rs]

alamb commented on code in PR #7047:
URL: https://github.com/apache/arrow-rs/pull/7047#discussion_r1938279313


##########
object_store/src/integration.rs:
##########
@@ -1196,3 +1196,33 @@ pub async fn multipart_race_condition(storage: &dyn ObjectStore, last_writer_win
         ));
     }
 }
+
+/// Tests performing out of order multipart uploads
+pub async fn multipart_out_of_order(storage: &dyn ObjectStore) {
+    let path = Path::from("test_multipart_out_of_order");
+    let mut multipart_upload = storage.put_multipart(&path).await.unwrap();
+
+    let part1 = std::iter::repeat(b'1')
+        .take(5 * 1024 * 1024)
+        .collect::<Bytes>();
+    let part2 = std::iter::repeat(b'2')
+        .take(5 * 1024 * 1024)
+        .collect::<Bytes>();
+    let part3 = std::iter::repeat(b'3')
+        .take(5 * 1024 * 1024)
+        .collect::<Bytes>();
+    let full = [part1.as_ref(), part2.as_ref(), part3.as_ref()].concat();
+
+    let fut1 = multipart_upload.put_part(part1.into());
+    let fut2 = multipart_upload.put_part(part2.into());
+    let fut3 = multipart_upload.put_part(part3.into());
+    fut2.await.unwrap();

Review Comment:
   I missed the out of order part of the first read of this PR. Maybe a comment would help:
   ```suggestion
       // note order is 2,3,1 , different than the parts were created in
       fut2.await.unwrap();
   ```



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org