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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
21bc3e3f
Commit
21bc3e3f
authored
Nov 12, 2014
by
sjaakola
Committed by
Nirbhay Choubey
May 08, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refs #2 - added binlog stmt cache reset after commit. This is needed for non-InnoDB statements
parent
9fdae3eb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
5 deletions
+41
-5
sql/log.cc
sql/log.cc
+22
-1
sql/wsrep_hton.cc
sql/wsrep_hton.cc
+19
-4
No files found.
sql/log.cc
View file @
21bc3e3f
...
...
@@ -1712,15 +1712,36 @@ int binlog_init(void *p)
return
0
;
}
#ifdef WITH_WSREP
#include "wsrep_binlog.h"
#endif
/* WITH_WSREP */
static
int
binlog_close_connection
(
handlerton
*
hton
,
THD
*
thd
)
{
DBUG_ENTER
(
"binlog_close_connection"
);
binlog_cache_mngr
*
const
cache_mngr
=
(
binlog_cache_mngr
*
)
thd_get_ha_data
(
thd
,
binlog_hton
);
#ifdef WITH_WSREP
if
(
cache_mngr
&&
!
cache_mngr
->
trx_cache
.
empty
())
{
IO_CACHE
*
cache
=
get_trans_log
(
thd
);
uchar
*
buf
;
size_t
len
=
0
;
wsrep_write_cache_buf
(
cache
,
&
buf
,
&
len
);
WSREP_WARN
(
"binlog trx cache not empty (%lu bytes) @ connection close %lu"
,
len
,
thd
->
thread_id
);
if
(
len
>
0
)
wsrep_dump_rbr_buf
(
thd
,
buf
,
len
);
cache
=
cache_mngr
->
get_binlog_cache_log
(
false
);
wsrep_write_cache_buf
(
cache
,
&
buf
,
&
len
);
WSREP_WARN
(
"binlog stmt cache not empty (%lu bytes) @ connection close %lu"
,
len
,
thd
->
thread_id
);
if
(
len
>
0
)
wsrep_dump_rbr_buf
(
thd
,
buf
,
len
);
}
#endif
/* WITH_WSREP */
DBUG_ASSERT
(
cache_mngr
->
trx_cache
.
empty
()
&&
cache_mngr
->
stmt_cache
.
empty
());
thd_set_ha_data
(
thd
,
binlog_hton
,
NULL
);
cache_mngr
->~
binlog_cache_mngr
();
my_free
(
cache_mngr
);
return
0
;
DBUG_RETURN
(
0
)
;
}
/*
...
...
sql/wsrep_hton.cc
View file @
21bc3e3f
...
...
@@ -98,17 +98,32 @@ void wsrep_register_hton(THD* thd, bool all)
*/
void
wsrep_post_commit
(
THD
*
thd
,
bool
all
)
{
if
(
thd
->
wsrep_exec_mode
==
LOCAL_COMMIT
)
switch
(
thd
->
wsrep_exec_mode
)
{
DBUG_ASSERT
(
thd
->
wsrep_trx_meta
.
gtid
.
seqno
!=
WSREP_SEQNO_UNDEFINED
);
if
(
wsrep
->
post_commit
(
wsrep
,
&
thd
->
wsrep_ws_handle
))
case
LOCAL_COMMIT
:
{
DBUG_ASSERT
(
thd
->
wsrep_trx_meta
.
gtid
.
seqno
!=
WSREP_SEQNO_UNDEFINED
);
if
(
wsrep
->
post_commit
(
wsrep
,
&
thd
->
wsrep_ws_handle
))
{
DBUG_PRINT
(
"wsrep"
,
(
"set committed fail"
));
WSREP_WARN
(
"set committed fail: %llu %d"
,
(
long
long
)
thd
->
real_id
,
thd
->
get_stmt_da
()
->
status
());
}
wsrep_cleanup_transaction
(
thd
);
break
;
}
wsrep_cleanup_transaction
(
thd
);
case
LOCAL_STATE
:
{
/*
Non-InnoDB statements may have populated events in stmt cache => cleanup
*/
WSREP_DEBUG
(
"cleanup transaction for LOCAL_STATE: %s"
,
thd
->
query
());
wsrep_cleanup_transaction
(
thd
);
break
;
}
default:
break
;
}
}
/*
...
...
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