Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
85a36958
Commit
85a36958
authored
Jul 08, 2024
by
Yuchen Pei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-27902 Some Spider code documentation regarding first_link_idx and remote HANDLER commands
parent
14c40509
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
0 deletions
+35
-0
storage/spider/ha_spider.cc
storage/spider/ha_spider.cc
+19
-0
storage/spider/ha_spider.h
storage/spider/ha_spider.h
+6
-0
storage/spider/spd_db_include.h
storage/spider/spd_db_include.h
+1
-0
storage/spider/spd_trx.cc
storage/spider/spd_trx.cc
+9
-0
No files found.
storage/spider/ha_spider.cc
View file @
85a36958
...
...
@@ -12918,6 +12918,15 @@ void ha_spider::sync_from_clone_source_base(
DBUG_VOID_RETURN
;
}
/*
Set the initial values for each dbton_handler's first_link_idx and
strict_group_by.
First, reset first_link_idx to -1.
Then, for each active remote server, if the corresponding
dbton_handler has not been set yet (first_link_idx == -1), set its
first_link_idx to be the index of the connection.
*/
void
ha_spider
::
set_first_link_idx
()
{
int
roop_count
,
all_link_idx
;
...
...
@@ -12957,6 +12966,16 @@ void ha_spider::set_first_link_idx()
DBUG_VOID_RETURN
;
}
/*
Reset the initial values for each dbton_handler's first_link_idx to
-1.
Also, set the search_link_idx'th active server's first_link_idx to
search_link_idx.
search_link_idx is commonly randomly set using
spider_conn_first_link_idx - see the commentary of that function.
*/
void
ha_spider
::
reset_first_link_idx
()
{
int
all_link_idx
;
...
...
storage/spider/ha_spider.h
View file @
85a36958
...
...
@@ -167,7 +167,13 @@ class ha_spider final : public handler
ulonglong
*
db_request_id
;
uchar
*
db_request_phase
;
uchar
*
m_handler_opened
;
/* ids for use in HANDLER command */
uint
*
m_handler_id
;
/*
aliases for use in HANDLER command, in the format of t%5u on
m_handler_id. So for example, if m_handler_id is 3, then the
corresponding m_handler_cid is t00003
*/
char
**
m_handler_cid
;
#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS
bool
do_direct_update
;
...
...
storage/spider/spd_db_include.h
View file @
85a36958
...
...
@@ -1135,6 +1135,7 @@ class spider_db_handler
uint
dbton_id
;
ha_spider
*
spider
;
spider_db_share
*
db_share
;
/* Index of active server, used in query construction. */
int
first_link_idx
;
bool
strict_group_by
=
false
;
bool
no_where_cond
=
false
;
...
...
storage/spider/spd_trx.cc
View file @
85a36958
...
...
@@ -3933,6 +3933,15 @@ void spider_reuse_trx_ha(
DBUG_VOID_RETURN
;
}
/**
Sets link indices for load balancing read connections
Assuming `spider->share->link_count` is the number of active servers
to use, this function updates `spider->conn_link_idx` with the first
server in the same "modulus group" whose link status is not
`SPIDER_LINK_STATUS_NG`, or if one cannot be found, use the
`link_idx`th server
*/
void
spider_trx_set_link_idx_for_all
(
ha_spider
*
spider
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment