.../perfschema/table_replication_connection_status.cc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/mysql-5.7.20/storage/perfschema/table_replication_connection_status.cc b/mysql-5.7.20/storage/perfschema/table_replication_connection_status.cc index 5cdaa97b..ec109326 100644 --- a/mysql-5.7.20/storage/perfschema/table_replication_connection_status.cc +++ b/mysql-5.7.20/storage/perfschema/table_replication_connection_status.cc @@ -236,6 +236,7 @@ void table_replication_connection_status::make_row(Master_info *mi) DBUG_ENTER("table_replication_connection_status::make_row"); m_row_exists= false; bool error= false; + bool mgr = false; /* Default values */ m_row.group_name_is_null= true; @@ -246,14 +247,20 @@ void table_replication_connection_status::make_row(Master_info *mi) DBUG_ASSERT(mi != NULL); DBUG_ASSERT(mi->rli != NULL); + if (is_group_replication_plugin_loaded() && + channel_map.is_group_replication_channel_name(mi->get_channel(), true)) + { + mgr = true; + mysql_mutex_lock(&LOCK_group_replication_handler); + } + mysql_mutex_lock(&mi->data_lock); mysql_mutex_lock(&mi->rli->data_lock); m_row.channel_name_length= mi->get_channel() ? strlen(mi->get_channel()):0; memcpy(m_row.channel_name, mi->get_channel(), m_row.channel_name_length); - if (is_group_replication_plugin_loaded() && - channel_map.is_group_replication_channel_name(mi->get_channel(), true)) + if (mgr) { /* Group Replication applier channel. @@ -355,6 +362,9 @@ end: mysql_mutex_unlock(&mi->rli->data_lock); mysql_mutex_unlock(&mi->data_lock); + if (mgr) + mysql_mutex_unlock(&LOCK_group_replication_handler); + if (!error) m_row_exists= true; DBUG_VOID_RETURN;