Skip to content

Updating service parameters unlinks historical QAN data #4866

@skurpad7

Description

@skurpad7

Description

In a MySQL service configured on PMM, we are unable to run Explain on a few queries on the QAN dashboard as they are truncated because they're greater than 2KB in length. The resolution for this issue is to increase the --max-query-length parameter for the service. Currently, PMM does not support updating the service configuration. I came across this community post which suggests removing the MySQL service and then adding it again with the --max-query-length=-1 parameter as it is not expected to delete historical data.

I tested the same and noticed that although the older queries are not erased, PMM throws an error when I try to run Explain on the QAN dashboard.

As seen below, before removing the service, Explain on the query works:

Image

Once the service is removed and added back with the below command, Explains stop working with the following error: Service with ID "c5179c1a-04e9-49a7-a878-53c455248906" not found..

root@localhost:~# pmm-admin remove mysql
Service removed.

root@localhost:~# pmm-admin add mysql --username=<username> --password=<password> --query-source slowlog --size-slow-logs="-1GiB" --socket /run/mysqld/mysqld.sock  --service-name=mysql1 --max-query-length=-1
MySQL Service added.
Service ID  : f08aca1c-40fc-47d3-bffd-388cf6b4d6d0
Service name: mysql1

Table statistics collection enabled (the limit is 1000, the actual table count is 342).

Image

Expected Results

  • Explains on the older queries still work.

Actual Results

  • Explains on the older queries stop working with error Service with ID "<previous_id>" not found..

Version

PMM Server and Client v3.5.0

Steps to reproduce

  • Setup a MySQL service on PMM.
  • Run a query through MySQL such that it is recorded on QAN.
  • Verify that Explain on the query works.
  • Remove the service and add it again with the same name.
  • It is seen that Explain no longer works on the old query.

Code of Conduct

  • I agree to follow Percona Community Code of Conduct

Metadata

Metadata

Assignees

Labels

bugBug report

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions