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

database: Store all Operations items in a single partition #730

Merged
merged 1 commit into from
Oct 16, 2024

Conversation

mbarnes
Copy link
Collaborator

@mbarnes mbarnes commented Oct 16, 2024

What this PR does

The azcosmos SDK currently only supports single-partition queries, so there's no way to list all items in a container unless you know all the partition keys. The backend needs to list all items in the Operations container so to work around this limitation we keep all items in a single partition with a well-known name: "workaround".

Once this SDK issue is fixed we could transition the Operations container to using subscription IDs as the partition key like other containers. The items are transient thanks to the container's default TTL, so GetOperationDoc would just need temporary fallback logic to check the "workaround" partition.

Jira: Blocking progress on ARO-8598 - Prototype async op status notification mechanism for RP
Link to demo recording:

Special notes for your reviewer

The azcosmos SDK currently only supports single-partition queries,
so there's no way to list all items in a container unless you know
all the partition keys. The backend needs to list all items in the
Operations container so to work around this limitation we keep all
items in a single partition with a well-known name: "workaround".

Once [1] is fixed we could transition the Operations container to
using subscription IDs as the partition key like other containers.
The items are transient thanks to the container's default TTL, so
GetOperationDoc would just need temporary fallback logic to check
the "workaround" partition.

[1] Azure/azure-sdk-for-go#18578
@mjlshen mjlshen merged commit a2d2d4e into main Oct 16, 2024
27 checks passed
@mjlshen mjlshen deleted the operations-partition-key branch October 16, 2024 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants