Skip to content
  • Venkatesh Duggirala's avatar
    9b0e0168
    BUG#16418100 ERROR "WHEN GTID_NEXT IS SET TO A GTID" ROW BASED REPLICATION · 9b0e0168
    Venkatesh Duggirala authored
    Problem & Analysis:
    ===================
    When relay log info repository is configured to be persisted in a
    table, it is updated when transaction commits or explicit flush is called,
    like on relay log rotate. If a transaction that uses non-transactional
    engine is split across multiple relay logs, on relay log flush
    it will be partially committed. If GTID_MODE=ON and when partial transaction
    in first relay log is committed, it uses the current GTID value and sets
    GTID value to UNDEFINED GROUP. Hence it causes 'ER_GTID_NEXT_TYPE_UNDEFINED_GROUP'
    error when it is trying to commit the rest of the transaction.
    It also causes many other problems if the repository is updated in between
    the transaction and it should be avoided.
    
    Fix: relay log info repository should be updated on relay log
    rotate. But when the transaction is split across two relay logs,
    update the repository will cause unexpected results and should
    be postponed till the 'commit' of the transaction is executed.
    
    Introduced a flag that set to 'true' when this type of 'forced flush'(at the
    time of rotate relay log) is postponed due to transaction split
    across the relay logs. And the flag will be checked in flush_info function
    to see if there is a flush that got postponed earlier. If so, it will
    force the flush now irrespective of sync_relay_log_info value.
    9b0e0168
    BUG#16418100 ERROR "WHEN GTID_NEXT IS SET TO A GTID" ROW BASED REPLICATION
    Venkatesh Duggirala authored
    Problem & Analysis:
    ===================
    When relay log info repository is configured to be persisted in a
    table, it is updated when transaction commits or explicit flush is called,
    like on relay log rotate. If a transaction that uses non-transactional
    engine is split across multiple relay logs, on relay log flush
    it will be partially committed. If GTID_MODE=ON and when partial transaction
    in first relay log is committed, it uses the current GTID value and sets
    GTID value to UNDEFINED GROUP. Hence it causes 'ER_GTID_NEXT_TYPE_UNDEFINED_GROUP'
    error when it is trying to commit the rest of the transaction.
    It also causes many other problems if the repository is updated in between
    the transaction and it should be avoided.
    
    Fix: relay log info repository should be updated on relay log
    rotate. But when the transaction is split across two relay logs,
    update the repository will cause unexpected results and should
    be postponed till the 'commit' of the transaction is executed.
    
    Introduced a flag that set to 'true' when this type of 'forced flush'(at the
    time of rotate relay log) is postponed due to transaction split
    across the relay logs. And the flag will be checked in flush_info function
    to see if there is a flush that got postponed earlier. If so, it will
    force the flush now irrespective of sync_relay_log_info value.
Loading