Skip to content

Commit 21940ba

Browse files
committed
BUG#20478089: SUPPRESS VIEW_CHANGE_LOG_EVENT MISSING MTS SEQUENCE NUMBER
When logical clock slave parallel applier is ON, binary log events fields sequence_number and last_committed are used to control the window on which events may be applied in parallel. These fields are set on Gtid_log_event for all transactions/statements. View_change_log_event, which marks a member join or leave from Group Replication membership, is a special event that doesn't have sequence_number and last_committed fields and should be treated as a single transaction. So the warning thrown when a View_change_log_event is read from relay log is misleading and should be suppressed for that type. Removed the warnings of missing sequence_number and last_committed on View_change_log_event. Also improved channel_get_appliers_thread_id() function pointers handling.
1 parent cc6a028 commit 21940ba

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

sql/rpl_channel_service_interface.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,11 +457,12 @@ int channel_get_appliers_thread_id(const char* channel,
457457
(unsigned long*) my_malloc(PSI_NOT_INSTRUMENTED,
458458
num_workers * sizeof(unsigned long),
459459
MYF(MY_WME));
460+
unsigned long *appliers_id_pointer= *appliers_id;
460461

461-
for (int i = 0; i < num_workers; i++)
462+
for (int i= 0; i < num_workers; i++, appliers_id_pointer++)
462463
{
463464
mysql_mutex_lock(&mi->rli->workers.at(i)->info_thd_lock);
464-
*appliers_id[i]= mi->rli->workers.at(i)->info_thd->thread_id();
465+
*appliers_id_pointer= mi->rli->workers.at(i)->info_thd->thread_id();
465466
mysql_mutex_unlock(&mi->rli->workers.at(i)->info_thd_lock);
466467
}
467468

sql/rpl_mts_submode.cc

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -561,16 +561,22 @@ Mts_submode_logical_clock::schedule_next_event(Relay_log_info* rli,
561561
/*
562562
Either master is old, or the current group of events is malformed.
563563
In either case execution is allowed in effectively sequential mode, and warned.
564+
565+
View_change_log_event is expected not to have sequence_number,
566+
thence the exception.
564567
*/
565-
sql_print_warning("Either event (relay log name:position) (%s:%llu) "
566-
"is from an old master therefore is not tagged "
567-
"with logical timestamps, or the current group of "
568-
"events miss a proper group header event. Execution is "
569-
"proceeded, but it is recommended to make sure "
570-
"replication is resumed from a valid start group "
571-
"position.",
572-
rli->get_event_relay_log_name(),
573-
rli->get_event_relay_log_pos());
568+
if (ev->get_type_code() != binary_log::VIEW_CHANGE_EVENT)
569+
{
570+
sql_print_warning("Either event (relay log name:position) (%s:%llu) "
571+
"is from an old master therefore is not tagged "
572+
"with logical timestamps, or the current group of "
573+
"events miss a proper group header event. Execution is "
574+
"proceeded, but it is recommended to make sure "
575+
"replication is resumed from a valid start group "
576+
"position.",
577+
rli->get_event_relay_log_name(),
578+
rli->get_event_relay_log_pos());
579+
}
574580
}
575581
first_event= false;
576582
}

0 commit comments

Comments
 (0)