Return server readiness only after query serving starts - #19178
Return server readiness only after query serving starts#19178goutamadwant wants to merge 3 commits into
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #19178 +/- ##
============================================
+ Coverage 57.70% 66.94% +9.24%
- Complexity 7 1423 +1416
============================================
Files 2658 3453 +795
Lines 158824 218634 +59810
Branches 26052 34755 +8703
============================================
+ Hits 91642 146359 +54717
- Misses 59411 60579 +1168
- Partials 7771 11696 +3925
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Jackie-Jiang
left a comment
There was a problem hiding this comment.
Thanks for the contribution.
Unfortunately this solution is still not good enough. There is a delay for broker to get the server config change callback and add it to the routing.
We need to find a way to ensure broker already add the server to the routing table
|
Thanks @Jackie-Jiang you are right. The current change only ensures that the query server is running before shutdownInProgress is cleared. It then marks the server ready immediately, while brokers process the instance-config callback asynchronously, so readiness can still return 200 before the server has been added to their routing tables. My proposed next step is an explicit broker-side acknowledgement or processing watermark after the routing manager finishes applying the instance-config change to all routing entries. The server would remain unready until the relevant live brokers have acknowledged the config version that re-enabled it. Does that coordination point match the approach you prefer, or should this condition instead be exposed to the rolling-restart orchestrator rather than gating the server health endpoint? Let me know. thanks! |
|
I think the following mechanism could work:
|
|
Thanks @Jackie-Jiang. I updated the PR to follow the suggested mechanism:
The checks run concurrently and stop after readiness is established. I also added unit tests and an HTTP integration test covering the 200 and 503 responses. Let me know if you have any comments. thanks! |
|
Does this mean an unhealthy broker will also prevent servers from starting up? I'm trying to think if this might introduce a blocking situation where losing brokers and servers at the same time makes it impossible for either to go healthy. Either way, should this start behind a configuration default to off? |
Good point. We should introduce a timeout on broker check, and add a config to decide what's the behavior on broker check failure. |
agreed. though i think it might be worth it to go out in 2 release (one off/non-blocking, then the next one on) |
Signed-off-by: goutamadwant <workwithgoutam@gmail.com>
6cb2fe2 to
eaa2e98
Compare
Summary
IS_SHUTDOWN_IN_PROGRESSis clearedWhy
During startup,
ServiceStatuscan becomeGOODbefore the query server is started and before brokers can route queries back to the server. This allowed/healthand/health/readinessto return200too early during rolling restarts.The health resource uses the existing local readiness signal instead of reading Helix on every probe.
This addresses item 1 of #16565. The broker external-view watermark described in item 2 remains out of scope.
Testing
./mvnw -pl pinot-server -am -Dtest=HealthCheckResourceTest,AccessControlTest -Dsurefire.failIfNoSpecifiedTests=false test./mvnw spotless:apply -pl pinot-server./mvnw license:format -pl pinot-server./mvnw checkstyle:check -pl pinot-server./mvnw license:check -pl pinot-server./mvnw test-compile -pl pinot-server -am -Dmaven.compiler.showDeprecation=true -Dmaven.compiler.showWarnings=true '-Dmaven.compiler.compilerArgs=-Xlint:all'