From 4f7317579e700a8ac4375b3b85e5fb1a91a1a20f Mon Sep 17 00:00:00 2001 From: Monty Date: Sat, 29 Apr 2023 20:39:50 +0300 Subject: [PATCH] Fixed "Trying to lock uninitialized mutex' in parallel replication The problem was that mutex_init() was called after the worker was put into the domain_hash, which allowed other threads to access it before mutex was initialized. --- sql/rpl_parallel.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sql/rpl_parallel.cc b/sql/rpl_parallel.cc index 746c923ba44..96b319c5f4a 100644 --- a/sql/rpl_parallel.cc +++ b/sql/rpl_parallel.cc @@ -2317,9 +2317,7 @@ rpl_parallel::find(uint32 domain_id) mysql_cond_init(key_COND_parallel_entry, &e->COND_parallel_entry, NULL); if (my_hash_insert(&domain_hash, (uchar *)e)) { - mysql_cond_destroy(&e->COND_parallel_entry); - mysql_mutex_destroy(&e->LOCK_parallel_entry); - my_free(e); + free_rpl_parallel_entry(e); return NULL; } }