Skip to content
  • Nuno Carvalho's avatar
    868d3a1f
    BUG#21348278: ENABLE SLAVE PARALLEL APPLIER RECOVERY GTID BASED · 868d3a1f
    Nuno Carvalho authored
    Parallel applier recovery, which happens after the sequence:
    STOP SLAVE, START SLAVE; is based on master log name and position,
    on Group Replication we have several masters what makes impossible
    to recover parallel applier from that information.
    Since we always have GTID_MODE=ON on Group Replication, we can
    ignore the positions completely, seek the current relay log to the
    beginning and start from there. Already applied transactions will be
    skipped due to GTIDs auto skip feature and applier will resume from
    the last applied transaction.
    
    This patch fix the above issue and also introduce some more changes:
     1) Parallel applier recovery based on GTIDs instead of
        file+position.
        This change will only affect Group Replication applier.
        Files changed: rpl_slave.cc
    
     2) Sequential execution of transactions on logical clock parallel
        applier, by setting transaction logical timestamps to (0,0).
        This was already implemented on server, but since it was not a
        valid code path, there was a warning. Now we have a valid code
        path, so warning was removed.
        Files changed: log_event.cc, rpl_mts_submode.cc
    
     3) Adapt UNTIL_SQL_VIEW_ID to parallel applier.
        Parallel applier cannot be stopped on a ongoing transaction, so
        UNTIL_SQL_VIEW_ID condition, the stop condition for Group
        Replication distributed recovery, was adjusted to take that into
        consideration.
        Files changed: rpl_rli.h, rpl_rli.cc, rpl_slave.cc
    
     4) Disallow FLUSH RELAY LOGS FOR CHANNEL "group_replication_applier".
        To avoid that DBA splits transactions among relay logs, the
        command FLUSH RELAY LOGS was disabled for channel
        "group_replication_applier".
        Files changed: rpl_slave.cc, share/errmsg-utf8.txt
    
     5) Extend Trans_context_info structure with parallel applier
        options.
        Group Replication doesn't support database parallel applier, in
        order to prevent its use, it will check if it is in use and
        error out.
        Files changed: replication.h, rpl_group_replication.cc,
                       rpl_handler.cc
    
     6) Add channel_flush() function to rpl_channel_service_interface
        Provide a API function to flush relay logs from within a plugin,
        so that START GROUP_REPLICATION can rotate applier relay log.
        Files changed: rpl_channel_service_interface.h,
                       rpl_channel_service_interface.cc
    868d3a1f
    BUG#21348278: ENABLE SLAVE PARALLEL APPLIER RECOVERY GTID BASED
    Nuno Carvalho authored
    Parallel applier recovery, which happens after the sequence:
    STOP SLAVE, START SLAVE; is based on master log name and position,
    on Group Replication we have several masters what makes impossible
    to recover parallel applier from that information.
    Since we always have GTID_MODE=ON on Group Replication, we can
    ignore the positions completely, seek the current relay log to the
    beginning and start from there. Already applied transactions will be
    skipped due to GTIDs auto skip feature and applier will resume from
    the last applied transaction.
    
    This patch fix the above issue and also introduce some more changes:
     1) Parallel applier recovery based on GTIDs instead of
        file+position.
        This change will only affect Group Replication applier.
        Files changed: rpl_slave.cc
    
     2) Sequential execution of transactions on logical clock parallel
        applier, by setting transaction logical timestamps to (0,0).
        This was already implemented on server, but since it was not a
        valid code path, there was a warning. Now we have a valid code
        path, so warning was removed.
        Files changed: log_event.cc, rpl_mts_submode.cc
    
     3) Adapt UNTIL_SQL_VIEW_ID to parallel applier.
        Parallel applier cannot be stopped on a ongoing transaction, so
        UNTIL_SQL_VIEW_ID condition, the stop condition for Group
        Replication distributed recovery, was adjusted to take that into
        consideration.
        Files changed: rpl_rli.h, rpl_rli.cc, rpl_slave.cc
    
     4) Disallow FLUSH RELAY LOGS FOR CHANNEL "group_replication_applier".
        To avoid that DBA splits transactions among relay logs, the
        command FLUSH RELAY LOGS was disabled for channel
        "group_replication_applier".
        Files changed: rpl_slave.cc, share/errmsg-utf8.txt
    
     5) Extend Trans_context_info structure with parallel applier
        options.
        Group Replication doesn't support database parallel applier, in
        order to prevent its use, it will check if it is in use and
        error out.
        Files changed: replication.h, rpl_group_replication.cc,
                       rpl_handler.cc
    
     6) Add channel_flush() function to rpl_channel_service_interface
        Provide a API function to flush relay logs from within a plugin,
        so that START GROUP_REPLICATION can rotate applier relay log.
        Files changed: rpl_channel_service_interface.h,
                       rpl_channel_service_interface.cc
Loading