mariadb/sql/wsrep_dummy.cc

141 lines
3.2 KiB
C++
Raw Normal View History

/* Copyright (C) 2014 SkySQL Ab.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
2019-05-11 21:19:05 +02:00
51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA. */
#include "mariadb.h"
#include <sql_class.h>
#include <mysql/service_wsrep.h>
2019-01-23 12:30:00 +01:00
my_bool wsrep_thd_is_BF(const THD *, my_bool)
{ return 0; }
2019-01-23 12:30:00 +01:00
int wsrep_is_wsrep_xid(const void* xid)
{ return 0; }
long long wsrep_xid_seqno(const XID* x)
{ return -1; }
const unsigned char* wsrep_xid_uuid(const XID*)
{
2019-01-23 12:30:00 +01:00
static const unsigned char uuid[16]= {0};
return uuid;
}
2019-01-23 12:30:00 +01:00
bool wsrep_prepare_key_for_innodb(THD* thd, const uchar*, size_t, const uchar*, size_t, struct wsrep_buf*, size_t*)
{ return 1; }
bool wsrep_prepare_key(const uchar*, size_t, const uchar*, size_t, struct wsrep_buf*, size_t*)
{ return 0; }
struct wsrep *get_wsrep()
{ return 0; }
2015-07-14 22:05:29 +02:00
my_bool get_wsrep_recovery()
{ return 0; }
bool wsrep_consistency_check(THD *)
{ return 0; }
void wsrep_lock_rollback()
{ }
2019-01-23 12:30:00 +01:00
my_bool wsrep_on(const THD *)
{ return 0; }
2019-01-23 12:30:00 +01:00
void wsrep_thd_LOCK(const THD *)
{ }
2019-01-23 12:30:00 +01:00
void wsrep_thd_UNLOCK(const THD *)
{ }
const char *wsrep_thd_conflict_state_str(THD *)
{ return 0; }
const char *wsrep_thd_exec_mode_str(THD *)
{ return NULL; }
2019-01-23 12:30:00 +01:00
const char *wsrep_thd_query(const THD *)
{ return 0; }
2019-01-23 12:30:00 +01:00
const char *wsrep_thd_query_state_str(THD *)
{ return 0; }
2019-01-23 12:30:00 +01:00
int wsrep_thd_retry_counter(const THD *)
{ return 0; }
2019-01-23 12:30:00 +01:00
bool wsrep_thd_ignore_table(THD *)
{ return 0; }
2019-01-23 12:30:00 +01:00
long long wsrep_thd_trx_seqno(const THD *)
{ return -1; }
my_bool wsrep_thd_is_aborting(const THD *)
{ return 0; }
2019-01-23 12:30:00 +01:00
void wsrep_set_data_home_dir(const char *)
{ }
my_bool wsrep_thd_is_local(const THD *)
{ return 0; }
2019-01-23 12:30:00 +01:00
void wsrep_thd_self_abort(THD *)
{ }
2019-01-23 12:30:00 +01:00
int wsrep_thd_append_key(THD *, const struct wsrep_key*, int, enum Wsrep_service_key_type)
{ return 0; }
2019-01-23 12:30:00 +01:00
const char* wsrep_thd_client_state_str(const THD*)
{ return 0; }
2019-01-23 12:30:00 +01:00
const char* wsrep_thd_client_mode_str(const THD*)
{ return 0; }
MDEV-9519: Data corruption will happen on the Galera cluster size change If we have a 2+ node cluster which is replicating from an async master and the binlog_format is set to STATEMENT and multi-row inserts are executed on a table with an auto_increment column such that values are automatically generated by MySQL, then the server node generates wrong auto_increment values, which are different from what was generated on the async master. In the title of the MDEV-9519 it was proposed to ban start slave on a Galera if master binlog_format = statement and wsrep_auto_increment_control = 1, but the problem can be solved without such a restriction. The causes and fixes: 1. We need to improve processing of changing the auto-increment values after changing the cluster size. 2. If wsrep auto_increment_control switched on during operation of the node, then we should immediately update the auto_increment_increment and auto_increment_offset global variables, without waiting of the next invocation of the wsrep_view_handler_cb() callback. In the current version these variables retain its initial values if wsrep_auto_increment_control is switched on during operation of the node, which leads to inconsistent results on the different nodes in some scenarios. 3. If wsrep auto_increment_control switched off during operation of the node, then we must return the original values of the auto_increment_increment and auto_increment_offset global variables, as the user has set. To make this possible, we need to add a "shadow copies" of these variables (which stores the latest values set by the user). https://jira.mariadb.org/browse/MDEV-9519
2019-02-25 21:49:04 +01:00
void wsrep_thd_auto_increment_variables(THD *thd,
unsigned long long *offset,
unsigned long long *increment)
{
*offset= thd->variables.auto_increment_offset;
*increment= thd->variables.auto_increment_increment;
}
2019-01-23 12:30:00 +01:00
const char* wsrep_thd_transaction_state_str(const THD*)
{ return 0; }
2019-01-23 12:30:00 +01:00
query_id_t wsrep_thd_transaction_id(const THD *)
{ return 0; }
2019-01-23 12:30:00 +01:00
my_bool wsrep_thd_bf_abort(const THD *, THD *, my_bool)
{ return 0; }
my_bool wsrep_thd_order_before(const THD*, const THD *)
{ return 0; }
void wsrep_handle_SR_rollback(THD*, THD*)
{ }
2019-01-23 12:30:00 +01:00
my_bool wsrep_thd_skip_locking(const THD*)
{ return 0;}
const char* wsrep_get_sr_table_name()
{ return 0; }
my_bool wsrep_get_debug()
{ return 0;}
10.4 wsrep group commit fixes (#1224) * MDEV-16509 Improve wsrep commit performance with binlog disabled Release commit order critical section early after trx_commit_low() if binlog is not transaction coordinator. In order to avoid two phase commit, binlog_hton is not registered for THD during IO_CACHE population. Implemented a test which verifies that the transactions release commit order early. This optimization will change behavior during recovery as the commit is not two phase when binlog is off. Fixed and recorded wsrep-recover-v25 and wsrep-recover to match the behavior. * MDEV-18730 Ordering for wsrep binlog group commit Previously out of order execution was allowed for wsrep commits. Established proper ordering by populating wait_for_commit for every wsrep THD and making group commit leader to wait for prior commits before proceeding to trx_group_commit_leader(). * MDEV-18730 Added a test case to verify correct commit ordering * MDEV-16509, MDEV-18730 Review fixes Use WSREP_EMULATE_BINLOG() macro to decide if the binlog_hton should be registered. Whitespace/syntax fixes and cleanups. * MDEV-16509 Require binlog for galera_var_innodb_disallow_writes test If the commit to InnoDB is done in one phase, the native InnoDB behavior is that the transaction is committed in memory before it is persisted to disk. This means that the innodb_disallow_writes=ON may not prevent transaction to become visible to other readers before commit is completely over. On the other hand, if the commit is two phase (as it is with binlog), the transaction will be blocked in prepare phase. Fixed the test to use binlog, which enforces two phase commit, which in turn makes commit to block before the changes become visible to other connections. This guarantees that the test produces expected result.
2019-03-15 06:09:13 +01:00
void wsrep_commit_ordered(THD* )
{ }
my_bool wsrep_thd_is_applying(const THD*)
{ return 0;}