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

plugin mysql: add multisource replication support #4133

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/collectd.conf.pod
Original file line number Diff line number Diff line change
Expand Up @@ -5487,7 +5487,7 @@ Synopsis:
Host "localhost"
Socket "/var/run/mysql/mysqld.sock"
SlaveStats true
MariaDb false
MariadbDialect false
SlaveNotifications true
</Database>

Expand Down Expand Up @@ -5563,9 +5563,9 @@ Enable the collection of primary / replica statistics in a replication setup. In
order to be able to get access to these statistics, the user needs special
privileges. See the B<User> documentation above. Defaults to B<false>.

=item B<MariaDb> I<true|false>
=item B<MariadbDialect> I<true|false>

Enable Multisource replication Mariadb support.
Enable Multisource replication MariadbDialect support.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may sound like splitting hairs or overly critical, but what should "MariadbDialect" be? I think this needs a little bit more explanation, what exactly does this switch do?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, added like in telegraf :)


=item B<SlaveNotifications> I<true|false>

Expand Down
8 changes: 4 additions & 4 deletions src/mysql.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ struct mysql_database_s /* {{{ */

bool primary_stats;
bool replica_stats;
bool mariadb;
bool mariadb_dialect;
bool innodb_stats;
bool wsrep_stats;

Expand Down Expand Up @@ -199,8 +199,8 @@ static int mysql_config_database(oconfig_item_t *ci) /* {{{ */
status = cf_util_get_boolean(child, &db->replica_stats);
else if (strcasecmp("SlaveNotifications", child->key) == 0)
status = cf_util_get_boolean(child, &db->replica_notif);
else if (strcasecmp("MariaDb", child->key) == 0)
status = cf_util_get_boolean(child, &db->mariadb);
else if (strcasecmp("MariadbDialect", child->key) == 0)
status = cf_util_get_boolean(child, &db->mariadb_dialect);
else if (strcasecmp("InnodbStats", child->key) == 0)
status = cf_util_get_boolean(child, &db->innodb_stats);
else if (strcasecmp("WsrepStats", child->key) == 0)
Expand Down Expand Up @@ -449,7 +449,7 @@ static int mysql_read_replica_stats(mysql_database_t *db, MYSQL *con) {
#define EXEC_MASTER_LOG_POS_IDX 4
#define SECONDS_BEHIND_MASTER_IDX 5

if (db->mariadb && db->mysql_version >= 50505) {
if (db->mariadb_dialect && db->mysql_version >= 50505) {
query = "SHOW ALL SLAVES STATUS";
channel_name_field = "Connection_name";
} else {
Expand Down