summaryrefslogtreecommitdiff
path: root/sql/wsrep_binlog.cc
diff options
context:
space:
mode:
authorDaniele Sciascia <daniele.sciascia@galeracluster.com>2020-03-21 08:17:28 +0100
committerGitHub <noreply@github.com>2020-03-21 09:17:28 +0200
commit9394cc89143e4fce3126a96ac1c8a91a66d71dea (patch)
treed21d24e28e3c28ac25815e4509b146f5e9774d97 /sql/wsrep_binlog.cc
parentbd3c8f47cd16b4795dd073bbd30decd804c76969 (diff)
downloadmariadb-git-9394cc89143e4fce3126a96ac1c8a91a66d71dea.tar.gz
MDEV-21675: Data inconsistency after multirow insert rollback (#1474)
* Remove dead code * MDEV-21675 Data inconsistency after multirow insert rollback This patch fixes data inconsistencies that happen after rollback of multirow inserts, with binlog disabled. For example, statements such as `INSERT INTO t1 VALUES (1,'a'),(1,'b')` that fail with duplicate key error. In such cases the whole statement is rolled back. However, with wsrep_emulate_binlog in effect, the IO_CACHE would not be truncated, and the pending rows events would be replicated to the rest of the cluster. In the above example, it would result in row (1,'a') being replicated, whereas locally the statement is rolled back entirely. Making the cluster inconsistent. The patch changes the code so that prior to statement rollback, pending rows event are removed and the stmt cache reset. That patch also introduces MTR tests that excercise multirow insert statements for regular, and streaming replication.
Diffstat (limited to 'sql/wsrep_binlog.cc')
-rw-r--r--sql/wsrep_binlog.cc36
1 files changed, 0 insertions, 36 deletions
diff --git a/sql/wsrep_binlog.cc b/sql/wsrep_binlog.cc
index 84fce7c2b2d..787ebc042ae 100644
--- a/sql/wsrep_binlog.cc
+++ b/sql/wsrep_binlog.cc
@@ -228,40 +228,6 @@ void wsrep_dump_rbr_buf(THD *thd, const void* rbr_buf, size_t buf_len)
free(filename);
}
-/*
- wsrep exploits binlog's caches even if binlogging itself is not
- activated. In such case connection close needs calling
- actual binlog's method.
- Todo: split binlog hton from its caches to use ones by wsrep
- without referring to binlog's stuff.
-*/
-int wsrep_binlog_close_connection(THD* thd)
-{
- DBUG_ENTER("wsrep_binlog_close_connection");
- if (thd_get_ha_data(thd, binlog_hton) != NULL)
- binlog_hton->close_connection (binlog_hton, thd);
- DBUG_RETURN(0);
-}
-
-int wsrep_binlog_savepoint_set(THD *thd, void *sv)
-{
- if (!wsrep_emulate_bin_log) return 0;
- int rcode= binlog_hton->savepoint_set(binlog_hton, thd, sv);
- return rcode;
-}
-
-int wsrep_binlog_savepoint_rollback(THD *thd, void *sv)
-{
- if (!wsrep_emulate_bin_log) return 0;
- int rcode= binlog_hton->savepoint_rollback(binlog_hton, thd, sv);
- return rcode;
-}
-
-void thd_binlog_flush_pending_rows_event(THD *thd, bool stmt_end)
-{
- thd->binlog_flush_pending_rows_event(stmt_end);
-}
-
/* Dump replication buffer along with header to a file. */
void wsrep_dump_rbr_buf_with_header(THD *thd, const void *rbr_buf,
size_t buf_len)
@@ -343,8 +309,6 @@ cleanup1:
DBUG_VOID_RETURN;
}
-#include "log_event.h"
-
int wsrep_write_skip_event(THD* thd)
{
DBUG_ENTER("wsrep_write_skip_event");