Hey all, I am trying to configure a Pinot cluster ...
# troubleshooting
y
Hey all, I am trying to configure a Pinot cluster to have 0 downtime in case of rolling restart while running on k8s. For that, I configured pool-based instance assignment for the realtime table. There are 2 pools (
pool1_REALTIME
and
pool1_OFFLINE
) on the cluster and each has size of 3, each pool has 8 instances. so in total there are 24 servers. Part of realtime table config about instance assignment is in 🧵. With this configuration, I am expecting to not to observe any partial response/traffic loss during server pod restarts. Regardless of rolling restart or single pool at a time(8 pods) restart, I measure between 10% to 25% traffic loss. These tests are done on a table that is running 5 QPS and broker has adaptive server selection enabled, based on latency. My observation is that, pinot controller/broker is not able to identify the server is down, so it is still routing queries to the restarting servers. So here are my questions • is anything looks odd in my config? • is there anyone who is able to configure 0 downtime restart behaviour? • is there any config option to identify servers faster which are not healthy anymore?
Copy code
"instanceAssignmentConfigMap": {
      "CONSUMING": {
        "tagPoolConfig": {
          "tag": "pool1_REALTIME",
          "poolBased": true,
          "numPools": 3
        },
        "replicaGroupPartitionConfig": {
          "replicaGroupBased": true,
          "numReplicaGroups": 3,
          "numInstancesPerReplicaGroup": 8,
          "minimizeDataMovement": false
        },
        "partitionSelector": "INSTANCE_REPLICA_GROUP_PARTITION_SELECTOR",
        "minimizeDataMovement": false
      },
      "COMPLETED": {
        "tagPoolConfig": {
          "tag": "pool1_OFFLINE",
          "poolBased": true,
          "numPools": 3
        },
        "replicaGroupPartitionConfig": {
          "replicaGroupBased": true,
          "numReplicaGroups": 3,
          "numInstancesPerReplicaGroup": 0,
          "numPartitions": 3,
          "numInstancesPerPartition": 8,
          "minimizeDataMovement": false
        },
        "partitionSelector": "INSTANCE_REPLICA_GROUP_PARTITION_SELECTOR",
        "minimizeDataMovement": false
      }
    }
m
You don’t need all these just for rolling restart. If you are seeing 10-25% queries thr problem is likely elsewhere. Can you check broker log on whether it rebuilds routing table when a server goes down? It might also be that your server is reporting ready before it actually is
y
@Mayank thanks for that. we have custom readiness checks on top of existing ones. server reports itself ready when all of its segments have reached to
ONLINE|CONSUMING
state. I am not sure about the rebuilding of routing table, so far I cannot find anything useful in the logs. Is there a way to trigger that externally?
m
You shouldn’t need to rebuilding it externally, when a server marks itself down, broker gets to know about it and it rebuilds the routing table. It definitely logs a message about it. If you are not seeing that message, that is really odd
y
so, it is server’s responsibility to mark itself down then. is it via helix variable
"shutdownInProgress": "false"
? or how can I validate that server is marking itself as down ?
m
Yes that’s how it works
If you are not gracefully shutting down server but just killing thr pod, that could be a reason
y
here is the cmd:
kubectl rollout restart ..
i guess this should do a graceful reboots
@Mayank I tried few different cmd to kill pod gracefully, but
shutdownInProgress
never set to true, even with 10 minutes of grace period. can there be anything else that somehow blocks the broker to trigger rebuilding of routing table ?
m
There may be other flags like helix enabled etc, none of them are set? Are you definitely not seeing broker rebuilding routing table in the logs?
y
I see this
..update routing entry for 1 tables..
but in some other cluster, I see
Building routing for table:XXX
when I restart a server. I see
HELIX_ENABLED": "true"
on both broker and servers.
m
Do you see this in server log:
Copy code
"Shutting down Pinot server"
It sets the shutDownInProgress. If you don't see that, then likely this is not being called in the way you do rolling restarts.
y
@Mayank appreciate the help, because this statement does not exists in the logs. it is clear that I should work toward this direction.
m
One thing to check is if the server gets enough time to react to the k8s termination signal and go through proper shutdown, before the pod is deleted.
y
trying with
--grace-period=600
flag now 🙂
m
Ok. If that still doesn't work, then that means shutdown hook is not registered.
y
with more gentle termination of pinot server process (via SIGTERM
pkill --signal SIGTERM java
), I managed to see some logs
Copy code
2024/12/10 10:05:44.302 INFO [BaseServerStarter] [Thread-43] Shutting down Pinot server
2024/12/10 10:05:44.302 INFO [ZKHelixAdmin] [Thread-43] Set configs with keys
2024/12/10 10:05:44.456 INFO [BaseServerStarter] [Thread-43] Starting shutdown query check
2024/12/10 10:05:44.456 INFO [BaseServerStarter] [Thread-43] Sleep for 4319846ms as there are still incoming queries (no query time: 0ms is smaller than the threshold: 4320000ms)
Intentionally I put 12 hours of timeout, but it is somehow failing to wait for that long and process is killed within 2-3 minutes. btw, I am using pinot v.1.2.0.
m
I timeout of 5-10min should be more than enough. Unless you are running queries with very high timeouts (in minutes)?
y
I guess it is related to gracePeriod configuration of the pod. regardless of this config, k8s scheduler is killing the pod 30 seconds after sending SIGTERM. Current query timeout is 60 seconds for the largest table so timeline simply does not makes sense. I will try to create a more gentle killing schedule for the pods 🙂