diff options
author | Nirbhay Choubey <nirbhay@mariadb.com> | 2016-12-05 20:07:30 -0500 |
---|---|---|
committer | Nirbhay Choubey <nirbhay@mariadb.com> | 2016-12-12 08:51:50 -0500 |
commit | 9c88a54c1064ebdcf461e6c524a36ce5cc9370bd (patch) | |
tree | deb00af21a2f30d78f1022455416eec8086dc74f /sql/wsrep_binlog.cc | |
parent | dbb06d2eaba63df0eae921da8a971c664ca18010 (diff) | |
download | mariadb-git-9c88a54c1064ebdcf461e6c524a36ce5cc9370bd.tar.gz |
MDEV-11179: WSREP transaction excceded size limit in Galera cluster
... causes MariaDB to crash
On error, the wsrep replication buffer (binlog) is dumped to a file
to aid investigations. In order to also include the binlog header,
FDLE object is also needed. This object is only available for wsrep-
threads.
Fix: Instantiate an FDLE object for non-wsrep threads.
Diffstat (limited to 'sql/wsrep_binlog.cc')
-rw-r--r-- | sql/wsrep_binlog.cc | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/sql/wsrep_binlog.cc b/sql/wsrep_binlog.cc index 36917674128..d3f59cee5f2 100644 --- a/sql/wsrep_binlog.cc +++ b/sql/wsrep_binlog.cc @@ -442,11 +442,13 @@ void thd_binlog_flush_pending_rows_event(THD *thd, bool stmt_end) void wsrep_dump_rbr_buf_with_header(THD *thd, const void *rbr_buf, size_t buf_len) { + DBUG_ENTER("wsrep_dump_rbr_buf_with_header"); + char filename[PATH_MAX]= {0}; File file; IO_CACHE cache; Log_event_writer writer(&cache); - Format_description_log_event *ev= wsrep_get_apply_format(thd); + Format_description_log_event *ev; int len= my_snprintf(filename, PATH_MAX, "%s/GRA_%ld_%lld_v2.log", wsrep_data_home_dir, thd->thread_id, @@ -455,7 +457,7 @@ void wsrep_dump_rbr_buf_with_header(THD *thd, const void *rbr_buf, if (len >= PATH_MAX) { WSREP_ERROR("RBR dump path too long: %d, skipping dump.", len); - return; + DBUG_VOID_RETURN; } if ((file= mysql_file_open(key_file_wsrep_gra_log, filename, @@ -477,6 +479,13 @@ void wsrep_dump_rbr_buf_with_header(THD *thd, const void *rbr_buf, goto cleanup2; } + /* + Instantiate an FDLE object for non-wsrep threads (to be written + to the dump file). + */ + ev= (thd->wsrep_applier) ? wsrep_get_apply_format(thd) : + (new Format_description_log_event(4)); + if (writer.write(ev) || my_b_write(&cache, (uchar*)rbr_buf, buf_len) || flush_io_cache(&cache)) { @@ -489,5 +498,9 @@ cleanup2: cleanup1: mysql_file_close(file, MYF(MY_WME)); + + if (!thd->wsrep_applier) delete ev; + + DBUG_VOID_RETURN; } |