queries_history table does not record queries
search cancel

queries_history table does not record queries

book

Article ID: 295875

calendar_today

Updated On:

Products

VMware Tanzu Greenplum

Issue/Introduction

Symptoms:
The queries_history table does not show recently processed queries.

Environment


Cause

From the gpmmon log located in $MASTER_DATA_DIRECTORY/gpperfmon/logs :
2018-11-05 12:30:03|:-WARNING: [gpmondb.c:1132] ---- HARVEST queries FAILED ---- on query insert into queries_history select * from _queries_tail; with error ERROR:  data line too long. likely due to invalid csv data  (entry db xxxx:xxxx pid=xxxxx)
DETAIL:  External table _queries_tail, line 361 of execute:cat gpperfmon/data/_queries_tail.dat 2> /dev/null || true: "2018-11-05 


This issue is caused by an incorrectly formatted entry in the _queries_tail.dat file.
This may be due to several factors, including, but not limited to: an extra long message, stack trace, or incomplete logging due to a crash.

Resolution

It is possible to rename or remove the _queries_tail.dat file, but note that this will remove any included queries from the history table ( potential history data loss ).

From the error message, it is generally possible to identify and remove or correct the offending line:
DETAIL:  External table _queries_tail, line 361 of execute:cat gpperfmon/data/_queries_tail.dat 2> /dev/null || true: "2018-11-05 

In this instance, `gpperfmon/data/_queries_tail.dat` contains an error before line 361 --

You may be able to locate the error with a limit on `select * from _queries_tail` or it may be necessary to allow the tail file to process in chunks in order to find the offending record.

Contact pivotal support if you require assistance in locating or correcting a corrupted history record.