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

Remove isWriteOperation on container delete #23331

Closed
wants to merge 1 commit into from

Conversation

kjg
Copy link
Contributor

@kjg kjg commented Aug 14, 2024

Hi! For some reasons I'm getting back 500 errors when I attempt to delete a cosmos container. If I remove isWriteOperation: true, the Delete is successful.

I'm not sure if this is a server issue, or a client issue, but my hopes is that this PR can either spark the investigation or lead to a fix.

Interestingly I see that (Database).Delete also uses isWriteOperation: true, and that operation is successful for me (both with and without the option set)

I didn't see any tests added when this option was first added, so I'm not sure if there are any tests might be relevant for this change. I'd be happy to update the CHANGELOG if this is accepted, but wanted to start the discussion first since I think there is a chance that this is a server side issue (since Database deletion works).

  • The purpose of this PR is explained in this or a referenced issue.
  • The PR does not update generated files.
  • Tests are included and/or updated for code changes.
  • Updates to module CHANGELOG.md are included.
  • MIT license headers are included in each file.

@github-actions github-actions bot added Community Contribution Community members are working on the issue Cosmos customer-reported Issues that are reported by GitHub users external to the Azure organization. labels Aug 14, 2024
Copy link

Thank you for your contribution @kjg! We will review the pull request and get back to you soon.

@kjg kjg marked this pull request as ready for review August 14, 2024 20:39
resourceAddress: c.link,
isWriteOperation: true,
resourceType: resourceTypeCollection,
resourceAddress: c.link,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A delete is a Write operation. And we have tests that use this. The Write operation is used to define routing (write operations can only be sent to the primary region)

Please verify with the service team the origin of the HTTP 500.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isWriteOperation does not modify the request that is sent, it is used to know which region to route it to.

func (lc *locationCache) resolveServiceEndpoint(locationIndex int, isWriteOperation, useWriteEndpoint bool) url.URL {

@kjg
Copy link
Contributor Author

kjg commented Aug 15, 2024

Closing this because #23335 is the correct fix for my issue

@kjg kjg closed this Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community Contribution Community members are working on the issue Cosmos customer-reported Issues that are reported by GitHub users external to the Azure organization.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants