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
13a9bcc6
Commit
13a9bcc6
authored
Nov 13, 2014
by
sjaakola
Committed by
Nirbhay Choubey
May 08, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refs #11 #13 - skipping TOI, if all affected tables are temporary
parent
21bc3e3f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
10 deletions
+30
-10
sql/wsrep_mysqld.cc
sql/wsrep_mysqld.cc
+30
-10
No files found.
sql/wsrep_mysqld.cc
View file @
13a9bcc6
...
...
@@ -1240,6 +1240,12 @@ create_view_query(THD *thd, uchar** buf, size_t* buf_len)
return
wsrep_to_buf_helper
(
thd
,
buff
.
ptr
(),
buff
.
length
(),
buf
,
buf_len
);
}
/*
returns:
0: statement was replicated as TOI
1: TOI replication was skipped
-1: TOI replication failed
*/
static
int
wsrep_TOI_begin
(
THD
*
thd
,
char
*
db_
,
char
*
table_
,
const
TABLE_LIST
*
table_list
)
{
...
...
@@ -1278,6 +1284,7 @@ static int wsrep_TOI_begin(THD *thd, char *db_, char *table_,
struct
wsrep_buf
buff
=
{
buf
,
buf_len
};
if
(
!
buf_err
&&
wsrep_prepare_keys_for_isolation
(
thd
,
db_
,
table_
,
table_list
,
&
key_arr
)
&&
key_arr
.
keys_len
>
0
&&
WSREP_OK
==
(
ret
=
wsrep
->
to_execute_start
(
wsrep
,
thd
->
thread_id
,
key_arr
.
keys
,
key_arr
.
keys_len
,
&
buff
,
1
,
...
...
@@ -1290,7 +1297,7 @@ static int wsrep_TOI_begin(THD *thd, char *db_, char *table_,
WSREP_DEBUG
(
"TO BEGIN: %lld, %d"
,(
long
long
)
wsrep_thd_trx_seqno
(
thd
),
thd
->
wsrep_exec_mode
);
}
else
{
else
if
(
key_arr
.
keys_len
>
0
)
{
/* jump to error handler in mysql_execute_command() */
WSREP_WARN
(
"TO isolation failed for: %d, sql: %s. Check wsrep "
"connection state and retry the query."
,
...
...
@@ -1301,6 +1308,13 @@ static int wsrep_TOI_begin(THD *thd, char *db_, char *table_,
wsrep_keys_free
(
&
key_arr
);
return
-
1
;
}
else
{
/* non replicated DDL, affecting temporary tables only */
WSREP_DEBUG
(
"TO isolation skipped for: %d, sql: %s."
"Only temporary tables affected."
,
ret
,
(
thd
->
query
())
?
thd
->
query
()
:
"void"
);
return
1
;
}
return
0
;
}
...
...
@@ -1454,9 +1468,15 @@ int wsrep_to_isolation_begin(THD *thd, char *db_, char *table_,
table_list
);
break
;
case
WSREP_OSU_RSU
:
ret
=
wsrep_RSU_begin
(
thd
,
db_
,
table_
);
break
;
}
if
(
!
ret
)
{
thd
->
wsrep_exec_mode
=
TOTAL_ORDER
;
switch
(
ret
)
{
case
0
:
thd
->
wsrep_exec_mode
=
TOTAL_ORDER
;
break
;
case
1
:
/* TOI replication skipped, treat as success */
ret
=
0
;
break
;
case
-
1
:
/* TOI replication failed, treat as error */
break
;
}
}
return
ret
;
...
...
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