diff --git a/core/src/services/azblob/core.rs b/core/src/services/azblob/core.rs index bfad590c3eb..9c37ea1f219 100644 --- a/core/src/services/azblob/core.rs +++ b/core/src/services/azblob/core.rs @@ -377,6 +377,7 @@ impl AzblobCore { pub fn azblob_put_block_list_request( &self, path: &str, + block_id: Uuid, size: Option, args: &OpWrite, body: AsyncBody, @@ -385,10 +386,11 @@ impl AzblobCore { let p = build_abs_path(&self.root, path); let url = format!( - "{}/{}/{}?comp=blocklist", + "{}/{}/{}?comp=block&block_id={}", self.endpoint, self.container, - percent_encode_path(&p) + percent_encode_path(&p), + BASE64_STANDARD.encode(block_id), ); let mut req = Request::put(&url); // Set SSE headers. @@ -419,11 +421,12 @@ impl AzblobCore { pub async fn azblob_put_block_list( &self, path: &str, + block_id: Uuid, size: Option, args: &OpWrite, body: AsyncBody, ) -> Result> { - let mut req = self.azblob_put_block_list_request(path, size, args, body)?; + let mut req = self.azblob_put_block_list_request(path, block_id, size, args, body)?; self.sign(&mut req).await?; self.send(req).await @@ -439,7 +442,7 @@ impl AzblobCore { "{}/{}/{}?comp=blocklist", self.endpoint, self.container, - percent_encode_path(&p) + percent_encode_path(&p), ); let req = Request::post(&url); diff --git a/core/src/services/azblob/writer.rs b/core/src/services/azblob/writer.rs index 7c560c156b0..375ad6bc054 100644 --- a/core/src/services/azblob/writer.rs +++ b/core/src/services/azblob/writer.rs @@ -134,10 +134,10 @@ impl oio::BlockWrite for AzblobWriter { } } - async fn write_block(&self, _block_id: Uuid, size: u64, body: AsyncBody) -> Result<()> { + async fn write_block(&self, block_id: Uuid, size: u64, body: AsyncBody) -> Result<()> { let resp = self .core - .azblob_put_block_list(&self.path, Some(size), &self.op, body) + .azblob_put_block_list(&self.path, block_id, Some(size), &self.op, body) .await?; let status = resp.status();