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 ordered consumer on reset and fix recreated consumer name #1449

Merged
merged 2 commits into from
Oct 27, 2023

Conversation

piotrpio
Copy link
Collaborator

  • library now attempts to remove consumer befor creating a new one when resetting ordered consumer
  • fixed recreated consumer name to be in the same format as the initial one (short hash of nuid instead of full nuid

Signed-off-by: Piotr Piotrowski piotr@synadia.com

Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
@piotrpio piotrpio requested a review from Jarema October 25, 2023 14:46
js.go Outdated
if err != nil && !errors.Is(err, ErrConsumerNotFound) {
var apiErr *APIError
if errors.Is(err, ErrJetStreamNotEnabled) || errors.Is(err, ErrTimeout) || errors.Is(err, context.DeadlineExceeded) {
// if creating consumer failed, retry
Copy link
Member

Choose a reason for hiding this comment

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

here we abort recreating the ordered consumer if deleting the previous consumer fails? I wonder if we should ignore the delete consumer error but call pushErr here and then proceed to recreate the ordered consumer instead as before

Copy link
Member

Choose a reason for hiding this comment

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

The delete call should be async and best effort, I would not even wait for a response.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good points, done

Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
Copy link
Member

@wallyqs wallyqs left a comment

Choose a reason for hiding this comment

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

LGTM

@piotrpio piotrpio merged commit efb3ab6 into main Oct 27, 2023
2 checks passed
@piotrpio piotrpio deleted the delete-ordered-consumer-on-reset branch October 27, 2023 08:51
@piotrpio piotrpio mentioned this pull request Nov 11, 2023
@piotrpio piotrpio mentioned this pull request Jan 12, 2024
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.

3 participants