Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] etag being ignored in batch operation #43583

Closed
daledev-uk opened this issue Apr 23, 2024 · 5 comments
Closed

[BUG] etag being ignored in batch operation #43583

daledev-uk opened this issue Apr 23, 2024 · 5 comments
Assignees
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. issue-addressed The Azure SDK team member assisting with this issue believes it to be addressed and ready to close. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Tables

Comments

@daledev-uk
Copy link

Library name and version

Azure.Data.Tables 12.8.3

Describe the bug

When doing a batch operation, trying to delete x number of records, if any record does not exist I get error

Exception: Azure.Data.Tables.TableTransactionFailedException: xxx :The specified resource does not exist., more full stack below.

I'm callingTableClient.SubmitTransactionAsync with a list of TableTransactionAction. For each TableTransactionAction, the TableEntity.ETag is set to *. I am also setting the Etag of the TableTransactionAction directly to *, I would expect this to not fail if an item is missing, however it does. I did not have this issue before with Microsoft.WindowsAzure.Storage.Table but since switching I'm having this problem showing in production logs and can replicate locally with Azurite.

I can work around this if I have to but loading the records first, but really hoping I don't need to, can you advise please.


Additional Information:
FailedEntity: 0

Content:
{"odata.error":{"code":"ResourceNotFound","message":{"lang":"en-US","value":"0:The specified resource does not exist.\nRequestId:b5bf2ade-d002-0052-0711-95e660000000\nTime:2024-04-23T00:00:00.1308738Z"}}}

Headers:
X-Content-Type-Options: REDACTED
Cache-Control: no-cache
DataServiceVersion: 3.0;
Content-Type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8

   at Azure.Data.Tables.TableRestClient.SendBatchRequestAsync(HttpMessage message, CancellationToken cancellationToken)
   at Azure.Data.Tables.TableClient.SubmitTransactionInternalAsync(IEnumerable`1 transactionalBatch, Guid batchId, Guid changesetId, Boolean async, CancellationToken cancellationToken)
   at Azure.Data.Tables.TableClient.SubmitTransactionAsync(IEnumerable`1 transactionActions, CancellationToken cancellationToken)

Expected behavior

Ignore delete TableTransactionAction in a batch when entity does not exist but etag is *

Actual behavior

Does not delete TableTransactionAction in a batch when entity does not exist but etag is * but throws error Azure.Data.Tables.TableTransactionFailedException

Reproduction Steps

CallTableClient.SubmitTransactionAsync with a list of TableTransactionAction. For each TableTransactionAction, the TableEntity.ETag is set to *. Also setting the Etag of the TableTransactionAction directly to *

Create a list of delete options and have one or more of the items not exist

Environment

Azure Function 4, DotNet 6

@github-actions github-actions bot added 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 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 Tables labels Apr 23, 2024
Copy link

Thank you for your feedback. Tagging and routing to the team member best able to assist.

@christothes
Copy link
Member

Hi @daledev-uk
Attempting to delete an entity that does not exist results in a failed request (status 404) with the following error content:

{
    "odata.error":
    {
        "code": "ResourceNotFound",
        "message":
        {
            "lang": "en-US",
            "value": "The specified resource does not exist.\nRequestId:efad7e90-6002-0083-428a-9584e3000000\nTime:2024-04-23T14:31:14.6386589Z"
        }
    }
}

It is expected behavior for the batch transaction to fail if any of the requests that are part of the batch fail. The ETag has no effect on this scenario because the resource we are trying to delete does not exist. It would come into play only if the resource existed and we wanted it to be deleted unconditionally.

@christothes christothes added the issue-addressed The Azure SDK team member assisting with this issue believes it to be addressed and ready to close. label Apr 23, 2024
Copy link

Hi @daledev-uk. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text "/unresolve" to remove the "issue-addressed" label and continue the conversation.

@github-actions github-actions bot removed the needs-team-attention This issue needs attention from Azure service team or SDK team label Apr 23, 2024
@daledev-uk
Copy link
Author

OK thanks, I must have been loading the entities first with the old deprecated library if that is how it behaves.

Thanks

Copy link

Hi @daledev-uk, since you haven’t asked that we /unresolve the issue, we’ll close this out. If you believe further discussion is needed, please add a comment /unresolve to reopen the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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. issue-addressed The Azure SDK team member assisting with this issue believes it to be addressed and ready to close. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Tables
Projects
None yet
Development

No branches or pull requests

2 participants