-
Notifications
You must be signed in to change notification settings - Fork 129
Add a timeout for the backend stats collection query #583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
b005207 to
4d3a8a4
Compare
gateway-ha/src/main/java/io/trino/gateway/ha/clustermonitor/ClusterStatsJdbcMonitor.java
Outdated
Show resolved
Hide resolved
gateway-ha/src/test/java/io/trino/gateway/ha/clustermonitor/TestClusterStatsMonitor.java
Outdated
Show resolved
Hide resolved
gateway-ha/src/main/java/io/trino/gateway/ha/clustermonitor/ClusterStatsJdbcMonitor.java
Outdated
Show resolved
Hide resolved
4d3a8a4 to
69d1e4d
Compare
oneonestar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Just want to confirm my understanding. Is this correct?
explicitPrepare is True by default in Trino JDBC.
explicitPrepare is False by default in Trino Gateway.
gateway-ha/src/main/java/io/trino/gateway/ha/config/MonitorConfiguration.java
Outdated
Show resolved
Hide resolved
gateway-ha/src/test/java/io/trino/gateway/ha/clustermonitor/TestClusterStatsMonitor.java
Outdated
Show resolved
Hide resolved
gateway-ha/src/main/java/io/trino/gateway/ha/clustermonitor/ClusterStatsJdbcMonitor.java
Show resolved
Hide resolved
@oneonestar your understanding is correct. Trino JDBC is being more conservative about preserving compatibility with older versions by default. I think it is a nice optimization since it reduces the number of health check queries by a factor of 2, and it has been available for >1 year now. But I could easily be convinced to default it to |
69d1e4d to
80fe966
Compare
gateway-ha/src/main/java/io/trino/gateway/ha/clustermonitor/ClusterStatsJdbcMonitor.java
Show resolved
Hide resolved
Unlike clients, admins have full control over the version of Trino and Trino Gateway(and the JDBC driver embedded). I think it's okay to use 'False' as the default in the Trino Gateway. Maybe consider adding some docs. |
Default the stats collection query to use EXECUTE IMMEDIATE by default, with the option to use explicit PREPARE if desired
80fe966 to
160cc96
Compare
|
@oneonestar documentation added |
160cc96 to
662314d
Compare
Add a timeout for the backend stats collection query.
Default the stats collection query to use EXECUTE IMMEDIATE by default, with the option to use explicit PREPARE if desired
Description
The stats collection query uses the traditional PREPARE/EXECUTE sequence to collect stats on the number of queued and running queries. There is a 10 second timeout on the PREPARE, however there is no timeout on the EXECUTE phase. This can cause issues on clusters that may be able to process the PREPARE quickly, but not the EXECUTE. This is configured as a Duration:
In addition, the default mode has been updated to use EXECUTE IMMEDIATE to skip the prepare step. This has been available since 431. If needed to support earlier versions of Trino, explicit PREPARE can be enabled by setting:
Additional context and related issues
Release notes
( ) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
(x) Release notes are required, with the following suggested text:
* Configure query timeout and use EXECUTE IMMEDIATE for backend stats collection