diff options
author | Andrei Elkin <andrei.elkin@mariadb.com> | 2021-06-10 16:28:53 +0300 |
---|---|---|
committer | Andrei Elkin <andrei.elkin@mariadb.com> | 2021-06-10 16:28:53 +0300 |
commit | 319c44636d16a6ee6f733df40927850b8331ad6a (patch) | |
tree | 8aa876eaba9aa686f83d3323492f8621f03f3a29 | |
parent | 9a3d996e37daa29d866899eb30fff7a58b603d12 (diff) | |
download | mariadb-git-bb-10.6_MDEV-18959.tar.gz |
MDEV-18959: Correcting related to MDEV-21117bb-10.6_MDEV-18959
Identification of the truncate candidate in case of
no-binlog-offset engines requires to store this type
of capability into Gtid event even with just one engine
transaction, when the engine is such.
-rw-r--r-- | sql/log.cc | 8 | ||||
-rw-r--r-- | sql/log_event.cc | 2 | ||||
-rw-r--r-- | sql/log_event_server.cc | 9 |
3 files changed, 10 insertions, 9 deletions
diff --git a/sql/log.cc b/sql/log.cc index e61c33ec728..83201f7688e 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -11245,8 +11245,12 @@ Recovery_context::handle_maybe_committed(xid_recovery_member **ptr_member, DBUG_ASSERT(*ha_offset_max <= last_gtid_coord); DBUG_ASSERT(member->in_engine_prepare >= member->engines_no_binlog); DBUG_ASSERT(last_gtid_engines_no_binlog >= member->engines_no_binlog); - if (last_gtid_engines == 1 || - last_gtid_engines_no_binlog > + + /* + Check if the transaction has at least one commmitted branch + which can be only by an no-binlog-offset engine. + */ + if (last_gtid_engines_no_binlog > (member->in_engine_prepare - member->engines_no_binlog)) { member->decided_to_commit= true; // exists a committed branch diff --git a/sql/log_event.cc b/sql/log_event.cc index cda8c2fe5e3..7abc1e850b7 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -2625,7 +2625,7 @@ Gtid_log_event::Gtid_log_event(const char *buf, uint event_len, if (extra_engines < UCHAR_MAX) engines_no_binlog= *buf++; - DBUG_ASSERT(extra_engines > 0); + DBUG_ASSERT(extra_engines > 0 || engines_no_binlog > 0); } } /* diff --git a/sql/log_event_server.cc b/sql/log_event_server.cc index 20b35c592b4..5ceaa6eccd6 100644 --- a/sql/log_event_server.cc +++ b/sql/log_event_server.cc @@ -3302,12 +3302,9 @@ Gtid_log_event::Gtid_log_event(THD *thd_arg, uint64 seq_no_arg, extra_engines= ha_count_rw_2pc(thd_arg, thd_arg->in_multi_stmt_transaction_mode(), &binlog_recovery_info_count) - 1; - if (extra_engines > 0) - { - DBUG_ASSERT(extra_engines + 1 >= binlog_recovery_info_count); + engines_no_binlog= (extra_engines + 1) - binlog_recovery_info_count; - engines_no_binlog= extra_engines + 1 - binlog_recovery_info_count; - } + DBUG_ASSERT(extra_engines + 1 >= binlog_recovery_info_count); } else if (ro_1pc) { @@ -3320,7 +3317,7 @@ Gtid_log_event::Gtid_log_event(THD *thd_arg, uint64 seq_no_arg, uint8 count= ha_count_rw_2pc(thd_arg, true); extra_engines= count > 1 ? 0 : UCHAR_MAX; } - if (extra_engines > 0) + if (extra_engines > 0 || engines_no_binlog > 0) flags_extra|= FL_EXTRA_MULTI_ENGINE; } } |