Skip to content

Commit

Permalink
Merge pull request #2651 from sysown/v2.0.11-aux
Browse files Browse the repository at this point in the history
V2.0.11 aux
  • Loading branch information
renecannao authored Apr 25, 2020
2 parents 2df54a7 + 8a0e1c1 commit 543b96f
Show file tree
Hide file tree
Showing 4 changed files with 421 additions and 302 deletions.
1 change: 1 addition & 0 deletions include/MySQL_Session.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ class MySQL_Session
void generate_proxysql_internal_session_json(json &);
bool known_query_for_locked_on_hostgroup(uint64_t);
void unable_to_parse_set_statement(bool *);
bool has_any_backend();
};

#define KILL_QUERY 1
Expand Down
22 changes: 22 additions & 0 deletions include/MySQL_Thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,28 @@ class MySQL_Thread

Session_Regex **match_regexes;

#ifdef IDLE_THREADS
void worker_thread_assigns_sessions_to_idle_thread(MySQL_Thread *thr);
void worker_thread_gets_sessions_from_idle_thread();
void idle_thread_gets_sessions_from_worker_thread();
void idle_thread_assigns_sessions_to_worker_thread(MySQL_Thread *thr);
void idle_thread_check_if_worker_thread_has_unprocess_resumed_sessions_and_signal_it(MySQL_Thread *thr);
void idle_thread_prepares_session_to_send_to_worker_thread(int i);
void idle_thread_to_kill_idle_sessions();
#endif // IDLE_THREADS

unsigned int find_session_idx_in_mysql_sessions(MySQL_Session *sess);
bool move_session_to_idle_mysql_sessions(MySQL_Data_Stream *myds, unsigned int n);
bool set_backend_to_be_skipped_if_frontend_is_slow(MySQL_Data_Stream *myds, unsigned int n);
void handle_mirror_queue_mysql_sessions();
void handle_kill_queues();
void check_timing_out_session(unsigned int n);
void check_for_invalid_fd(unsigned int n);
void read_one_byte_from_pipe(unsigned int n);
void tune_timeout_for_myds_needs_pause(MySQL_Data_Stream *myds);
void tune_timeout_for_session_needs_pause(MySQL_Data_Stream *myds);
void configure_pollout(MySQL_Data_Stream *myds, unsigned int n);

protected:
int nfds;

Expand Down
10 changes: 10 additions & 0 deletions lib/MySQL_Session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6472,3 +6472,13 @@ void MySQL_Session::unable_to_parse_set_statement(bool *lock_hostgroup) {
}
}

bool MySQL_Session::has_any_backend() {
for (unsigned int j=0;j < mybes->len;j++) {
MySQL_Backend *tmp_mybe=(MySQL_Backend *)mybes->index(j);
MySQL_Data_Stream *__myds=tmp_mybe->server_myds;
if (__myds->myconn) {
return true;
}
}
return false;
}
Loading

0 comments on commit 543b96f

Please sign in to comment.