summaryrefslogtreecommitdiff
path: root/sql/repl_failsafe.cc
diff options
context:
space:
mode:
authorDavi Arnaut <davi.arnaut@oracle.com>2010-07-23 17:09:27 -0300
committerDavi Arnaut <davi.arnaut@oracle.com>2010-07-23 17:09:27 -0300
commit97c3182312568d856e040f8d788f1ee0291717c1 (patch)
tree541cfc3d5f16c89cdcacdc7babd0c0fdf9de16a0 /sql/repl_failsafe.cc
parentf31c0483217ba1de24c1e0bfb1c0c8009006cf4d (diff)
downloadmariadb-git-97c3182312568d856e040f8d788f1ee0291717c1.tar.gz
WL#5498: Remove dead and unused source code
Remove code that has been disabled for a long time.
Diffstat (limited to 'sql/repl_failsafe.cc')
-rw-r--r--sql/repl_failsafe.cc96
1 files changed, 0 insertions, 96 deletions
diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc
index 9a1f7fb826b..18a5303bf96 100644
--- a/sql/repl_failsafe.cc
+++ b/sql/repl_failsafe.cc
@@ -71,42 +71,6 @@ static Slave_log_event* find_slave_event(IO_CACHE* log,
functions like register_slave()) are working.
*/
-#if NOT_USED
-static int init_failsafe_rpl_thread(THD* thd)
-{
- DBUG_ENTER("init_failsafe_rpl_thread");
- thd->system_thread = SYSTEM_THREAD_DELAYED_INSERT;
- /*
- thd->bootstrap is to report errors barely to stderr; if this code is
- enable again one day, one should check if bootstrap is still needed (maybe
- this thread has no other error reporting method).
- */
- thd->bootstrap = 1;
- thd->security_ctx->skip_grants();
- my_net_init(&thd->net, 0);
- thd->net.read_timeout = slave_net_timeout;
- thd->max_client_packet_length=thd->net.max_packet;
- mysql_mutex_lock(&LOCK_thread_count);
- thd->thread_id= thd->variables.pseudo_thread_id= thread_id++;
- mysql_mutex_unlock(&LOCK_thread_count);
-
- if (init_thr_lock() || thd->store_globals())
- {
- /* purecov: begin inspected */
- close_connection(thd, ER_OUT_OF_RESOURCES, 1); // is this needed?
- statistic_increment(aborted_connects,&LOCK_status);
- one_thread_per_connection_end(thd,0);
- DBUG_RETURN(-1);
- /* purecov: end */
- }
-
- thd->mem_root->free= thd->mem_root->used= 0;
- thd_proc_info(thd, "Thread initialized");
- thd->set_time();
- DBUG_RETURN(0);
-}
-#endif
-
void change_rpl_status(RPL_STATUS from_status, RPL_STATUS to_status)
{
mysql_mutex_lock(&LOCK_rpl_status);
@@ -623,66 +587,6 @@ err:
}
-#if NOT_USED
-int find_recovery_captain(THD* thd, MYSQL* mysql)
-{
- return 0;
-}
-#endif
-
-#if NOT_USED
-pthread_handler_t handle_failsafe_rpl(void *arg)
-{
- DBUG_ENTER("handle_failsafe_rpl");
- THD *thd = new THD;
- thd->thread_stack = (char*)&thd;
- MYSQL* recovery_captain = 0;
- const char* msg;
-
- pthread_detach_this_thread();
- if (init_failsafe_rpl_thread(thd) || !(recovery_captain=mysql_init(0)))
- {
- sql_print_error("Could not initialize failsafe replication thread");
- goto err;
- }
- mysql_mutex_lock(&LOCK_rpl_status);
- msg= thd->enter_cond(&COND_rpl_status,
- &LOCK_rpl_status, "Waiting for request");
- while (!thd->killed && !abort_loop)
- {
- bool break_req_chain = 0;
- mysql_cond_wait(&COND_rpl_status, &LOCK_rpl_status);
- thd_proc_info(thd, "Processing request");
- while (!break_req_chain)
- {
- switch (rpl_status) {
- case RPL_LOST_SOLDIER:
- if (find_recovery_captain(thd, recovery_captain))
- rpl_status=RPL_TROOP_SOLDIER;
- else
- rpl_status=RPL_RECOVERY_CAPTAIN;
- break_req_chain=1; /* for now until other states are implemented */
- break;
- default:
- break_req_chain=1;
- break;
- }
- }
- }
- thd->exit_cond(msg);
-err:
- if (recovery_captain)
- mysql_close(recovery_captain);
- delete thd;
-
- DBUG_LEAVE; // Must match DBUG_ENTER()
- my_thread_end();
- pthread_exit(0);
- return 0; // Avoid compiler warnings
-}
-#endif
-
-
/**
Execute a SHOW SLAVE HOSTS statement.