From a3053a432529079da4ce67290aa9f6e32b2d98c6 Mon Sep 17 00:00:00 2001 From: XCheng <613902+endoplasmicR@users.noreply.github.com> Date: Fri, 12 Mar 2021 17:21:06 -0800 Subject: [PATCH] Updated the doc for graceful shutdown operations Explain the behaviour of presto gateway deactivation of backends --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index c6588cf7..8679ae9e 100644 --- a/README.md +++ b/README.md @@ -276,6 +276,18 @@ To delete a global property, specify the corresponding name (type String). curl -X POST http://localhost:8080/presto/globalproperty/delete/{INSERT_NAME_HERE} ``` +## Graceful shutdown +Presto gateway supports graceful shutdown of Presto clusters. Even when a cluster is deactivated, any submitted query states can still be retrieved based on the Query ID. + +To graceful shutdown a Presto cluster without query losses, the steps are: +1. Set the backend to deactivate state, this prevents any new incoming queries from getting assigned to the backend. +2. Poll the Presto backend coorinator URL until the queued query count and the running query count both hit 0. +3. Terminate the Presto Coordinator & Worker Java process. + + +To gracefully shutdown a single worker process, see [this](https://trino.io/docs/current/admin/graceful-shutdown.html) for the operations. + + ## Contributing Want to help build Presto Gateway? Check out our [contributing documentation](CONTRIBUTING.md)