Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2.0.11 aux #2651

Merged
merged 6 commits into from
Apr 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/MySQL_Session.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,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 @@ -98,6 +98,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 @@ -7226,3 +7226,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