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
819c40d6
Commit
819c40d6
authored
Jul 22, 2019
by
Alexey Yurchenko
Committed by
Jan Lindström
Jul 22, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- wsrep-lib update (SR cleanups and voting support) (#1359)
- TOI error ignoring fix (wsrep_ignore_apply_errors)
parent
1f54b662
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
49 additions
and
30 deletions
+49
-30
sql/log_event.cc
sql/log_event.cc
+1
-1
sql/sql_class.cc
sql/sql_class.cc
+0
-1
sql/sql_class.h
sql/sql_class.h
+0
-1
sql/wsrep_high_priority_service.cc
sql/wsrep_high_priority_service.cc
+27
-12
sql/wsrep_high_priority_service.h
sql/wsrep_high_priority_service.h
+11
-5
sql/wsrep_mysqld.cc
sql/wsrep_mysqld.cc
+7
-8
sql/wsrep_schema.cc
sql/wsrep_schema.cc
+2
-1
wsrep-lib
wsrep-lib
+1
-1
No files found.
sql/log_event.cc
View file @
819c40d6
...
...
@@ -5827,7 +5827,7 @@ START SLAVE; . Query: '%s'", expected_error, thd->query());
thd
->
get_db
(),
query_arg
);
thd
->
is_slave_error
=
1
;
#ifdef WITH_WSREP
if
(
thd
->
wsrep_apply_toi
&&
wsrep_must_ignore_error
(
thd
))
if
(
wsrep_thd_is_toi
(
thd
)
&&
wsrep_must_ignore_error
(
thd
))
{
thd
->
clear_error
(
1
);
thd
->
killed
=
NOT_KILLED
;
...
...
sql/sql_class.cc
View file @
819c40d6
...
...
@@ -667,7 +667,6 @@ THD::THD(my_thread_id id, bool is_wsrep_applier)
wsrep_po_handle
(
WSREP_PO_INITIALIZER
),
wsrep_po_cnt
(
0
),
wsrep_apply_format
(
0
),
wsrep_apply_toi
(
false
),
wsrep_rbr_buf
(
NULL
),
wsrep_sync_wait_gtid
(
WSREP_GTID_UNDEFINED
),
wsrep_affected_rows
(
0
),
...
...
sql/sql_class.h
View file @
819c40d6
...
...
@@ -4817,7 +4817,6 @@ class THD: public THD_count, /* this must be first */
rpl_sid
wsrep_po_sid
;
#endif
/* GTID_SUPPORT */
void
*
wsrep_apply_format
;
bool
wsrep_apply_toi
;
/* applier processing in TOI */
uchar
*
wsrep_rbr_buf
;
wsrep_gtid_t
wsrep_sync_wait_gtid
;
// wsrep_gtid_t wsrep_last_written_gtid;
...
...
sql/wsrep_high_priority_service.cc
View file @
819c40d6
...
...
@@ -45,13 +45,13 @@ class Wsrep_non_trans_mode
{
m_thd
->
variables
.
option_bits
&=
~
OPTION_BEGIN
;
m_thd
->
server_status
&=
~
SERVER_STATUS_IN_TRANS
;
m_thd
->
wsrep_cs
().
enter_toi
(
ws_meta
);
m_thd
->
wsrep_cs
().
enter_toi
_mode
(
ws_meta
);
}
~
Wsrep_non_trans_mode
()
{
m_thd
->
variables
.
option_bits
=
m_option_bits
;
m_thd
->
server_status
=
m_server_status
;
m_thd
->
wsrep_cs
().
leave_toi
();
m_thd
->
wsrep_cs
().
leave_toi
_mode
();
}
private:
Wsrep_non_trans_mode
(
const
Wsrep_non_trans_mode
&
);
...
...
@@ -343,7 +343,8 @@ int Wsrep_high_priority_service::rollback(const wsrep::ws_handle& ws_handle,
}
int
Wsrep_high_priority_service
::
apply_toi
(
const
wsrep
::
ws_meta
&
ws_meta
,
const
wsrep
::
const_buffer
&
data
)
const
wsrep
::
const_buffer
&
data
,
wsrep
::
mutable_buffer
&
)
{
DBUG_ENTER
(
"Wsrep_high_priority_service::apply_toi"
);
THD
*
thd
=
m_thd
;
...
...
@@ -404,21 +405,33 @@ void Wsrep_high_priority_service::switch_execution_context(wsrep::high_priority_
}
int
Wsrep_high_priority_service
::
log_dummy_write_set
(
const
wsrep
::
ws_handle
&
ws_handle
,
const
wsrep
::
ws_meta
&
ws_meta
)
const
wsrep
::
ws_meta
&
ws_meta
,
wsrep
::
mutable_buffer
&
err
)
{
DBUG_ENTER
(
"Wsrep_high_priority_service::log_dummy_write_set"
);
int
ret
=
0
;
DBUG_PRINT
(
"info"
,
(
"Wsrep_high_priority_service::log_dummy_write_set: seqno=%lld"
,
ws_meta
.
seqno
().
get
()));
m_thd
->
wsrep_cs
().
start_transaction
(
ws_handle
,
ws_meta
);
WSREP_DEBUG
(
"Log dummy write set %lld"
,
ws_meta
.
seqno
().
get
());
if
(
!
(
opt_log_slave_updates
&&
wsrep_gtid_mode
&&
m_thd
->
variables
.
gtid_seq_no
))
if
(
ws_meta
.
ordered
())
{
m_thd
->
wsrep_cs
().
before_rollback
();
m_thd
->
wsrep_cs
().
after_rollback
();
wsrep
::
client_state
&
cs
(
m_thd
->
wsrep_cs
());
if
(
!
cs
.
transaction
().
active
())
{
cs
.
start_transaction
(
ws_handle
,
ws_meta
);
}
adopt_apply_error
(
err
);
WSREP_DEBUG
(
"Log dummy write set %lld"
,
ws_meta
.
seqno
().
get
());
ret
=
cs
.
provider
().
commit_order_enter
(
ws_handle
,
ws_meta
);
if
(
!
(
ret
&&
opt_log_slave_updates
&&
wsrep_gtid_mode
&&
m_thd
->
variables
.
gtid_seq_no
))
{
cs
.
before_rollback
();
cs
.
after_rollback
();
}
ret
=
ret
||
cs
.
provider
().
commit_order_leave
(
ws_handle
,
ws_meta
,
err
);
cs
.
after_applying
();
}
m_thd
->
wsrep_cs
().
after_applying
();
DBUG_RETURN
(
ret
);
}
...
...
@@ -452,7 +465,8 @@ Wsrep_applier_service::~Wsrep_applier_service()
}
int
Wsrep_applier_service
::
apply_write_set
(
const
wsrep
::
ws_meta
&
ws_meta
,
const
wsrep
::
const_buffer
&
data
)
const
wsrep
::
const_buffer
&
data
,
wsrep
::
mutable_buffer
&
)
{
DBUG_ENTER
(
"Wsrep_applier_service::apply_write_set"
);
THD
*
thd
=
m_thd
;
...
...
@@ -606,7 +620,8 @@ Wsrep_replayer_service::~Wsrep_replayer_service()
}
int
Wsrep_replayer_service
::
apply_write_set
(
const
wsrep
::
ws_meta
&
ws_meta
,
const
wsrep
::
const_buffer
&
data
)
const
wsrep
::
const_buffer
&
data
,
wsrep
::
mutable_buffer
&
)
{
DBUG_ENTER
(
"Wsrep_replayer_service::apply_write_set"
);
THD
*
thd
=
m_thd
;
...
...
sql/wsrep_high_priority_service.h
View file @
819c40d6
...
...
@@ -37,19 +37,23 @@ class Wsrep_high_priority_service :
const
wsrep
::
ws_meta
&
);
const
wsrep
::
transaction
&
transaction
()
const
;
int
adopt_transaction
(
const
wsrep
::
transaction
&
);
int
apply_write_set
(
const
wsrep
::
ws_meta
&
,
const
wsrep
::
const_buffer
&
)
=
0
;
int
apply_write_set
(
const
wsrep
::
ws_meta
&
,
const
wsrep
::
const_buffer
&
,
wsrep
::
mutable_buffer
&
)
=
0
;
int
append_fragment_and_commit
(
const
wsrep
::
ws_handle
&
,
const
wsrep
::
ws_meta
&
,
const
wsrep
::
const_buffer
&
);
int
remove_fragments
(
const
wsrep
::
ws_meta
&
);
int
commit
(
const
wsrep
::
ws_handle
&
,
const
wsrep
::
ws_meta
&
);
int
rollback
(
const
wsrep
::
ws_handle
&
,
const
wsrep
::
ws_meta
&
);
int
apply_toi
(
const
wsrep
::
ws_meta
&
,
const
wsrep
::
const_buffer
&
);
int
apply_toi
(
const
wsrep
::
ws_meta
&
,
const
wsrep
::
const_buffer
&
,
wsrep
::
mutable_buffer
&
);
void
store_globals
();
void
reset_globals
();
void
switch_execution_context
(
wsrep
::
high_priority_service
&
);
int
log_dummy_write_set
(
const
wsrep
::
ws_handle
&
,
const
wsrep
::
ws_meta
&
);
const
wsrep
::
ws_meta
&
,
wsrep
::
mutable_buffer
&
);
void
adopt_apply_error
(
wsrep
::
mutable_buffer
&
err
)
{}
virtual
bool
check_exit_status
()
const
=
0
;
void
debug_crash
(
const
char
*
);
...
...
@@ -78,7 +82,8 @@ class Wsrep_applier_service : public Wsrep_high_priority_service
public:
Wsrep_applier_service
(
THD
*
);
~
Wsrep_applier_service
();
int
apply_write_set
(
const
wsrep
::
ws_meta
&
,
const
wsrep
::
const_buffer
&
);
int
apply_write_set
(
const
wsrep
::
ws_meta
&
,
const
wsrep
::
const_buffer
&
,
wsrep
::
mutable_buffer
&
);
void
after_apply
();
bool
is_replaying
()
const
{
return
false
;
}
bool
check_exit_status
()
const
;
...
...
@@ -89,7 +94,8 @@ class Wsrep_replayer_service : public Wsrep_high_priority_service
public:
Wsrep_replayer_service
(
THD
*
replayer_thd
,
THD
*
orig_thd
);
~
Wsrep_replayer_service
();
int
apply_write_set
(
const
wsrep
::
ws_meta
&
,
const
wsrep
::
const_buffer
&
);
int
apply_write_set
(
const
wsrep
::
ws_meta
&
,
const
wsrep
::
const_buffer
&
,
wsrep
::
mutable_buffer
&
);
void
after_apply
()
{
}
bool
is_replaying
()
const
{
return
true
;
}
void
replay_status
(
enum
wsrep
::
provider
::
status
status
)
...
...
sql/wsrep_mysqld.cc
View file @
819c40d6
...
...
@@ -1782,7 +1782,7 @@ static void wsrep_TOI_begin_failed(THD* thd, const wsrep_buf_t* /* const err */)
if
(
wsrep_emulate_bin_log
)
wsrep_thd_binlog_trx_reset
(
thd
);
if
(
wsrep_write_dummy_event
(
thd
,
"TOI begin failed"
))
{
goto
fail
;
}
wsrep
::
client_state
&
cs
(
thd
->
wsrep_cs
());
int
const
ret
=
cs
.
leave_toi
(
);
int
const
ret
=
cs
.
leave_toi
_local
(
wsrep
::
mutable_buffer
()
);
if
(
ret
)
{
WSREP_ERROR
(
"Leaving critical section for failed TOI failed: thd: %lld, "
...
...
@@ -1850,10 +1850,10 @@ static int wsrep_TOI_begin(THD *thd, const char *db, const char *table,
thd_proc_info
(
thd
,
"acquiring total order isolation"
);
wsrep
::
client_state
&
cs
(
thd
->
wsrep_cs
());
int
ret
=
cs
.
enter_toi
(
key_array
,
wsrep
::
const_buffer
(
buff
.
ptr
,
buff
.
len
),
wsrep
::
provider
::
flag
::
start_transaction
|
wsrep
::
provider
::
flag
::
commit
);
int
ret
=
cs
.
enter_toi
_local
(
key_array
,
wsrep
::
const_buffer
(
buff
.
ptr
,
buff
.
len
),
wsrep
::
provider
::
flag
::
start_transaction
|
wsrep
::
provider
::
flag
::
commit
);
if
(
ret
)
{
...
...
@@ -1909,7 +1909,7 @@ static void wsrep_TOI_end(THD *thd) {
if
(
wsrep_thd_is_local_toi
(
thd
))
{
wsrep_set_SE_checkpoint
(
client_state
.
toi_meta
().
gtid
());
int
ret
=
client_state
.
leave_toi
(
);
int
ret
=
client_state
.
leave_toi
_local
(
wsrep
::
mutable_buffer
()
);
if
(
!
ret
)
{
WSREP_DEBUG
(
"TO END: %lld"
,
client_state
.
toi_meta
().
seqno
().
get
());
...
...
@@ -2400,8 +2400,7 @@ int wsrep_must_ignore_error(THD* thd)
const
uint
flags
=
sql_command_flags
[
thd
->
lex
->
sql_command
];
DBUG_ASSERT
(
error
);
DBUG_ASSERT
((
wsrep_thd_is_toi
(
thd
))
||
(
wsrep_thd_is_applying
(
thd
)
&&
thd
->
wsrep_apply_toi
));
DBUG_ASSERT
(
wsrep_thd_is_toi
(
thd
)
||
wsrep_thd_is_applying
(
thd
));
if
((
wsrep_ignore_apply_errors
&
WSREP_IGNORE_ERRORS_ON_DDL
))
goto
ignore_error
;
...
...
sql/wsrep_schema.cc
View file @
819c40d6
...
...
@@ -1343,7 +1343,8 @@ int Wsrep_schema::recover_sr_transactions(THD *orig_thd)
ws_meta
);
}
applier
->
store_globals
();
applier
->
apply_write_set
(
ws_meta
,
data
);
wsrep
::
mutable_buffer
unused
;
applier
->
apply_write_set
(
ws_meta
,
data
,
unused
);
applier
->
after_apply
();
storage_service
.
store_globals
();
}
...
...
wsrep-lib
@
0f676bd8
Subproject commit
fd66bdef0bbcdeb3a5189c7f93319cb5f9d77ea7
Subproject commit
0f676bd89378c7c823cff7ae7cdaef3cafcca231
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