Hi Everyone, Our pinot is not highly available . ...
# troubleshooting
r
Hi Everyone, Our pinot is not highly available . Setup: Pinot 1.4.0 on EKS (managed nodegroup, maxUnavailable=1), realtime+offline table, replicasPerPartition=2, queried via multi-stage engine (fan-out scan), Adaptive Server Selection=HYBRID on brokers. Problem: During a rolling node/AMI patch, a server’s graceful shutdown closes its gRPC query port while the broker still selects it (ONLINE in ExternalView). The MSE query dispatch f_ails with UNAVAILABLE and does not fail over to the healthy replica, so fan-out queries return partialResult=true, 0 rows even though replication=2. Fresh servers are also routable before segments are ONLINE (no readiness gate)._ _*Questions:* (_1) Recommended routing-aware graceful drain (preStop/instance-disable/shutdown status check) so the broker stops routing before the port closes? (2) Recommended readinessProbe so a server is routable only when segments are ONLINE? (3) Does MSE have any replica failover/retry, or is a server-health-gated rolling update the right approach?
Hi, @Mayank can I get some suggestion on this ? Thanks!
m
Hi, 1.4 is quite old, we mentioned in another thread to upgrade to 1.6, as we have built several enhancements and fixes into MSE
r
Hi Mayank thanks for the response , will propose this switch to team, but for the current version do you have any suggestions ?
m
@Gonzalo Ortiz any thoughts ^*
r
Some concrete findings from our incident: - Graceful shutdown does run — we see Shutting down Pinot server + Starting shutdown query check, and IS_SHUTDOWN_IN_PROGRESS is set. But brokers kept dispatching to that server for minutes afterward. It looks like two windows: (a) broker routing-refresh lag during a continuous node roll, and (b) the new server incarnation is ONLINE in Helix ExternalView while still loading segments (not yet serving on the query port). - terminationGracePeriodSeconds is 30s; publishNotReadyAddresses: true is already set on both headless services; no readinessProbe.
x
how do you handle graceful shutdown? are you sending kill 0 signal or kill 9 signal? What’s the graceful period for the waiting ? All those things should be configurable. I would say, try to increase the k8s
terminationGracePeriodSeconds
to 10 mins. Then broker should graceful shutdown within this time
r
Thanks! Our current setup: - Signal: k8s sends SIGTERM on pod termination (EKS node drain / rollout) — graceful, not SIGKILL. We can confirm the graceful path runs: the server logs Shutting down Pinot server → Starting shutdown query check, sets IS_SHUTDOWN_IN_PROGRESS, then closes ports. - Graceful period: terminationGracePeriodSeconds = 30 currently. We’ll bump it to 600s as you suggested.
One thing we want to sanity-check before relying on the grace-period bump: in our incident the server actually finished graceful shutdown in ~15s (050421 → 050436) and exited well within the 30s — because shutdownQueryCheck had no in-flight queries to drain, so it returned almost immediately and the gRPC port closed. The problem was that brokers kept routing to it for minutes afterward — i.e., the broker routing-table refresh lagged behind the server leaving. Since terminationGracePeriodSeconds is a max (the server can exit earlier), will simply raising it keep the server in rotation long enough for brokers to converge? Or do we also need something that makes the server wait until brokers stop routing — e.g. pinot.server.shutdown.enableResourceCheck=true (wait for ExternalView to show its segments OFFLINE), a shutdown delay, or a preStop _QUERIES_DISABLE + wait?_
Also, a big part of our window was the startup side: the freshly-restarted server re-registered as ONLINE in Helix before its segments finished loading, so brokers routed to it while it couldn’t serve yet (publishNotReadyAddresses: true is set). Grace period doesn’t cover this — what’s the recommended way to keep a booting server out of routing until it’s query-ready (readiness on ServiceStatus=GOOD)?
g
I looked at the 1.4.0 code and I think there are three separate things going on. First, the shutdown query check doesn’t see multi-stage queries. It only tracks queries that go through the single-stage scheduler, so for MSE traffic it always thinks the server is idle. It just waits
noQueryThresholdMs
, which defaults to the 15s query timeout. That’s exactly the 15s you measured. On 1.4 you can raise
pinot.server.shutdown.noQueryThresholdMs
(for example to 60s), and it acts as a fixed delay after the server flags itself as shutting down. Keep
terminationGracePeriodSeconds
comfortably above that.
enableResourceCheck
won’t help, because it runs after the query ports are already closed. Second, the startup side is most likely not the external view. In 1.4 a restarting server stays flagged as shutting down until the service status check passes, and only then does it open the MSE port. So brokers shouldn’t route to it early, unless that check is disabled or timed out (look for “Service status has not turned GOOD” in the server log). What does match your symptom is that the broker’s gRPC channel to the restarted server stays in exponential reconnect backoff for up to a couple of minutes and fails fast with UNAVAILABLE. That was fixed in 1.5 by apache/pinot#17466. 1.5 also made broker routing updates much more parallel, which matters during a long node roll. Third, on Kubernetes, a readinessProbe won’t change Pinot routing, because brokers use Helix and not service endpoints. But it does pace the drain. Without it, a restarted server pod is Ready immediately, so the next node gets drained while the previous server is still loading segments, and both replicas of a segment can be down at the same time. That alone can give you empty results with replication 2. I’d add a
readinessProbe
on
GET :8097/health/readiness
(it returns 503 during startup and shutdown) and a
PodDisruptionBudget
with
maxUnavailable: 1
on the servers. MSE doesn’t retry a query on another replica.
You can set pinot.broker.failure.detector.type=CONNECTION
so a broker stops routing to a server after the first failed dispatch, which limits the damage to a few queries. apache/pinot#18268 in 1.6 makes that more complete. So upgrading is still the real fix, but the probe, the PDB and the shutdown delay should get you most of the way on 1.4.
r
Thank you @Gonzalo Ortiz. Considering moving to SSE initially MSE was used because we were using joins which is not the case now. Not sure of the latency implications . But in SSE fresh connection is restarted everytime , since stale grpc connection was the issue in our case.