Skip to content

Commit 61bda9a

Browse files
author
Seppo Jaakola
committed
Merged revisions 3425..3430 from mariadb-galera-5.5
1 parent 255e20a commit 61bda9a

File tree

4 files changed

+22
-5
lines changed

4 files changed

+22
-5
lines changed

sql/mdl.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2951,7 +2951,12 @@ void MDL_context::release_locks_stored_before(enum_mdl_duration duration,
29512951
DBUG_VOID_RETURN;
29522952
}
29532953

2954-
2954+
#ifdef WITH_WSREP
2955+
void MDL_context::release_explicit_locks()
2956+
{
2957+
release_locks_stored_before(MDL_EXPLICIT, NULL);
2958+
}
2959+
#endif
29552960
/**
29562961
Release all explicit locks in the context which correspond to the
29572962
same name/object as this lock request.

sql/mdl.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -782,6 +782,9 @@ class MDL_context
782782

783783
void release_statement_locks();
784784
void release_transactional_locks();
785+
#ifdef WITH_WSREP
786+
void release_explicit_locks();
787+
#endif
785788
void rollback_to_savepoint(const MDL_savepoint &mdl_savepoint);
786789

787790
MDL_context_owner *get_owner() { return m_owner; }

sql/sql_parse.cc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8617,6 +8617,9 @@ static void wsrep_client_rollback(THD *thd)
86178617
/* Release transactional metadata locks. */
86188618
thd->mdl_context.release_transactional_locks();
86198619

8620+
/* release explicit MDL locks */
8621+
thd->mdl_context.release_explicit_locks();
8622+
86208623
if (thd->get_binlog_table_maps())
86218624
{
86228625
WSREP_DEBUG("clearing binlog table map for BF abort (%ld)", thd->thread_id);
@@ -8790,11 +8793,11 @@ static inline wsrep_status_t wsrep_apply_rbr(
87908793
DBUG_RETURN(WSREP_FATAL);
87918794
}
87928795

8793-
if (ev->get_type_code() != TABLE_MAP_EVENT &&
8796+
if ((ev->get_type_code() == WRITE_ROWS_EVENT ||
8797+
ev->get_type_code() == UPDATE_ROWS_EVENT ||
8798+
ev->get_type_code() == DELETE_ROWS_EVENT) &&
87948799
((Rows_log_event *) ev)->get_flags(Rows_log_event::STMT_END_F))
87958800
{
8796-
// TODO: combine with commit on higher level common for the query ws
8797-
87988801
thd->wsrep_rli->cleanup_context(thd, 0);
87998802

88008803
if (error == 0)

sql/wsrep_mysqld.cc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ bool wsrep_start_replication()
714714
uint64_t caps = wsrep->capabilities (wsrep);
715715

716716
wsrep_incremental_data_collection =
717-
(caps & WSREP_CAP_WRITE_SET_INCREMENTS);
717+
!!(caps & WSREP_CAP_WRITE_SET_INCREMENTS);
718718

719719
char* opts= wsrep->options_get(wsrep);
720720
if (opts)
@@ -1254,6 +1254,12 @@ int wsrep_to_isolation_begin(THD *thd, char *db_, char *table_,
12541254
if (!ret)
12551255
{
12561256
thd->wsrep_exec_mode= TOTAL_ORDER;
1257+
/* It makes sense to set auto_increment_* to defaults in TOI operations */
1258+
if (wsrep_auto_increment_control)
1259+
{
1260+
thd->variables.auto_increment_offset = 1;
1261+
thd->variables.auto_increment_increment = 1;
1262+
}
12571263
}
12581264
}
12591265
return ret;

0 commit comments

Comments
 (0)