[QUERY] Understanding copy status when blob is deleted after (?during) async copy operation within same storage account #46385
Labels
Client
This issue points to a problem in the data-plane of the library.
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
needs-team-attention
Workflow: This issue needs attention from Azure service team or SDK team
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Service Attention
Workflow: This issue is responsible by Azure service team.
Storage
Storage Service (Queues, Blobs, Files)
Library name and version
Azure.Storage.Blobs 12.21.2
Query/Question
Hi,
We are copying blobs from one container to another within the same storage account, as we would like it to be an atomic operation (we use Event Hub to push the Blob Created message to a storage queue which is consumed by an Azure function to process the blob).
We are using this code:
We are finding that the blob is collected and deleted before the final WaitForCompletionAsync, so this receives 404 and throws an exception. This isn't wrong but makes it hard to understand what has happened. Did the copy complete successfully?
These are the sanitised blob storage logs:
3:04:05.424 PM,Writer,/storageaccount/tempcontainer/blobname,PutBlob,201,Success
3:04:05.435 PM,Writer,/storageaccount/finalcontainer/blobname,CopyBlob,202,Success
3:04:05.435 PM,Writer,https://storageaccount.blob.core.windows.net/tempcontainer/blobname,CopyBlobSource,202,Success
3:04:05.435 PM,Writer,/storageaccount/finalcontainer/blobname,CopyBlobDestination,202,Success
3:04:05.707 PM,Consumer,/storageaccount/finalcontainer/blobname,GetBlobProperties,200,Success
3:04:05.712 PM,Consumer,/storageaccount/finalcontainer/blobname,GetBlobProperties,200,Success
3:04:05.719 PM,Consumer,/storageaccount/finalcontainer/blobname,GetBlob,200,Success
3:04:05.770 PM,Consumer,/storageaccount/finalcontainer/blobname,GetBlobProperties,200,Success
3:04:05.777 PM,Consumer,/storageaccount/finalcontainer/blobname,GetBlob,200,Success
3:04:05.823 PM,Consumer,/storageaccount/finalcontainer/blobname,GetBlobProperties,200,Success
3:04:05.828 PM,Consumer,/storageaccount/finalcontainer/blobname,DeleteBlob,202,Success
3:04:06.405 PM,Writer,/storageaccount/finalcontainer/blobname,GetBlobProperties,404,BlobNotFound
The last two lines show the consumer deleting the blob before the writer has done its final check as part of WaitForCompletionAsync.
How do I interpret this in my client code? Does a 404 in WaitForCompletionAsync guarantee that the copy completed successfully and that the file was subsequently deleted?
If not how do I tell the difference between this condition and 'some other error condition where the blob disappeared'.
Environment
Azure Function, Isolated model on .net 8
The text was updated successfully, but these errors were encountered: