Skip to content
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

inputs.mysql: field type conflict: input field "gtid_mode" - string vs integer #6646

Closed
zarnovican opened this issue Nov 11, 2019 · 1 comment · Fixed by #6647
Closed

inputs.mysql: field type conflict: input field "gtid_mode" - string vs integer #6646

zarnovican opened this issue Nov 11, 2019 · 1 comment · Fixed by #6647
Labels
area/mysql bug unexpected problem or unintended behavior
Milestone

Comments

@zarnovican
Copy link
Contributor

Relevant telegraf.conf:

[[inputs.mysql]]
  servers = ["monitoring:xxx@tcp(hostname:3306)/?tls=false"]
  metric_version = 2
  interval_slow = "1m"

System info:

Telegraf 1.12.4

Remote mysql version: 5.7.22-log, 5.7.26-log

The two mysql servers are Amazon RDS in master-slave setup. It should be reproducible outside AWS as well.

Steps to reproduce:

Monitor two mysql servers with different gtid_mode variable. One with boolean-like value and the other without.

mysql> show global variables like '%gtid_mode%';
+---------------+----------------+
| Variable_name | Value          |
+---------------+----------------+
| gtid_mode     | OFF_PERMISSIVE |
+---------------+----------------+
mysql> show global variables like '%gtid_mode%';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| gtid_mode     | OFF   |
+---------------+-------+

Expected behavior:

No errors.

Actual behavior:

Nov 11 18:12:09 monitoring telegraf[8487]: 2019-11-11T18:12:09Z E! [outputs.influxdb] when writing to [https://influxdb.foo.com:8086]: received error partial write: field type conflict: input field "gtid_mode" on measurement "mysql_variables" is type string, already exists as type integer dropped=1; discarding points

Additional info:

From the MySQL doc, it seems that gtid_mode could contain four different values and should never be treated as boolean. I guess, that's where this integer is coming from.

@danielnelson danielnelson added area/mysql bug unexpected problem or unintended behavior labels Nov 11, 2019
@danielnelson danielnelson added this to the 1.12.5 milestone Nov 11, 2019
@danielnelson
Copy link
Contributor

It looks like the PERMISSIVE variations may be new in MySQL 5.7. Since we are currently storing these as an boolean integer OFF = 1 and ON = 1, we could squash OFF_PERMISSIVE = 0 and ON_PERMISSIVE = 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/mysql bug unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants