Skip to content

Commit

Permalink
Revert "Prepare XtraDB to be used with xtrabackup."
Browse files Browse the repository at this point in the history
This reverts commit de5646f.
  • Loading branch information
vaintroub committed Oct 23, 2016
1 parent de5646f commit ee1d08c
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 135 deletions.
9 changes: 1 addition & 8 deletions sql/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,6 @@ IF(SSL_DEFINES)
ADD_DEFINITIONS(${SSL_DEFINES})
ENDIF()

IF(WIN32)
SET(NT_SERVICE_SOURCES nt_servc.cc nt_servc.h )
ELSE()
SET(NT_SERVICE_SOURCES)
ENDIF()

SET (SQL_SOURCE
../sql-common/client.c compat56.cc derror.cc des_key_file.cc
discover.cc ../libmysql/errmsg.c field.cc field_conv.cc
Expand Down Expand Up @@ -149,7 +143,6 @@ SET (SQL_SOURCE
${GEN_SOURCES}
${GEN_DIGEST_SOURCES}
${MYSYS_LIBWRAP_SOURCE}
${NT_SERVICE_SOURCES}
)

IF (CMAKE_SYSTEM_NAME MATCHES "Linux" OR
Expand Down Expand Up @@ -179,7 +172,7 @@ TARGET_LINK_LIBRARIES(sql ${MYSQLD_STATIC_PLUGIN_LIBS}
${LIBSYSTEMD})

IF(WIN32)
SET(MYSQLD_SOURCE main.cc message.rc)
SET(MYSQLD_SOURCE main.cc nt_servc.cc nt_servc.h message.rc)
TARGET_LINK_LIBRARIES(sql psapi)
ELSE()
SET(MYSQLD_SOURCE main.cc ${DTRACE_PROBES_ALL})
Expand Down
4 changes: 2 additions & 2 deletions storage/xtradb/btr/btr0btr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ btr_root_fseg_validate(
/**************************************************************//**
Gets the root node of a tree and x- or s-latches it.
@return root page, x- or s-latched */

static
buf_block_t*
btr_root_block_get(
/*===============*/
Expand Down Expand Up @@ -1531,7 +1531,7 @@ btr_node_ptr_set_child_page_no(
/************************************************************//**
Returns the child page of a node pointer and x-latches it.
@return child page, x-latched */

static
buf_block_t*
btr_node_ptr_get_child(
/*===================*/
Expand Down
5 changes: 3 additions & 2 deletions storage/xtradb/fil/fil0fil.cc
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ fil_node_get_space_id(

/*******************************************************************//**
Returns the table space by a given name, NULL if not found. */
UNIV_INLINE
fil_space_t*
fil_space_get_by_name(
/*==================*/
Expand Down Expand Up @@ -4784,7 +4785,7 @@ directory. We retry 100 times if os_file_readdir_next_file() returns -1. The
idea is to read as much good data as we can and jump over bad data.
@return 0 if ok, -1 if error even after the retries, 1 if at the end
of the directory */

static
int
fil_file_readdir_next_file(
/*=======================*/
Expand Down Expand Up @@ -4825,7 +4826,7 @@ space id is != 0.
@return DB_SUCCESS or error number */
UNIV_INTERN
dberr_t
fil_load_single_table_tablespaces(ibool (*pred)(const char*, const char*))
fil_load_single_table_tablespaces(void)
/*===================================*/
{
int ret;
Expand Down
6 changes: 3 additions & 3 deletions storage/xtradb/handler/ha_innodb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ static TYPELIB innodb_stats_method_typelib = {

/** Possible values for system variables "innodb_checksum_algorithm" and
"innodb_log_checksum_algorithm". */
const char* innodb_checksum_algorithm_names[] = {
static const char* innodb_checksum_algorithm_names[] = {
"CRC32",
"STRICT_CRC32",
"INNODB",
Expand All @@ -296,7 +296,7 @@ const char* innodb_checksum_algorithm_names[] = {

/** Used to define an enumerate type of the system variables
innodb_checksum_algorithm and innodb_log_checksum_algorithm. */
TYPELIB innodb_checksum_algorithm_typelib = {
static TYPELIB innodb_checksum_algorithm_typelib = {
array_elements(innodb_checksum_algorithm_names) - 1,
"innodb_checksum_algorithm_typelib",
innodb_checksum_algorithm_names,
Expand Down Expand Up @@ -3016,7 +3016,7 @@ trx_is_started(
/****************************************************************//**
Update log_checksum_algorithm_ptr with a pointer to the function corresponding
to a given checksum algorithm. */

static
void
innodb_log_checksum_func_update(
/*============================*/
Expand Down
2 changes: 1 addition & 1 deletion storage/xtradb/include/fil0fil.h
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ space id is != 0.
@return DB_SUCCESS or error number */
UNIV_INTERN
dberr_t
fil_load_single_table_tablespaces(ibool (*pred)(const char*, const char*)=0);
fil_load_single_table_tablespaces(void);
/*===================================*/
/*******************************************************************//**
Returns TRUE if a single-table tablespace does not exist in the memory cache,
Expand Down
7 changes: 0 additions & 7 deletions storage/xtradb/include/srv0srv.h
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,6 @@ extern ulong srv_innodb_stats_method;

#ifdef UNIV_LOG_ARCHIVE
extern ibool srv_log_archive_on;
extern ibool srv_archive_recovery;
extern ib_uint64_t srv_archive_recovery_limit_lsn;
#endif /* UNIV_LOG_ARCHIVE */

extern char* srv_file_flush_method_str;
Expand Down Expand Up @@ -543,11 +541,6 @@ extern ulong srv_pass_corrupt_table;

extern ulong srv_log_checksum_algorithm;

extern ibool srv_apply_log_only;

extern ibool srv_backup_mode;
extern ibool srv_close_files;

extern my_bool srv_force_primary_key;

/* Helper macro to support srv_pass_corrupt_table checks. If 'cond' is FALSE,
Expand Down
2 changes: 1 addition & 1 deletion storage/xtradb/include/univ.i
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ functions. */

#ifdef __WIN__
#define usleep(a) Sleep((a)/1000)
typedef DWORD os_thread_ret_t;
typedef ulint os_thread_ret_t;
#define OS_THREAD_DUMMY_RETURN return(0)
#else
typedef void* os_thread_ret_t;
Expand Down
99 changes: 2 additions & 97 deletions storage/xtradb/log/log0recv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,7 @@ recv_synchronize_groups(
/***********************************************************************//**
Checks the consistency of the checkpoint info
@return TRUE if ok */
static
ibool
recv_check_cp_is_consistent(
/*========================*/
Expand Down Expand Up @@ -742,7 +743,7 @@ recv_check_cp_is_consistent(
/********************************************************//**
Looks for the maximum consistent checkpoint from the log groups.
@return error code or DB_SUCCESS */
MY_ATTRIBUTE((nonnull, warn_unused_result))
static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
recv_find_max_checkpoint(
/*=====================*/
Expand Down Expand Up @@ -3783,102 +3784,6 @@ recv_reset_log_files_for_backup(
}
#endif /* UNIV_HOTBACKUP */

/******************************************************//**
Checks the 4-byte checksum to the trailer checksum field of a log
block. We also accept a log block in the old format before
InnoDB-3.23.52 where the checksum field contains the log block number.
@return TRUE if ok, or if the log block may be in the format of InnoDB
version predating 3.23.52 */
UNIV_INTERN
ibool
log_block_checksum_is_ok_or_old_format(
/*===================================*/
const byte* block) /*!< in: pointer to a log block */
{
#ifdef UNIV_LOG_DEBUG
return(TRUE);
#endif /* UNIV_LOG_DEBUG */

ulint block_checksum = log_block_get_checksum(block);

if (UNIV_LIKELY(srv_log_checksum_algorithm ==
SRV_CHECKSUM_ALGORITHM_NONE ||
log_block_calc_checksum(block) == block_checksum)) {

return(TRUE);
}

if (srv_log_checksum_algorithm == SRV_CHECKSUM_ALGORITHM_STRICT_CRC32 ||
srv_log_checksum_algorithm == SRV_CHECKSUM_ALGORITHM_STRICT_INNODB ||
srv_log_checksum_algorithm == SRV_CHECKSUM_ALGORITHM_STRICT_NONE) {

const char* algo = NULL;

ib_logf(IB_LOG_LEVEL_ERROR,
"log block checksum mismatch: expected " ULINTPF ", "
"calculated checksum " ULINTPF,
block_checksum,
log_block_calc_checksum(block));

if (block_checksum == LOG_NO_CHECKSUM_MAGIC) {

algo = "none";
} else if (block_checksum ==
log_block_calc_checksum_crc32(block)) {

algo = "crc32";
} else if (block_checksum ==
log_block_calc_checksum_innodb(block)) {

algo = "innodb";
}

if (algo) {

const char* current_algo;

current_algo = buf_checksum_algorithm_name(
(srv_checksum_algorithm_t)
srv_log_checksum_algorithm);

ib_logf(IB_LOG_LEVEL_ERROR,
"current InnoDB log checksum type: %s, "
"detected log checksum type: %s",
current_algo,
algo);
}

ib_logf(IB_LOG_LEVEL_FATAL,
"STRICT method was specified for innodb_log_checksum, "
"so we intentionally assert here.");
}

ut_ad(srv_log_checksum_algorithm == SRV_CHECKSUM_ALGORITHM_CRC32 ||
srv_log_checksum_algorithm == SRV_CHECKSUM_ALGORITHM_INNODB);

if (block_checksum == LOG_NO_CHECKSUM_MAGIC ||
block_checksum == log_block_calc_checksum_crc32(block) ||
block_checksum == log_block_calc_checksum_innodb(block)) {

return(TRUE);
}

if (log_block_get_hdr_no(block) == block_checksum) {

/* We assume the log block is in the format of
InnoDB version < 3.23.52 and the block is ok */
#if 0
fprintf(stderr,
"InnoDB: Scanned old format < InnoDB-3.23.52"
" log block number %lu\n",
log_block_get_hdr_no(block));
#endif
return(TRUE);
}

return(FALSE);
}

void recv_dblwr_t::add(byte* page)
{
pages.push_back(page);
Expand Down
1 change: 1 addition & 0 deletions storage/xtradb/os/os0file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1010,6 +1010,7 @@ os_file_lock(
#ifndef UNIV_HOTBACKUP
/****************************************************************//**
Creates the seek mutexes used in positioned reads and writes. */
static
void
os_io_init_simple(void)
/*===================*/
Expand Down
7 changes: 0 additions & 7 deletions storage/xtradb/srv/srv0srv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,6 @@ UNIV_INTERN ulong srv_read_ahead_threshold = 56;

#ifdef UNIV_LOG_ARCHIVE
UNIV_INTERN ibool srv_log_archive_on = FALSE;
UNIV_INTERN ibool srv_archive_recovery = 0;
UNIV_INTERN ib_uint64_t srv_archive_recovery_limit_lsn;
#endif /* UNIV_LOG_ARCHIVE */

/* This parameter is used to throttle the number of insert buffers that are
Expand Down Expand Up @@ -536,11 +534,6 @@ UNIV_INTERN ulong srv_doublewrite_batch_size = 120;

UNIV_INTERN ulong srv_replication_delay = 0;

UNIV_INTERN ibool srv_apply_log_only = FALSE;

UNIV_INTERN ibool srv_backup_mode = FALSE;
UNIV_INTERN ibool srv_close_files = TRUE;

UNIV_INTERN ulong srv_pass_corrupt_table = 0; /* 0:disable 1:enable */

UNIV_INTERN ulong srv_log_checksum_algorithm =
Expand Down
10 changes: 3 additions & 7 deletions storage/xtradb/srv/srv0start.cc
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ SRV_SHUTDOWN_CLEANUP and then to SRV_SHUTDOWN_LAST_PHASE, and so on */
UNIV_INTERN enum srv_shutdown_state srv_shutdown_state = SRV_SHUTDOWN_NONE;

/** Files comprising the system tablespace */
os_file_t files[1000];
static os_file_t files[1000];

/** io_handler_thread parameters for thread identification */
static ulint n[SRV_MAX_N_IO_THREADS];
Expand Down Expand Up @@ -826,7 +826,7 @@ open_log_file(
/*********************************************************************//**
Creates or opens database data files and closes them.
@return DB_SUCCESS or error code */
MY_ATTRIBUTE((nonnull, warn_unused_result))
static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
open_or_create_data_files(
/*======================*/
Expand Down Expand Up @@ -1367,15 +1367,12 @@ srv_undo_tablespace_open(
/********************************************************************
Opens the configured number of undo tablespaces.
@return DB_SUCCESS or error code */
static
dberr_t
srv_undo_tablespaces_init(
/*======================*/
ibool create_new_db, /*!< in: TRUE if new db being
created */
ibool backup_mode, /*!< in: TRUE disables reading
the system tablespace (used in
XtraBackup), FALSE is passed on
recovery. */
const ulint n_conf_tablespaces, /*!< in: configured undo
tablespaces */
ulint* n_opened) /*!< out: number of UNDO
Expand Down Expand Up @@ -2418,7 +2415,6 @@ innobase_start_or_create_for_mysql(void)

err = srv_undo_tablespaces_init(
create_new_db,
FALSE,
srv_undo_tablespaces,
&srv_undo_tablespaces_open);

Expand Down

0 comments on commit ee1d08c

Please sign in to comment.