Skip to content

Instantly share code, notes, and snippets.

@nirbhayc
Created June 2, 2016 20:19
Show Gist options
  • Save nirbhayc/5c453ac70f3cba5d5af1e2418dee3385 to your computer and use it in GitHub Desktop.
Save nirbhayc/5c453ac70f3cba5d5af1e2418dee3385 to your computer and use it in GitHub Desktop.
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 6c8f79b..9b99798 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -5194,6 +5194,7 @@ static int init_server_components()
tc_log= 0; // ha_initialize_handlerton() needs that
+ printf("======> plugin_init() called..\n");
if (plugin_init(&remaining_argc, remaining_argv,
(opt_noacl ? PLUGIN_INIT_SKIP_PLUGIN_TABLE : 0) |
(opt_abort ? PLUGIN_INIT_SKIP_INITIALIZATION : 0)))
@@ -5202,6 +5203,7 @@ static int init_server_components()
unireg_abort(1);
}
plugins_are_initialized= TRUE; /* Don't separate from init function */
+ printf("======> plugins initalized..\n");
/* we do want to exit if there are any other unknown options */
if (remaining_argc > 1)
diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc
index 2f35e6c..1d32de2 100644
--- a/sql/wsrep_mysqld.cc
+++ b/sql/wsrep_mysqld.cc
@@ -1756,6 +1756,17 @@ pthread_handler_t start_wsrep_THD(void *arg)
THD *thd;
wsrep_thd_processor_fun processor= (wsrep_thd_processor_fun)arg;
+ if (processor == wsrep_rollback_process)
+ {
+ printf("======> Starting wsrep rollbacker thread.. sleeping..\n");
+ my_sleep(5000000);
+ printf("======> wsrep rollbacker thread. cont..\n");
+ }
+ else
+ {
+ printf("======> Starting wsrep applier thread.\n");
+ }
+
if (my_thread_init() || (!(thd= new THD(true))))
{
goto error;
@@ -1832,6 +1843,15 @@ pthread_handler_t start_wsrep_THD(void *arg)
thd->set_command(COM_SLEEP);
thd->init_for_queries();
+ if (processor == wsrep_rollback_process)
+ {
+ printf("======> wsrep rollbacker thread.. init_for_queries() called..\n");
+ }
+ else
+ {
+ printf("======> wsrep applier thread.. init_for_queries() called..\n");
+ }
+
mysql_mutex_lock(&LOCK_thread_count);
wsrep_running_threads++;
mysql_cond_broadcast(&COND_thread_count);
diff --git a/sql/wsrep_mysqld.h b/sql/wsrep_mysqld.h
index ea81384..9ec5653 100644
--- a/sql/wsrep_mysqld.h
+++ b/sql/wsrep_mysqld.h
@@ -160,10 +160,12 @@ int wsrep_show_status(THD *thd, SHOW_VAR *var, char *buff,
/* new defines */
extern void wsrep_stop_replication(THD *thd);
extern bool wsrep_start_replication();
+/* MDEV-10161 */
extern bool wsrep_must_sync_wait(THD* thd, uint mask = WSREP_SYNC_WAIT_BEFORE_READ);
extern bool wsrep_sync_wait(THD* thd, uint mask = WSREP_SYNC_WAIT_BEFORE_READ);
extern int wsrep_check_opts();
extern void wsrep_prepend_PATH (const char* path);
+extern void wsrep_rollback_process(THD *thd);
/* Other global variables */
extern wsrep_seqno_t wsrep_locked_seqno;
diff --git a/sql/wsrep_thd.cc b/sql/wsrep_thd.cc
index fb48c1a..ca4fa79 100644
--- a/sql/wsrep_thd.cc
+++ b/sql/wsrep_thd.cc
@@ -410,7 +410,7 @@ void wsrep_create_appliers(long threads)
}
}
-static void wsrep_rollback_process(THD *thd)
+void wsrep_rollback_process(THD *thd)
{
DBUG_ENTER("wsrep_rollback_process");
diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc
index 5fdd2a9..192a3cb 100644
--- a/storage/maria/ha_maria.cc
+++ b/storage/maria/ha_maria.cc
@@ -3558,6 +3558,8 @@ static int ha_maria_init(void *p)
#endif
maria_hton= (handlerton *)p;
+ printf("====== ha_maria_init() ======> Sleeping..\n");
+ my_sleep(8000000);
maria_hton->state= SHOW_OPTION_YES;
maria_hton->db_type= DB_TYPE_ARIA;
maria_hton->create= maria_create_handler;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment