Browse Source
bzr merge -r3904..3928 lp:codership-mysql/5.5
bzr merge -r3904..3928 lp:codership-mysql/5.5
This is now otherwise on level wsrep-25.9, but storage/innobase has not been fully merged wsrep-5.5 is not good source for that, so we probably have to cherry pick innodb changes from wsrep-5.6pull/57/head
27 changed files with 1705 additions and 82 deletions
-
2cmake/wsrep.cmake
-
1sql/log.cc
-
7sql/mdl.h
-
8sql/mysqld.cc
-
1sql/sql_class.cc
-
4sql/sql_class.h
-
38sql/sql_parse.cc
-
13sql/sql_table.cc
-
10sql/sys_vars.cc
-
7sql/transaction.cc
-
38sql/wsrep_applier.h
-
2sql/wsrep_hton.cc
-
34sql/wsrep_mysqld.cc
-
2sql/wsrep_mysqld.h
-
19sql/wsrep_thd.cc
-
1sql/wsrep_thd.h
-
15storage/innobase/handler/ha_innodb.cc
-
9storage/innobase/include/trx0sys.h
-
13storage/innobase/trx/trx0trx.cc
-
0wsrep.moved/CMakeLists.txt
-
0wsrep.moved/Makefile.am
-
1110wsrep.moved/wsrep_api.h
-
383wsrep.moved/wsrep_dummy.c
-
0wsrep.moved/wsrep_loader.c
-
0wsrep.moved/wsrep_uuid.c
-
14wsrep/wsrep_api.h
-
56wsrep/wsrep_dummy.c
@ -0,0 +1,38 @@ |
|||
/* Copyright 2013 Codership Oy <http://www.codership.com> |
|||
|
|||
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ |
|||
|
|||
#ifndef WSREP_APPLIER_H |
|||
#define WSREP_APPLIER_H |
|||
|
|||
#include <sys/types.h> |
|||
|
|||
/* wsrep callback prototypes */ |
|||
|
|||
wsrep_cb_status_t wsrep_apply_cb(void *ctx, |
|||
const void* buf, size_t buf_len, |
|||
uint32_t flags, |
|||
const wsrep_trx_meta_t* meta); |
|||
|
|||
wsrep_cb_status_t wsrep_commit_cb(void *ctx, |
|||
uint32_t flags, |
|||
const wsrep_trx_meta_t* meta, |
|||
wsrep_bool_t* exit, |
|||
bool commit); |
|||
|
|||
wsrep_cb_status_t wsrep_unordered_cb(void* ctx, |
|||
const void* data, |
|||
size_t size); |
|||
|
|||
#endif /* WSREP_APPLIER_H */ |
|||
1110
wsrep.moved/wsrep_api.h
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,383 @@ |
|||
/* Copyright (C) 2009-2010 Codership Oy <info@codersihp.com> |
|||
|
|||
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|||
*/ |
|||
|
|||
/*! @file Dummy wsrep API implementation. */ |
|||
|
|||
#include "wsrep_api.h" |
|||
|
|||
#include <errno.h> |
|||
#include <stdbool.h> |
|||
|
|||
/*! Dummy backend context. */ |
|||
typedef struct wsrep_dummy |
|||
{ |
|||
wsrep_log_cb_t log_fn; |
|||
} wsrep_dummy_t; |
|||
|
|||
/* Get pointer to wsrep_dummy context from wsrep_t pointer */ |
|||
#define WSREP_DUMMY(_p) ((wsrep_dummy_t *) (_p)->ctx) |
|||
|
|||
/* Trace function usage a-la DBUG */ |
|||
#define WSREP_DBUG_ENTER(_w) do { \ |
|||
if (WSREP_DUMMY(_w)) { \ |
|||
if (WSREP_DUMMY(_w)->log_fn) \ |
|||
WSREP_DUMMY(_w)->log_fn(WSREP_LOG_DEBUG, __FUNCTION__); \ |
|||
} \ |
|||
} while (0) |
|||
|
|||
|
|||
static void dummy_free(wsrep_t *w) |
|||
{ |
|||
WSREP_DBUG_ENTER(w); |
|||
free(w->ctx); |
|||
w->ctx = NULL; |
|||
} |
|||
|
|||
static wsrep_status_t dummy_init (wsrep_t* w, |
|||
const struct wsrep_init_args* args) |
|||
{ |
|||
WSREP_DUMMY(w)->log_fn = args->logger_cb; |
|||
WSREP_DBUG_ENTER(w); |
|||
return WSREP_OK; |
|||
} |
|||
|
|||
static uint64_t dummy_capabilities (wsrep_t* w __attribute__((unused))) |
|||
{ |
|||
return 0; |
|||
} |
|||
|
|||
static wsrep_status_t dummy_options_set( |
|||
wsrep_t* w, |
|||
const char* conf __attribute__((unused))) |
|||
{ |
|||
WSREP_DBUG_ENTER(w); |
|||
return WSREP_OK; |
|||
} |
|||
|
|||
static char* dummy_options_get (wsrep_t* w) |
|||
{ |
|||
WSREP_DBUG_ENTER(w); |
|||
return NULL; |
|||
} |
|||
|
|||
static wsrep_status_t dummy_connect( |
|||
wsrep_t* w, |
|||
const char* name __attribute__((unused)), |
|||
const char* url __attribute__((unused)), |
|||
const char* donor __attribute__((unused)), |
|||
wsrep_bool_t bootstrap __attribute__((unused))) |
|||
{ |
|||
WSREP_DBUG_ENTER(w); |
|||
return WSREP_OK; |
|||
} |
|||
|
|||
static wsrep_status_t dummy_disconnect(wsrep_t* w) |
|||
{ |
|||
WSREP_DBUG_ENTER(w); |
|||
return WSREP_OK; |
|||
} |
|||
|
|||
static wsrep_status_t dummy_recv(wsrep_t* w, |
|||
void* recv_ctx __attribute__((unused))) |
|||
{ |
|||
WSREP_DBUG_ENTER(w); |
|||
return WSREP_OK; |
|||
} |
|||
|
|||
static wsrep_status_t dummy_pre_commit( |
|||
wsrep_t* w, |
|||
const wsrep_conn_id_t conn_id __attribute__((unused)), |
|||
wsrep_ws_handle_t* ws_handle __attribute__((unused)), |
|||
// const struct wsrep_buf* data __attribute__((unused)), |
|||
// const long count __attribute__((unused)), |
|||
uint64_t flags __attribute__((unused)), |
|||
wsrep_trx_meta_t* meta __attribute__((unused))) |
|||
{ |
|||
WSREP_DBUG_ENTER(w); |
|||
return WSREP_OK; |
|||
} |
|||
|
|||
static wsrep_status_t dummy_post_commit( |
|||
wsrep_t* w, |
|||
wsrep_ws_handle_t* ws_handle __attribute__((unused))) |
|||
{ |
|||
WSREP_DBUG_ENTER(w); |
|||
return WSREP_OK; |
|||
} |
|||
|
|||
static wsrep_status_t dummy_post_rollback( |
|||
wsrep_t* w, |
|||
wsrep_ws_handle_t* ws_handle __attribute__((unused))) |
|||
{ |
|||
WSREP_DBUG_ENTER(w); |
|||
return WSREP_OK; |
|||
} |
|||
|
|||
static wsrep_status_t dummy_replay_trx( |
|||
wsrep_t* w, |
|||
wsrep_ws_handle_t* ws_handle __attribute__((unused)), |
|||
void* trx_ctx __attribute__((unused))) |
|||
{ |
|||
WSREP_DBUG_ENTER(w); |
|||
return WSREP_OK; |
|||
} |
|||
|
|||
static wsrep_status_t dummy_abort_pre_commit( |
|||
wsrep_t* w, |
|||
const wsrep_seqno_t bf_seqno __attribute__((unused)), |
|||
const wsrep_trx_id_t trx_id __attribute__((unused))) |
|||
{ |
|||
WSREP_DBUG_ENTER(w); |
|||
return WSREP_OK; |
|||
} |
|||
|
|||
static wsrep_status_t dummy_append_key( |
|||
wsrep_t* w, |
|||
wsrep_ws_handle_t* ws_handle __attribute__((unused)), |
|||
const wsrep_key_t* key __attribute__((unused)), |
|||
const int key_num __attribute__((unused)), |
|||
const wsrep_key_type_t key_type __attribute__((unused)), |
|||
const bool copy __attribute__((unused))) |
|||
{ |
|||
WSREP_DBUG_ENTER(w); |
|||
return WSREP_OK; |
|||
} |
|||
|
|||
static wsrep_status_t dummy_append_data( |
|||
wsrep_t* w, |
|||
wsrep_ws_handle_t* ws_handle __attribute__((unused)), |
|||
const struct wsrep_buf* data __attribute__((unused)), |
|||
const int count __attribute__((unused)), |
|||
const wsrep_data_type_t type __attribute__((unused)), |
|||
const bool copy __attribute__((unused))) |
|||
{ |
|||
WSREP_DBUG_ENTER(w); |
|||
return WSREP_OK; |
|||
} |
|||
|
|||
static wsrep_status_t dummy_causal_read( |
|||
wsrep_t* w, |
|||
wsrep_gtid_t* gtid __attribute__((unused))) |
|||
{ |
|||
WSREP_DBUG_ENTER(w); |
|||
return WSREP_OK; |
|||
} |
|||
|
|||
static wsrep_status_t dummy_free_connection( |
|||
wsrep_t* w, |
|||
const wsrep_conn_id_t conn_id __attribute__((unused))) |
|||
{ |
|||
WSREP_DBUG_ENTER(w); |
|||
return WSREP_OK; |
|||
} |
|||
|
|||
static wsrep_status_t dummy_to_execute_start( |
|||
wsrep_t* w, |
|||
const wsrep_conn_id_t conn_id __attribute__((unused)), |
|||
const wsrep_key_t* key __attribute__((unused)), |
|||
const int key_num __attribute__((unused)), |
|||
const struct wsrep_buf* data __attribute__((unused)), |
|||
const int count __attribute__((unused)), |
|||
wsrep_trx_meta_t* meta __attribute__((unused))) |
|||
{ |
|||
WSREP_DBUG_ENTER(w); |
|||
return WSREP_OK; |
|||
} |
|||
|
|||
static wsrep_status_t dummy_to_execute_end( |
|||
wsrep_t* w, |
|||
const wsrep_conn_id_t conn_id __attribute__((unused))) |
|||
{ |
|||
WSREP_DBUG_ENTER(w); |
|||
return WSREP_OK; |
|||
} |
|||
|
|||
static wsrep_status_t dummy_preordered( |
|||
wsrep_t* w, |
|||
const wsrep_uuid_t* source_id __attribute__((unused)), |
|||
int pa_range __attribute__((unused)), |
|||
const struct wsrep_buf* data __attribute__((unused)), |
|||
int count __attribute__((unused)), |
|||
uint64_t flags __attribute__((unused)), |
|||
wsrep_bool_t copy __attribute__((unused))) |
|||
{ |
|||
WSREP_DBUG_ENTER(w); |
|||
return WSREP_OK; |
|||
} |
|||
|
|||
static wsrep_status_t dummy_sst_sent( |
|||
wsrep_t* w, |
|||
const wsrep_uuid_t* uuid __attribute__((unused)), |
|||
wsrep_seqno_t seqno __attribute__((unused))) |
|||
{ |
|||
WSREP_DBUG_ENTER(w); |
|||
return WSREP_OK; |
|||
} |
|||
|
|||
static wsrep_status_t dummy_sst_received( |
|||
wsrep_t* w, |
|||
const wsrep_uuid_t* uuid __attribute__((unused)), |
|||
const wsrep_seqno_t seqno __attribute__((unused)), |
|||
const char* state __attribute__((unused)), |
|||
const size_t state_len __attribute__((unused))) |
|||
{ |
|||
WSREP_DBUG_ENTER(w); |
|||
return WSREP_OK; |
|||
} |
|||
|
|||
static wsrep_status_t dummy_snapshot( |
|||
wsrep_t* w, |
|||
const void* msg __attribute__((unused)), |
|||
const int msg_len __attribute__((unused)), |
|||
const char* donor_spec __attribute__((unused))) |
|||
{ |
|||
WSREP_DBUG_ENTER(w); |
|||
return WSREP_OK; |
|||
} |
|||
|
|||
static struct wsrep_stats_var dummy_stats[] = { |
|||
{ NULL, WSREP_VAR_STRING, { 0 } } |
|||
}; |
|||
|
|||
static struct wsrep_stats_var* dummy_stats_get (wsrep_t* w) |
|||
{ |
|||
WSREP_DBUG_ENTER(w); |
|||
return dummy_stats; |
|||
} |
|||
|
|||
static void dummy_stats_free ( |
|||
wsrep_t* w, |
|||
struct wsrep_stats_var* stats __attribute__((unused))) |
|||
{ |
|||
WSREP_DBUG_ENTER(w); |
|||
} |
|||
|
|||
static void dummy_stats_reset (wsrep_t* w) |
|||
{ |
|||
WSREP_DBUG_ENTER(w); |
|||
} |
|||
|
|||
static wsrep_seqno_t dummy_pause (wsrep_t* w) |
|||
{ |
|||
WSREP_DBUG_ENTER(w); |
|||
return -ENOSYS; |
|||
} |
|||
|
|||
static wsrep_status_t dummy_resume (wsrep_t* w) |
|||
{ |
|||
WSREP_DBUG_ENTER(w); |
|||
return WSREP_OK; |
|||
} |
|||
|
|||
static wsrep_status_t dummy_desync (wsrep_t* w) |
|||
{ |
|||
WSREP_DBUG_ENTER(w); |
|||
return WSREP_NOT_IMPLEMENTED; |
|||
} |
|||
|
|||
static wsrep_status_t dummy_resync (wsrep_t* w) |
|||
{ |
|||
WSREP_DBUG_ENTER(w); |
|||
return WSREP_OK; |
|||
} |
|||
|
|||
static wsrep_status_t dummy_lock (wsrep_t* w, |
|||
const char* s __attribute__((unused)), |
|||
bool r __attribute__((unused)), |
|||
uint64_t o __attribute__((unused)), |
|||
int64_t t __attribute__((unused))) |
|||
{ |
|||
WSREP_DBUG_ENTER(w); |
|||
return WSREP_NOT_IMPLEMENTED; |
|||
} |
|||
|
|||
static wsrep_status_t dummy_unlock (wsrep_t* w, |
|||
const char* s __attribute__((unused)), |
|||
uint64_t o __attribute__((unused))) |
|||
{ |
|||
WSREP_DBUG_ENTER(w); |
|||
return WSREP_OK; |
|||
} |
|||
|
|||
static bool dummy_is_locked (wsrep_t* w, |
|||
const char* s __attribute__((unused)), |
|||
uint64_t* o __attribute__((unused)), |
|||
wsrep_uuid_t* t __attribute__((unused))) |
|||
{ |
|||
WSREP_DBUG_ENTER(w); |
|||
return false; |
|||
} |
|||
|
|||
static wsrep_t dummy_iface = { |
|||
WSREP_INTERFACE_VERSION, |
|||
&dummy_init, |
|||
&dummy_capabilities, |
|||
&dummy_options_set, |
|||
&dummy_options_get, |
|||
&dummy_connect, |
|||
&dummy_disconnect, |
|||
&dummy_recv, |
|||
&dummy_pre_commit, |
|||
&dummy_post_commit, |
|||
&dummy_post_rollback, |
|||
&dummy_replay_trx, |
|||
&dummy_abort_pre_commit, |
|||
&dummy_append_key, |
|||
&dummy_append_data, |
|||
&dummy_causal_read, |
|||
&dummy_free_connection, |
|||
&dummy_to_execute_start, |
|||
&dummy_to_execute_end, |
|||
&dummy_preordered, |
|||
&dummy_sst_sent, |
|||
&dummy_sst_received, |
|||
&dummy_snapshot, |
|||
&dummy_stats_get, |
|||
&dummy_stats_free, |
|||
&dummy_stats_reset, |
|||
&dummy_pause, |
|||
&dummy_resume, |
|||
&dummy_desync, |
|||
&dummy_resync, |
|||
&dummy_lock, |
|||
&dummy_unlock, |
|||
&dummy_is_locked, |
|||
WSREP_NONE, |
|||
WSREP_INTERFACE_VERSION, |
|||
"Codership Oy <info@codership.com>", |
|||
0xdeadbeef, |
|||
&dummy_free, |
|||
NULL, |
|||
NULL |
|||
}; |
|||
|
|||
int wsrep_dummy_loader(wsrep_t* w) |
|||
{ |
|||
if (!w) |
|||
return EINVAL; |
|||
|
|||
*w = dummy_iface; |
|||
|
|||
// allocate private context |
|||
if (!(w->ctx = malloc(sizeof(wsrep_dummy_t)))) |
|||
return ENOMEM; |
|||
|
|||
// initialize private context |
|||
WSREP_DUMMY(w)->log_fn = NULL; |
|||
|
|||
return 0; |
|||
} |
|||
|
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue