Fix and improve binlogrouter GTID option processing

The transaction safety was checked even if master GTID registration was
disabled. This always caused a failure when the router was started without
the transaction safety parameter.

As transaction safety is required by the GTID registration, it is not very
helpful to refuse to start if an invalid set of options is detected. To
make usage of the master GTID registration easier, the transaction safety
is also automatically enabled.
This commit is contained in:
Markus Mäkelä
2017-11-07 09:24:18 +02:00
parent 4f01ff1955
commit 4bca9aa023
2 changed files with 15 additions and 23 deletions

View File

@ -770,6 +770,8 @@ createInstance(SERVICE *service, char **options)
{
/* Force GTID slave request handling */
inst->mariadb10_gtid = true;
/* Force transaction safety */
inst->trx_safe = true;
/* Force binlog storage as tree */
inst->storage_type = BLR_BINLOG_STORAGE_TREE;
}
@ -782,18 +784,8 @@ createInstance(SERVICE *service, char **options)
"'tree' mode using GTID domain_id and server_id");
/* Enable MariaDB the GTID maps store */
if (inst->mariadb10_compat &&
inst->mariadb10_gtid)
if (inst->mariadb10_compat && inst->mariadb10_master_gtid)
{
if (!inst->trx_safe)
{
MXS_ERROR("MariaDB GTID can be enabled only"
" with Transaction Safety feature."
" Please enable it with option 'transaction_safety = on'");
free_instance(inst);
return NULL;
}
/* Create/Open R/W GTID sqlite3 storage */
if (!blr_open_gtid_maps_storage(inst))
{