Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-6156

Parallel replication incorrectly caches charset between worker threads

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.0.10
    • Fix Version/s: 10.0.11
    • Component/s: None
    • Labels:
      None

      Description

      As reported by nanyi607rao on maria-developers@lists.launchpad.net:

      > 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))

      Clearly, the rli cannot be used to cache charset between Queries when parallel
      replication is used.

      Probably the solution is to move the cached_charset stuff from Relay_log_info
      into rpl_group_info.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              knielsen Kristian Nielsen added a comment -

              Pushed to 10.0

              Thanks to nanyi607rao for tracking down and reporting this bug!

              Show
              knielsen Kristian Nielsen added a comment - Pushed to 10.0 Thanks to nanyi607rao for tracking down and reporting this bug!
              Hide
              knielsen Kristian Nielsen added a comment -

              Unfortunately, my patch for this is completely wrong.

              Putting cached charset in the rpl_group_info is no better than Relay_log_info. Because there are multiple rpl_group_info objects used in one worker thread, and the value of cached_charset in one of them need have no relation to what is currently set in the THD.

              Show
              knielsen Kristian Nielsen added a comment - Unfortunately, my patch for this is completely wrong. Putting cached charset in the rpl_group_info is no better than Relay_log_info. Because there are multiple rpl_group_info objects used in one worker thread, and the value of cached_charset in one of them need have no relation to what is currently set in the THD.
              Hide
              knielsen Kristian Nielsen added a comment -

              I've pushed a better patch to 10.0 for this.

              Now the cached_charset is stored in the THD that it is keeping cached information for, so that the wrong cache info will not be used for the wrong THD.

              Show
              knielsen Kristian Nielsen added a comment - I've pushed a better patch to 10.0 for this. Now the cached_charset is stored in the THD that it is keeping cached information for, so that the wrong cache info will not be used for the wrong THD.

                People

                • Assignee:
                  knielsen Kristian Nielsen
                  Reporter:
                  knielsen Kristian Nielsen
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: