← Back to team overview

maria-developers team mailing list archive

Re: Review of patch for MDEV-4820


Vilho Raatikka <vilho.raatikka@xxxxxxxxxx> writes:

> What exactly does it require for the user to enable strict or 'relaxed'
> (=disasterous imho) mode?

Technically, one needs to SET GLOBAL gtid_strict_mode=1 with root privileges
(config file option works as well of course). That's it.

The practical issue is that old-style MariaDB/MySQL replication allows a
number of "disasterous" uses. One example is a multi-master ring
A->B->C->A, writing to all masters simultaneously. In such setup, it is
fundamentally impossible to automatically eg. move a slave S from A->S to B->S
- there is just not enough information about what events have been applied to
S from A, B, and C. GTID introduces a way to configure this correctly
(replication domains), but if we were to give an error by default then we
would break upgrades from 5.5. So instead we provide gtid strict mode, so that
once users understand what the "disasterous" uses are and how to avoid them,
they can enable strict mode and get saner semantics.

BTW, for the normal non-advanced user, I think silly stuff like running random
manual transactions on slaves that get into the binlog is a far more common
mistake. Gtid strict mode will cause errors on this, so it needs to be
explictly enabled by users to not break/confuse upgrades.

> Is it possible at any point in server's life cycle to check which mode it
> is running?

SHOW VARIABLES or SELECT @@GLOBAL.gtid_strict_mode will show the current
value. But there is no way to check if it was enabled eg. two weeks ago, if
that is what you are asking (the value is not stored in the binlog).

> Can that setting be modified during runtime or only prior startup?

It can be changed at any time, though I think you need to STOP SLAVE/START
SLAVE to get the change to take effect on a slave.

 - Kristian.

Follow ups