-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
lifecycle stage refactor to ensure proper start and stop ordering of servers and announcements #7234
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally LG but I am confused about what's going on with the DerivativeDataSourceManager.
@@ -65,7 +65,7 @@ | |||
* Read and store derivatives information from dataSource table frequently. | |||
* When optimize query, DerivativesManager offers the information about derivatives. | |||
*/ | |||
@ManageLifecycleLast | |||
@ManageLifecycleAnnouncements |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this in @ManageLifecycleAnnouncements
? It doesn't seem to be doing announcements?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question, I'll see if I can dig up why it was marked @ManageLifecycleLast
prior to this PR...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no reason in the initial PR, it was already in the first commit and not an explicit response to review afaict. Looking over what it is doing, it doesn't seem like it would need to be in the last stage, I will move it to just @ManageLifecycle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, moved it to Lifecycle.Stage.NORMAL
, thanks for review!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't tell if this approach is clunky or elegant. Let's go with elegant :)
…servers and announcements (apache#7234) * lifecycle stage refactor to ensure proper ordering of servers and announcements * move DerivativeDataSourceManager to Lifecycle.Stage.NORMAL
…servers and announcements (apache#7234) * lifecycle stage refactor to ensure proper ordering of servers and announcements * move DerivativeDataSourceManager to Lifecycle.Stage.NORMAL
…servers and announcements (apache#7234) * lifecycle stage refactor to ensure proper ordering of servers and announcements * move DerivativeDataSourceManager to Lifecycle.Stage.NORMAL
This fixes an issue introduced by #7215.
HttpServerInventoryView
uses the 'discovery' announcement so would correctly identify servers that disappear, butAbstractCuratorServerInventoryView
watches another announcement that stops later, causing the 'server disappeared' event to happen after jetty has stopped.This PR resolves this issue by slightly reworking the
Lifecycle.Stage
enumeration and renaming them to be more relevant to their intended usage, to quote the javadocs:This has the very nice behavior that all announcements can be unannounced prior to stopping the server, meaning
druid.server.http.unannouncePropagationDelay
should apply to all announcements to give adequate time for the rest of the cluster to notice all announcements are gone.Logs of shutdown after this PR for curator based segment management:
and for http segment management: