-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Add query or API to see what queries are running in the cluster #654
Comments
See also: http://www.postgresql.org/docs/9.2/static/monitoring-stats.html#PG-STAT-ACTIVITY-VIEW for insipration. |
brainstorm, not sure if this idea is useful at all. |
Some additional thoughts on implementing this. It's going to be very tricky in the clustered setup. I would expect some sort of new state object that tracks the running queries on a server. When a query comes into a server, it should have an id assigned. The protocol should be updated to track this id and send to the servers that run it locally. The originatingServerId + queryId tuple should be enough to identify any query running in the cluster. When a query comes in to list the running queries, you'll have to hit every server in the cluster to get the answer. If the query language is updated to handle this, then it can just be passed as a query to every server. Then have the coordinator intercept the query and pass off info from the query state object. When a kill is sent, it should go to the originating server, which will then call out to all the other servers that it had sent the query to. It doesn't make sense to push this stuff through Raft. It doesn't need to be replicated and besides, doing that would cause the number of queries running in the cluster to not be scalable. Hope any of that makes sense/helps. |
Thanks for the help @pauldix. As I understood it, the requirements can be logically decomposed as such:
[0] Please excuse the possible misleading nomenclature. Coordinator here means the server which the client communicates with. Correct me if there is a better name. |
Closing in favor of #5939. |
We need visibility into what queries are running in the cluster on which nodes and for how long. This should be a new query type like:
Which return a table of results like:
The text was updated successfully, but these errors were encountered: