← Back to team overview

maria-developers team mailing list archive

Re: Mdev-10664 Add statuses about optimistic parallel replication stalls.


Sachin Setiya <sachin.setiya@xxxxxxxxxxx> writes:

> To my surprise slave_parallel_mode is replication channel specific ,
> while slave_parallel threadsis a global variable, Why So ?

There is a single pool of worker threads, to enable threads to be shared
among multi-source connections - for example so all threads can work on one
busy connection while another is idle. That is why slave_parallel_threads
must be global. In contrast, it is perfectly possible to run one
multi-source connection in conservative mode, and another in optimistic, for

> And in mariadb documentation I was unable to find which variable is
> replication channel specific and which variable is global one.

Hm, if it's not documented that slave_parallel_mode is per-channel, that is
unfortunate (this is something that was introduced for 10.1).

> Yep, because if there is DDL statement or non transnational statement
> it is executed alone.
> So no need of mutex.

Right, but you still need _some_ way to synchronise multiple threads
incrementing the counter simultaneously (it is perfectly possible for two
non-transactional event groups to execute concurrently in conservative mode,
for example).

>> The name "statements" is very confusing here, since you are counting event
>> groups, not individual statements.
> Changed It to event total_ddl_events , total_non_trans_events

It's not individual events. It is "event groups", though this is mostly a
terminology internally in the source code.

The term "transaction" is unfortunate for something that is
non-transactional. The name "event group" is also bad, as it is unfamiliar
to users, I think.

Maybe "total_ddl_events" is ok. I think in most cases only one statement at
a time can be in an event group, when it is non-transactional or DDL. Though
multiple binlog events will be involved for the single statement.

>From this, _statement might also be ok, though it is somewhat unfortunate in
case of row-based replication, where no SQL statements are involved at all
on the slave.

So baring better ideas, I guess *_events is ok, just be sure to make it
clear in the documentation exactly what is counted.

 - Kristian.