Skip to content

Broker: Await initialization before finishing startup.#6742

Merged
gianm merged 3 commits intoapache:masterfrom
gianm:sql-metadata-init-improvements
Dec 19, 2018
Merged

Broker: Await initialization before finishing startup.#6742
gianm merged 3 commits intoapache:masterfrom
gianm:sql-metadata-init-improvements

Conversation

@gianm
Copy link
Copy Markdown
Contributor

@gianm gianm commented Dec 16, 2018

In particular, hold off on announcing the service and starting the
HTTP server until the server view and SQL metadata cache are finished
initializing. This closes a window of time where a Broker could return
partial results shortly after startup.

I decided to do it this way because there are lots of ways people find
Brokers to query, including:

  1. Through the Router (which uses the annoucements)
  2. Looking at announcements and querying one of the announced servers
  3. Through HTTP load balancers hooked up directly to brokers

Delaying startup should play well with all three mechanisms.

As part of this, some simplification of server-lifecycle service
announcements. This helps ensure that the two different kinds of
announcements we do (legacy and new-style) stay in sync.

In particular, hold off on announcing the service and starting the
HTTP server until the server view and SQL metadata cache are finished
initializing. This closes a window of time where a Broker could return
partial results shortly after startup.

As part of this, some simplification of server-lifecycle service
announcements. This helps ensure that the two different kinds of
announcements we do (legacy and new-style) stay in sync.
Copy link
Copy Markdown
Member

@clintropolis clintropolis left a comment

Choose a reason for hiding this comment

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

👍 after CI (failing currently due to unused imports)

@gianm gianm merged commit 7a09cde into apache:master Dec 19, 2018
gianm added a commit to implydata/druid-public that referenced this pull request Dec 19, 2018
* Broker: Await initialization before finishing startup.

In particular, hold off on announcing the service and starting the
HTTP server until the server view and SQL metadata cache are finished
initializing. This closes a window of time where a Broker could return
partial results shortly after startup.

As part of this, some simplification of server-lifecycle service
announcements. This helps ensure that the two different kinds of
announcements we do (legacy and new-style) stay in sync.

* Remove unused imports.

* Fix NPE in ServerRunnable.
gianm added a commit to gianm/druid that referenced this pull request Dec 20, 2018
Fixes a bug introduced in apache#6742, where the broker would delay startup
indefinitely if there were no segments at all being served by any
data servers.
dclim pushed a commit that referenced this pull request Dec 20, 2018
…6765)

Fixes a bug introduced in #6742, where the broker would delay startup
indefinitely if there were no segments at all being served by any
data servers.
dclim pushed a commit to implydata/druid-public that referenced this pull request Dec 20, 2018
…pache#6765)

Fixes a bug introduced in apache#6742, where the broker would delay startup
indefinitely if there were no segments at all being served by any
data servers.
@gianm gianm deleted the sql-metadata-init-improvements branch January 15, 2019 16:05
@gianm
Copy link
Copy Markdown
Contributor Author

gianm commented Jan 15, 2019

Should also help work around #6176 until we can figure out why that's happening (the latest thought is that it is something Curator related?). The broker would stay stuck waiting for startup forever, which would at least mean it won't run with a broken SQL metadata cache. The issue would be fully worked-around if paired with monitoring that restarts unhealthy brokers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants