Skip to content

Commit

Permalink
Execute free floating metadata event in sync mode
Browse files Browse the repository at this point in the history
Summary:
Free floating metadata event (e.g. metadata events that come
before rotates in raft mode) should be handled in sync mode.

Reviewed By: anirbanr-fb

Differential Revision: D24936864

fbshipit-source-id: 8052be49eb2
  • Loading branch information
abhinav04sharma authored and facebook-github-bot committed Mar 13, 2021
1 parent 9486d32 commit 50a8e29
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sql/log_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -1557,6 +1557,11 @@ class Log_event
enum enum_mts_event_exec_mode get_mts_execution_mode(ulong slave_server_id,
bool mts_in_group)
{
// Case: If we're not in a middle of a group (aka trx) and this is a
// metadata event, then this must be a free floating metadata event and
// should be executed in sync mode
if (get_type_code() == METADATA_EVENT && !mts_in_group)
return EVENT_EXEC_SYNC;
if ((get_type_code() == FORMAT_DESCRIPTION_EVENT &&
((server_id == (uint32) ::server_id) || (log_pos == 0))) ||
(get_type_code() == ROTATE_EVENT &&
Expand Down

0 comments on commit 50a8e29

Please sign in to comment.