← Back to team overview

maria-developers team mailing list archive

Re: a Query_log_event charset bug in parallel replication

 

Hi nanyi607rao, sorry for the delayed response, in part due to the Easter holidays.

"nanyi607rao" <nanyi607rao@xxxxxxxxx> writes:

> If character_set in different Query_log_events changed, worker threads may apply them with wrong character_set. the codes leading this problem is in Query_log_event::do_apply_event, that is:
>       if (charset_inited)
>       {
>         if (rli->cached_charset_compare(charset))
>         {
>           /* Verify that we support the charsets found in the event. */
>           if (!(thd->variables.character_set_client=
>                 get_charset(uint2korr(charset), MYF(MY_WME))) ||
>               !(thd->variables.collation_connection=
>                 get_charset(uint2korr(charset+2), MYF(MY_WME))) ||
>               !(thd->variables.collation_server=
>                 get_charset(uint2korr(charset+4), MYF(MY_WME))))
>           {
>
> There is a charset[6] in rli, which cached last Query_log_event's charset in serial replication. But in parallel replication it would lead mistake, because every worker thread can read and set rli->charset[6], so rli->charset[6] isn't any worker threads' last Query_log_event charset. but rli->charset[6] can affect every worker threads' thd->variables.character_set_* setting.

Right, I see. Probably the cached_charset just needs to be moved into the
rpl_group_info struct.

I have filed a bug for this that I will fix:

    https://mariadb.atlassian.net/browse/MDEV-6156

Thanks a lot for finding this, as usual your input on parallel replication is
most useful, keep it coming!

 - Kristian.


Follow ups

References