What to do when gpperfmon GUI shows incorrect results in the current queries running

posted Apr 28, 2017, 4:50 PM by Sachchida Ojha
If you see this happening in any customer environment, collect the following information and provide in JIRA (MPP-14212).
A screent shot from the web GUI when the problem occurs.
Output of: psql -c 'select * from pg_stat_activity'>pg_stat_activity.out
Output of: psql -c 'select * from queries_now;' gpperfmon > queries_now.out
Output of: tar -cvf data.tar $MASTER_DATA_DIRECTORY/gpperfmon/data
Master database log files from pg_logs for the query start time "ctime" in queries_now table.

Workaround to clear these queries from gpperfmon database:
Check this query is currently running and active in gp_stat_activity. If this shows in pg_stat_activity, it means query is still running. Otherwise, continue next steps to clear.

Identify the details of query using the following query.

QueryID in gpperfmon Web is combination of tmid,ssid, ccnt columns in queries_now table in gpperfmon table. 


gpperfmon=# select tmid,ssid,ccnt, query_text from queries_now;
tmid | ssid | ccnt | query_text 
1320351986 | 135763 | 14 | SELECT count(*) from abc1 as a , abc1 as b,abc1 as c ;

Manually remove the query text files from master node.

# cd $MASTER_DATA_DIRECTORY/gpperfmon/data
# ls -l |grep 1320351986-135763-14
-rw------- 1 gpadmin gpadmin 65 Nov 22 14:54 q1320351986-135763-14.txt
# rm q1320351986-135763-14.txt

Refresh gpperfmon web browser and wait for few minutes, Query should have cleared from web browser now.