[Commits] MDEV-15796 MariaDB crashes on startup with semisync master

andrei.elkin at pp.inet.fi andrei.elkin at pp.inet.fi
Thu Apr 12 15:32:33 EEST 2018


Recent changes in semisync initialization via MDEV-13073 introduced
instantiation of THD too early from the server components
pov which led to segfault.

Fixed with relocating the semisync component initialization
to later time when thread specific memory can be used.
---
 sql/mysqld.cc | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index edac9d466f7..1edcf5633de 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -5189,13 +5189,6 @@ static int init_server_components()
                         "this server. However this will be ignored as the "
                         "--log-bin option is not defined.");
   }
-
-  if (repl_semisync_master.init_object() ||
-      repl_semisync_slave.init_object())
-  {
-    sql_print_error("Could not initialize semisync.");
-    unireg_abort(1);
-  }
 #endif
 
   if (opt_bin_log)
@@ -5267,6 +5260,15 @@ static int init_server_components()
   /* It's now safe to use thread specific memory */
   mysqld_server_initialized= 1;
 
+#ifdef HAVE_REPLICATION
+  if (repl_semisync_master.init_object() ||
+      repl_semisync_slave.init_object())
+  {
+    sql_print_error("Could not initialize semisync.");
+    unireg_abort(1);
+  }
+#endif
+
 #ifndef EMBEDDED_LIBRARY
   wsrep_thr_init();
 #endif
-- 
2.11.0



More information about the commits mailing list