maria-developers team mailing list archive
-
maria-developers team
-
Mailing list archive
-
Message #11315
Re: Conservative parallel slave is "too optimistic" for certain engines
-
To:
Kristian Nielsen <knielsen@xxxxxxxxxxxxxxx>
-
From:
andrei.elkin@xxxxxxxxxx
-
Date:
Fri, 01 Jun 2018 16:27:09 +0300
-
Cc:
maria-developers@xxxxxxxxxxxxxxxxxxx
-
In-reply-to:
<87o9gvx0w8.fsf@urd.knielsen-hq.org> (Kristian Nielsen's message of "Thu, 31 May 2018 18:09:27 +0200")
-
Organization:
Home sweet home
-
Razorgate-kas:
Status: not_detected
-
Razorgate-kas:
Rate: 0
-
Razorgate-kas:
Envelope from:
-
Razorgate-kas:
Version: 5.5.3
-
Razorgate-kas:
LuaCore: 80 2014-11-10_18-01-23 260f8afb9361da3c7edfd3a8e3a4ca908191ad29
-
Razorgate-kas:
Lua profiles 69136 [Nov 12 2014]
-
Razorgate-kas:
Method: none
-
User-agent:
Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)
Kristian, Sergey, hello!
> Sergey Petrunia <sergey@xxxxxxxxxxx> writes:
>
>> == Symptoms ==
>> When one runs a parallel slave (mode=conservative) and replicates DML for
> Nice analysis. Normally it is guaranteed to be safe to start the next
> transaction in parallel with the commit step of a prior. But as you
> describe, RBR on table with no primary key is special, since it does not
> really correspond to any SQL-level operation.
>
>> 2. Change parallel slave to wait *for commit*. This should only be done if
>> tables that are updated do not support Gap Locking. This is hard, it will
>> require making risky changes on the SQL layer.
>
> I think you can just call thd->wait_for_prior_commit() in the code that does
> the RBR table scan on a table with no primary key. Eg.
> Rows_log_event::find_row():
>
> if (m_key_info)
> {
> ...
> }
> else
> {
> DBUG_PRINT("info",("locating record using table scan (rnd_next)"));
> thd->wait_for_prior_commit();
> ...
> }
>
> (Or do it only once, maybe in Rows_log_event::find_key() or similar, and
> only if rli->mi->parallel_mode==SLAVE_PARALLEL_CONSERVATIVE).
Right, without the if the OPTIMISTIC could not be called such :-).
To me it's the best feasible solution, consistent with the name.
Andrei
References