mirror of https://github.com/citusdata/citus.git
With this commit, we implement two views that are very similar to pg_stat_activity, but showing queries that are involved in distributed queries: - citus_dist_stat_activity: Shows all the distributed queries - citus_worker_stat_activity: Shows all the queries on the shards that are initiated by distributed queries. Both views have the same columns in the outputs. In very basic terms, both of the views are meant to provide some useful insights about the distributed transactions within the cluster. As the names reveal, both views are similar to pg_stat_activity. Also note that these views can be pretty useful on Citus MX clusters. Note that when the views are queried from the worker nodes, they'd not show the distributed transactions that are initiated from the coordinator node. The reason is that the worker nodes do not know the host/port of the coordinator. Thus, it is advisable to query the views from the coordinator. If we bucket the columns that the views returns, we'd end up with the following: - Hostnames and ports: - query_hostname, query_hostport: The node that the query is running - master_query_host_name, master_query_host_port: The node in the cluster initiated the query. Note that for citus_dist_stat_activity view, the query_hostname-query_hostport is always the same with master_query_host_name-master_query_host_port. The distinction is mostly relevant for citus_worker_stat_activity. For example, on Citus MX, a users starts a transaction on Node-A, which starts worker transactions on Node-B and Node-C. In that case, the query hostnames would be Node-B and Node-C whereas the master_query_host_name would Node-A. - Distributed transaction related things: This is mostly the process_id, distributed transactionId and distributed transaction number. - pg_stat_activity columns: These two views get all the columns from pg_stat_activity. We're basically joining pg_stat_activity with get_all_active_transactions on process_id. |
||
---|---|---|
.. | ||
backend | ||
include | ||
test/regress |