Azure / azure-storage-cpplite

Lite version of C++ Client Library for Microsoft Azure Storage
MIT License
25 stars 43 forks source link

Why get_blob_properties return invalid data #119

Closed oyljerry closed 2 years ago

oyljerry commented 3 years ago

Hi All:
After I use put_block_list() to upload all blobs to storage successfully, I use get_blob_properties() to get blob properties, But I found that ETag is "" empty, and size is an extremely large value, What is the reason. Thanks.

auto put_block_list_outcome = client->put_block_list(strContainerName, strblobName, block_list, {}).get();
auto get_blob_property_outcome = client->get_blob_properties(strContainerName, strblobName).get();

put_block_list_outcome and put_block_list_outcome are success.

Jinming-Hu commented 3 years ago

Did you check put_block_list_outcome.success() and get_blob_property_outcome.success()?

oyljerry commented 3 years ago

Did you check put_block_list_outcome.success() and get_blob_property_outcome.success()?

Yes, These two outcome are both success.

Jinming-Hu commented 3 years ago

That's unusual. @oyljerry Can you provide a piece of code to reproduce this issue, so that I can investigate?

oyljerry commented 3 years ago

This issue is happened in below scenario.
I have a file, and split it into 10 blocks as each block is 10MB. If I use upload_block_from_buffer to put 2 blocks, then I interrupt the program. restart the program, Use get_block_list to get uncommitted array, Then I will only put_block the remained 8 blocks. after it, I use put_block_list and get_blob_property to get the result, Both are success, but there is no ETag in response.

BTW, If I upload_block_from_buffer all 10 blocks in a time, then put_block_list and get_blob_property are success and can get ETag in response.

There are two azure connection string for testing, One will have this issue, another is not, as I do not have privilege for these two accounts, So I just guess these may be related with Azure storage configuration? But I do not know how to investigate. Thanks.

Jinming-Hu commented 2 years ago

There are two azure connection string for testing, One will have this issue, another is not, as I do not have privilege for these two accounts, So I just guess these may be related with Azure storage configuration?

If one of the storage accounts works, this is not a client-side issue. If the server returns ETag header, cpplite can parse the header and return it to you. If cpplite doesn't return the header, it's not returned from the server side at all.

What's the difference between these two storage accounts?

Jinming-Hu commented 2 years ago

Update from email thread: Not a storage client or service issue. The ETag header was filtered by CDN

Jinming-Hu commented 2 years ago

@oyljerry I'll close this issue since it's not a storage issue. Feel free to re-open if you have any further questions.