From daef8ad5d76bd413e27d4c643c3f888ecac0e0cb Mon Sep 17 00:00:00 2001 From: MassimilianoPinto Date: Thu, 7 Sep 2017 17:27:57 +0200 Subject: [PATCH] With GTID master registration always get filename from GTID repo With GTID master registration always get filename from GTID repo. The filestem option is not written if binlog_name is not set: this is not needed by GTID registration. router->fileroot is set when last name is loaded from GTID repo. --- server/modules/routing/binlogrouter/blr_file.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/server/modules/routing/binlogrouter/blr_file.c b/server/modules/routing/binlogrouter/blr_file.c index fb0865800..2796ed54d 100644 --- a/server/modules/routing/binlogrouter/blr_file.c +++ b/server/modules/routing/binlogrouter/blr_file.c @@ -328,7 +328,7 @@ blr_file_init(ROUTER_INSTANCE *router) */ /* - 1 - try to find a binlog file number by reading the directory */ - if (router->storage_type == BLR_BINLOG_STORAGE_FLAT) + if (!router->mariadb10_master_gtid) { root_len = strlen(router->fileroot); if ((dirp = opendir(path)) == NULL) @@ -3133,7 +3133,12 @@ blr_file_write_master_config(ROUTER_INSTANCE *router, char *error) fprintf(config_file, "master_port=%d\n", router->service->dbref->server->port); fprintf(config_file, "master_user=%s\n", router->user); fprintf(config_file, "master_password=%s\n", router->password); - fprintf(config_file, "filestem=%s\n", router->fileroot); + + /* write filestem only if binlog file is set */ + if (*router->binlog_name != 0) + { + fprintf(config_file, "filestem=%s\n", router->fileroot); + } /* Add SSL options */ if (router->ssl_enabled)