← Back to team overview

maria-developers team mailing list archive

Re: Obsolete GTID domain delete on master (MDEV-12012, MDEV-11969)

 

Kristian Nielsen <knielsen@xxxxxxxxxxxxxxx> writes:

> andrei.elkin@xxxxxxxxxx writes:
>
>> Then a function to discard a domain term would do:
>>
>>  SET @@gtid_binlog_state=gtid_discard_domain(@@gtid_binlog_state,'d')
>>
>> While this time it would be new object introduced still it's of var
>> setting semantics and might be generally useful too.
>
> I'm not sure I understand.
> Would this function magically lock the binlog until the SET
> gtid_binlog_state completes, to solve the race?
>

> Or just a convenience for the user to not have to do the string replace
> operation manually?

The 2nd one.

While it replaces p.3 SET the first p.1 SELECT into @pre_purge_state  in

  >>   mysql> /* 1. */ SELECT @@global.gtid_binlog_state into
  >>   mysql> @pre_purge_state;
  >>   mysql> /* 2. */ PURGE LOGS to 'b.2'
  >>   mysql> /* 3. */ SET
  >>   mysql> @@global.gtid_binlog_state="REPLACE"(@pre_purge_state,
  >>   mysql> '0-1-1', '');

is unnecessary.

So the function would subtract 'd' term from the current @@gtid_binlog_state
right at the point of new value SET invocation. This solves concurrent
updates to other than 'd' terms which will be reflected in the new
binlog file (SET handler therefore gains your version of FLUSH logics).

Andrei


References