MXS-1484: set binlog storage to TREE mode

When mariadb10_master_gtid is on the storage of binlog file is
automatically set to TREE mode.
This commit is contained in:
MassimilianoPinto
2017-10-23 11:25:19 +02:00
parent 37c804e0d3
commit 65dc9e0d30
3 changed files with 14 additions and 80 deletions

View File

@ -379,10 +379,8 @@ createInstance(SERVICE *service, char **options)
/* Set router uuid */
inst->uuid = config_copy_string(params, "uuid");
/* Enable Flat or Tree storage of binlog files */
inst->storage_type = config_get_enum(params,
"binlog_structure",
binlog_storage_values);
/* Set Flat storage of binlog files as default */
inst->storage_type = BLR_BINLOG_STORAGE_FLAT;
if (inst->uuid == NULL)
{
@ -549,13 +547,6 @@ createInstance(SERVICE *service, char **options)
{
inst->mariadb10_master_gtid = config_truth_value(value);
}
else if (strcmp(options[i], "binlog_structure") == 0)
{
/* Enable Flat or Tree storage of binlog files */
inst->storage_type = strcasecmp(value, "tree") == 0 ?
BLR_BINLOG_STORAGE_TREE :
BLR_BINLOG_STORAGE_FLAT;
}
else if (strcmp(options[i], "encryption_algorithm") == 0)
{
int ret = blr_check_encryption_algorithm(value);
@ -780,24 +771,12 @@ createInstance(SERVICE *service, char **options)
inst->mariadb10_compat = true;
}
/**
* Force GTID slave request handling if GTID Master registration is On
*/
if (inst->mariadb10_master_gtid)
{
/* Force GTID slave request handling */
inst->mariadb10_gtid = true;
}
if (!inst->mariadb10_master_gtid &&
inst->storage_type == BLR_BINLOG_STORAGE_TREE)
{
MXS_ERROR("%s: binlog_structure 'tree' mode can be enabled only"
" with MariaDB Master GTID registration feature."
" Please enable it with option"
" 'mariadb10_master_gtid = on'",
service->name);
free_instance(inst);
return NULL;
/* Force binlog storage as tree */
inst->storage_type = BLR_BINLOG_STORAGE_TREE;
}
/* Log binlog structure storage mode */
@ -806,6 +785,7 @@ createInstance(SERVICE *service, char **options)
inst->storage_type == BLR_BINLOG_STORAGE_FLAT ?
"'flat' mode" :
"'tree' mode using GTID domain_id and server_id");
/* Enable MariaDB the GTID maps store */
if (inst->mariadb10_compat &&
inst->mariadb10_gtid)