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

Azure Event Hubs manifest should allow specifying InstanceID for faster partition lease recovery (pubsub/binding) #3571

Open
oising opened this issue Oct 16, 2024 · 0 comments
Labels
kind/enhancement New feature or request

Comments

@oising
Copy link

oising commented Oct 16, 2024

Describe the feature

When consuming messages either via the PubSub or Bindings component with Event Hubs as a backing store, partitions are leased by the consuming client. This is because there is often a pool (i.e. a consumer group) that is operating with the competing consumer pattern. Each client (i.e. sidecar) must assert ownership in the group before it can read messages. This ownership is kept in a shared storage account. When the Azure Event Hubs Go consumer client starts up, it will generate a random InstanceID - see https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/messaging/azeventhubs#ConsumerClientOptions - to use as its "Owner ID" in metadata on the block blob that represents the claimed partition. Each time the client restarts though, the InstanceID is regenerated and the client needs to wait for the default timeout period (normally 2 mins) before it can reclaim the partition (because it is flagged as owned by the previous random uuid.)

See comments on the dotnet client:

The identifier can be set using the Identifier property on the EventProcessorClientOptions passed when constructing the processor. If not specified, a random identifier will be generated.

It is recommended that you set a stable unique identifier for processor instances, as this allows the processor to recover partition ownership when an application or host instance is restarted. It also aids readability in Azure SDK logs and allows for more easily correlating logs to a specific processor instance.

This greatly lengthens the recovery time for a partition to start feeding messages to a consuming app, and as such increases the development time for dapr developers.

Release Note

RELEASE NOTE:

@oising oising added the kind/enhancement New feature or request label Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant