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

[FIXED] JetStream: Some stream advisories missing #2887

Merged
merged 1 commit into from Mar 6, 2022
Merged

Conversation

kozlovic
Copy link
Member

@kozlovic kozlovic commented Feb 25, 2022

The "deleted" advisory was missing because the stream's send loop
was closed before the advisory was pushed to the queue to be sent.

Added tests, both for single and clustered mode to test all stream
advisories.

Resolves #2886

Signed-off-by: Ivan Kozlovic ivan@synadia.com

@kozlovic kozlovic marked this pull request as draft February 25, 2022 22:17
@kozlovic
Copy link
Member Author

@derekcollison I have created this PR with a test that checks for all stream advisory. The "deleted" advisory missing was due to a close of the channel before we scheduled the advisory (even this current fix may not be 100% reliable, since I am not certain that Go's select{} with case <-channel would consume always in the order they are listed. We know there will be a message pushed in the queue, but the close of the channel may be picked-up first?

Anyway, the other issue is as described in one review-comment: not sure how to make the advisory be sent in case of the restore of the stream in clustered mode.

@derekcollison
Copy link
Member

ok so next steps for this one are what?

@kozlovic
Copy link
Member Author

ok so next steps for this one are what?

That you figure out how to have the server send the advisory, in cluster mode, when doing a stream recover. As I pointed out, the code suppress the advisory because the server is leader, clustered, but sa is nil.

@derekcollison
Copy link
Member

ok and the delete advisory is fixed to your satisfaction?

Should I simply extend this PR or create new one?

@kozlovic
Copy link
Member Author

You should extend, since there is the new test already (which obviously fails because of the missing "created" advisory on stream restore).
As for the delete, moving the close of channel seem to do the trick, but not sure if this will work 100%.

@kozlovic kozlovic marked this pull request as ready for review March 5, 2022 02:34
Copy link
Member Author

@kozlovic kozlovic left a comment

Choose a reason for hiding this comment

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

LGTM. I can't "approve" this PR since I am considered the author (GitHub won't let me select "Approve"). But I can confirm that the changes you made allow the update advisory to be seen in clustered/R3 and the create advisory after a snapshot restore.

@ripienaar ripienaar self-requested a review March 6, 2022 17:37
Copy link
Contributor

@ripienaar ripienaar left a comment

Choose a reason for hiding this comment

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

LGTM

The "deleted" advisory was missing because the stream's send loop
was closed before the advisory was pushed to the queue to be sent.

Added tests, both for single and clustered mode to test all stream
advisories.

Resolves #2886

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
@kozlovic kozlovic merged commit 54da758 into main Mar 6, 2022
@kozlovic kozlovic deleted the fix_2886 branch March 6, 2022 17:54
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.

Some JetStream Asset CRUD events aren't being published
3 participants