33## Overview
44
55Trino Gateway checks incoming requests to see if they're related to previous
6- ones it handled. If they are, then Trino Gateway sends them to the same backend
7- that dealt with the earlier requests.
6+ ones it handled. If they are, then Trino Gateway sends them to the same
7+ Trino cluster that dealt with the earlier requests.
88
99If it is a new request, the Trino Gateway refers to [ Routing rules] ( routing-rules.md )
10- to decide which group of backends , called a 'Routing Group,' should handle it.
11- It then picks a backend from that Routing Group to handle the request using
10+ to decide which group of clusters , called a 'Routing Group,' should handle it.
11+ It then picks a cluster from that Routing Group to handle the request using
1212either an adaptive or round-robin strategy.
1313
1414![ Request Routing Flow] ( assets/gateway-routing-flow.svg )
1515
1616## Sticky routing
1717
1818A request related to an ongoing process, or to state maintained on a single
19- backend cluster, must be routed to that backend for proper handling. Two
19+ Trino cluster, must be routed to that cluster for proper handling. Two
2020mechanisms for identifying related requests are currently implemented. By default,
2121only routing based on query identifier is enabled.
2222
2323### Routing based on query identifier (default)
2424
2525When a query is initiated through the Trino Gateway, the query id will be
26- extracted from the response and mapped to the backend that provided the
26+ extracted from the response and mapped to the cluster that provided the
2727response. Any subsequent request containing that query id will be forwarded
28- to that backend . For example, to retrieve query results, the trino client
28+ to that cluster . For example, to retrieve query results, the Trino client
2929polls a URI of the form
3030` v1/statement/executing/queryid/nonce/counter ` . The Trino Gateway will extract
3131the queryid from this URI.
3232
3333### Routing based on cookies
3434
35- OAuth2 authentication requires that the same backend is used for each step of
35+ OAuth2 authentication requires that the same cluster is used for each step of
3636the handshake. When ` gatewayCookieConfiguration.enabled ` is set to true, a cookie
3737will be added to requests made to paths beginning with ` /oauth2 ` unless they already have
38- a cookie present, which is used to route further ` /oauth2/* ` requests to the correct backend .
38+ a cookie present, which is used to route further ` /oauth2/* ` requests to the correct cluster .
3939Cookies are not added to requests to ` v1/* ` and other Trino endpoints.
4040
4141Trino Gateway signs its cookies to ensure that they are not tampered with. You
@@ -54,7 +54,7 @@ the paths used to define the OAuth handshake may be modified.
5454
5555`routingPaths` : If the request URI starts with a path in this list, then
5656* If no cookie is present, add a routing cookie
57- * If a cookie is present, route the request to the backend defined by that cookie
57+ * If a cookie is present, route the request to the cluster defined by that cookie
5858
5959`deletePaths` : If the request URI starts with a path in this list,
6060return a response that instructs the client to delete the cookie.
0 commit comments