diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2017-05-23 11:09:47 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2017-05-23 11:09:47 +0300 |
commit | 8f643e2063c9890a353149f39ef85b2cf3151fd0 (patch) | |
tree | c5468b905c8858dc1cc80ccb2072a923b28c8783 /extra | |
parent | 3aecedb2f8f99c446a5ba0b02efcf422a252c9e8 (diff) | |
parent | b61700c22104b513caa9a85e5c6529aa5f2bf4e4 (diff) | |
download | mariadb-git-8f643e2063c9890a353149f39ef85b2cf3151fd0.tar.gz |
Merge 10.1 into 10.2
Diffstat (limited to 'extra')
-rw-r--r-- | extra/mariabackup/CMakeLists.txt | 96 | ||||
-rw-r--r-- | extra/mariabackup/backup_copy.cc | 2 | ||||
-rw-r--r-- | extra/mariabackup/changed_page_bitmap.cc | 2 | ||||
-rw-r--r-- | extra/mariabackup/crc/crc_glue.c | 2 | ||||
-rw-r--r-- | extra/mariabackup/fil_cur.h | 2 | ||||
-rw-r--r-- | extra/mariabackup/innobackupex.cc | 4 | ||||
-rw-r--r-- | extra/mariabackup/xb0xb.h | 2 | ||||
-rw-r--r-- | extra/mariabackup/xbstream.h | 1 | ||||
-rw-r--r-- | extra/mariabackup/xtrabackup.cc | 71 | ||||
-rw-r--r-- | extra/mariabackup/xtrabackup.h | 4 |
10 files changed, 22 insertions, 164 deletions
diff --git a/extra/mariabackup/CMakeLists.txt b/extra/mariabackup/CMakeLists.txt index 693082b765a..ac15460660c 100644 --- a/extra/mariabackup/CMakeLists.txt +++ b/extra/mariabackup/CMakeLists.txt @@ -27,101 +27,6 @@ IF(NOT WIN32) ENDIF() ENDIF() -IF(WITH_LIBARCHIVE STREQUAL "STATIC") - SET(CMAKE_FIND_LIBRARY_SUFFIXES .a .lib) -ENDIF() - -FIND_PACKAGE(LibArchive) - -IF(NOT DEFINED WITH_LIBARCHIVE) - IF(LibArchive_FOUND) - SET(WITH_LIBARCHIVE_DEFAULT ON) - ELSE() - SET(WITH_LIBARCHIVE_DEFAULT OFF) - ENDIF() - SET(WITH_LIBARCHIVE ${WITH_LIBARCHIVE_DEFAULT} CACHE STRING "Use libarchive for streaming features (ON, OFF or STATIC)" ) -ENDIF() - -IF(NOT WITH_LIBARCHIVE MATCHES "^(ON|OFF|STATIC)$") - MESSAGE(FATAL_ERROR "Invalid value for WITH_LIBARCHIVE: '${WITH_LIBARCHIVE}'. Use one of ON, OFF or STATIC") -ENDIF() - -IF(UNIX) - SET(PIC_FLAG -fPIC) -ENDIF() - -IF((NOT WITH_LIBARCHIVE STREQUAL "OFF") AND (NOT LibArchive_FOUND)) - IF(CMAKE_VERSION VERSION_LESS "2.8.12") - MESSAGE("libarchive can't be built, old cmake") - ELSE() - # Build a local version - INCLUDE(ExternalProject) - SET(LIBARCHIVE_DIR ${CMAKE_CURRENT_BINARY_DIR}/libarchive) - SET(libarchive_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/libarchive) - SET(libarchive_CMAKE_ARGS - -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> - -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} - -DENABLE_ICONV=OFF - -DENABLE_TAR=ON - -DENABLE_OPENSSL=OFF - -DENABLE_TEST=OFF - "-DCMAKE_C_FLAGS_DEBUG=${CMAKE_C_FLAGS_DEBUG} ${PIC_FLAG}" - "-DCMAKE_C_FLAGS_RELWITHDEBINFO=${CMAKE_C_FLAGS_RELWITHDEBINFO} ${PIC_FLAG}" - "-DCMAKE_C_FLAGS_RELEASE=${CMAKE_C_FLAGS_RELEASE} ${PIC_FLAG}" - "-DCMAKE_C_FLAGS_MINSIZEREL=${CMAKE_C_FLAGS_MINSIZEREL} ${PIC_FLAG}" - ) - IF(WIN32) - SET(libarchive_CMAKE_ARGS ${libarchive_CMAKE_ARGS} -DWINDOWS_VERSION=WIN7 -DCMAKE_DEBUG_POSTFIX=d) - SET(LIBARCHIVE_RELEASE_LIB ${LIBARCHIVE_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}archive_static${CMAKE_STATIC_LIBRARY_SUFFIX}) - SET(LIBARCHIVE_DEBUG_LIB ${LIBARCHIVE_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}archive_staticd${CMAKE_STATIC_LIBRARY_SUFFIX}) - SET(byproducts ${LIBARCHIVE_RELEASE_LIB} ${LIBARCHIVE_DEBUG_LIB}) - ELSE() - SET(LIBARCHIVE_LIB ${LIBARCHIVE_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}archive${CMAKE_STATIC_LIBRARY_SUFFIX}) - SET(byproducts ${LIBARCHIVE_LIB}) - ENDIF() - - IF(CMAKE_VERSION VERSION_GREATER "3.1") - SET(byproducts BUILD_BYPRODUCTS ${byproducts}) - ENDIF() - - ExternalProject_Add(libarchive - PREFIX ${libarchive_PREFIX} - DOWNLOAD_DIR ${LIBARCHIVE_DIR} - URL http://www.libarchive.org/downloads/libarchive-3.2.2.tar.gz - INSTALL_DIR ${LIBARCHIVE_DIR} - CMAKE_ARGS ${libarchive_CMAKE_ARGS} - ${byproducts} - ) - ADD_LIBRARY(archive_static STATIC IMPORTED) - ADD_DEPENDENCIES(archive_static libarchive) - IF(WIN32) - SET_PROPERTY(TARGET archive_static PROPERTY IMPORTED_LOCATION_RELWITHDEBINFO ${LIBARCHIVE_RELEASE_LIB}) - SET_PROPERTY(TARGET archive_static PROPERTY IMPORTED_LOCATION_RELEASE ${LIBARCHIVE_RELEASE_LIB}) - SET_PROPERTY(TARGET archive_static PROPERTY IMPORTED_LOCATION_DEBUG ${LIBARCHIVE_DEBUG_LIB}) - SET_PROPERTY(TARGET archive_static PROPERTY IMPORTED_LOCATION_MINSIZEREL ${LIBARCHIVE_RELEASE_LIB}) - ELSE() - SET_PROPERTY(TARGET archive_static PROPERTY IMPORTED_LOCATION ${LIBARCHIVE_LIB}) - ENDIF() - - SET(LibArchive_FOUND ON ) - SET(LibArchive_INCLUDE_DIRS ${LIBARCHIVE_DIR}/include ) - SET(LibArchive_LIBRARIES archive_static) - IF(WIN32) - SET(LIBARCHIVE_STATIC 1) - ENDIF() - ENDIF() -ENDIF() - - -IF(WITH_LIBARCHIVE AND LibArchive_FOUND) - ADD_DEFINITIONS(-DHAVE_LIBARCHIVE) - IF(LIBARCHIVE_STATIC) - ADD_DEFINITIONS(-DLIBARCHIVE_STATIC) - ENDIF() - INCLUDE_DIRECTORIES(${LibArchive_INCLUDE_DIRS}) - LINK_LIBRARIES(${LibArchive_LIBRARIES}) - SET(DS_ARCHIVE_SOURCE ds_archive.c) -ENDIF() INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/include @@ -154,7 +59,6 @@ MYSQL_ADD_EXECUTABLE(mariabackup innobackupex.cc changed_page_bitmap.cc datasink.c - ${DS_ARCHIVE_SOURCE} ds_buffer.c ds_compress.c ds_local.c diff --git a/extra/mariabackup/backup_copy.cc b/extra/mariabackup/backup_copy.cc index 1565e20d732..306009e2139 100644 --- a/extra/mariabackup/backup_copy.cc +++ b/extra/mariabackup/backup_copy.cc @@ -450,7 +450,7 @@ datadir_iter_free(datadir_iter_t *it) /************************************************************************ Holds the state needed to copy single data file. */ struct datafile_cur_t { - os_file_t file; + pfs_os_file_t file; char rel_path[FN_REFLEN]; char abs_path[FN_REFLEN]; MY_STAT statinfo; diff --git a/extra/mariabackup/changed_page_bitmap.cc b/extra/mariabackup/changed_page_bitmap.cc index 435b7fb6172..86a873ef69c 100644 --- a/extra/mariabackup/changed_page_bitmap.cc +++ b/extra/mariabackup/changed_page_bitmap.cc @@ -35,7 +35,7 @@ Remove these on the first opportunity, i.e. single-binary XtraBackup. */ /** Single bitmap file information */ struct log_online_bitmap_file_t { char name[FN_REFLEN]; /*!< Name with full path */ - os_file_t file; /*!< Handle to opened file */ + pfs_os_file_t file; /*!< Handle to opened file */ ib_uint64_t size; /*!< Size of the file */ ib_uint64_t offset; /*!< Offset of the next read, or count of already-read bytes diff --git a/extra/mariabackup/crc/crc_glue.c b/extra/mariabackup/crc/crc_glue.c index ae3fa91c1b0..c301cb01e2e 100644 --- a/extra/mariabackup/crc/crc_glue.c +++ b/extra/mariabackup/crc/crc_glue.c @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA *******************************************************/ - +#include "my_config.h" #include "crc_glue.h" #include "crc-intel-pclmul.h" #include <stdint.h> diff --git a/extra/mariabackup/fil_cur.h b/extra/mariabackup/fil_cur.h index 88239efd2bb..f3601823a5a 100644 --- a/extra/mariabackup/fil_cur.h +++ b/extra/mariabackup/fil_cur.h @@ -29,7 +29,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA #include "read_filt.h" struct xb_fil_cur_t { - os_file_t file; /*!< source file handle */ + pfs_os_file_t file; /*!< source file handle */ fil_node_t* node; /*!< source tablespace node */ char rel_path[FN_REFLEN]; /*!< normalized file path */ diff --git a/extra/mariabackup/innobackupex.cc b/extra/mariabackup/innobackupex.cc index 59fb8fb5565..2114e546440 100644 --- a/extra/mariabackup/innobackupex.cc +++ b/extra/mariabackup/innobackupex.cc @@ -848,9 +848,7 @@ ibx_get_one_option(int optid, opt_ibx_decrypt = true; break; case OPT_STREAM: - if (!strcasecmp(argument, "tar")) - xtrabackup_stream_fmt = XB_STREAM_FMT_TAR; - else if (!strcasecmp(argument, "xbstream")) + if (!strcasecmp(argument, "xbstream")) xtrabackup_stream_fmt = XB_STREAM_FMT_XBSTREAM; else { ibx_msg("Invalid --stream argument: %s\n", argument); diff --git a/extra/mariabackup/xb0xb.h b/extra/mariabackup/xb0xb.h index 659ab8ea5d0..c6e4ae22de6 100644 --- a/extra/mariabackup/xb0xb.h +++ b/extra/mariabackup/xb0xb.h @@ -23,7 +23,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA extern void os_io_init_simple(void); -extern os_file_t files[1000]; +extern pfs_os_file_t files[1000]; extern const char *innodb_checksum_algorithm_names[]; extern TYPELIB innodb_checksum_algorithm_typelib; extern dberr_t open_or_create_data_files( diff --git a/extra/mariabackup/xbstream.h b/extra/mariabackup/xbstream.h index ac1bf05e321..08b017ca5ce 100644 --- a/extra/mariabackup/xbstream.h +++ b/extra/mariabackup/xbstream.h @@ -42,7 +42,6 @@ typedef struct xb_wstream_file_struct xb_wstream_file_t; typedef enum { XB_STREAM_FMT_NONE, - XB_STREAM_FMT_TAR, XB_STREAM_FMT_XBSTREAM } xb_stream_fmt_t; diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc index 4fe80819622..16a39c58d5c 100644 --- a/extra/mariabackup/xtrabackup.cc +++ b/extra/mariabackup/xtrabackup.cc @@ -704,11 +704,7 @@ struct my_option xb_client_options[] = {"stream", OPT_XTRA_STREAM, "Stream all backup files to the standard output " "in the specified format." -#ifdef HAVE_LIBARCHIVE - "Supported formats are 'tar' and 'xbstream'." -#else "Supported format is 'xbstream'." -#endif , (G_PTR*) &xtrabackup_stream_str, (G_PTR*) &xtrabackup_stream_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, @@ -1453,9 +1449,7 @@ xb_get_one_option(int optid, xtrabackup_target_dir= xtrabackup_real_target_dir; break; case OPT_XTRA_STREAM: - if (!strcasecmp(argument, "tar")) - xtrabackup_stream_fmt = XB_STREAM_FMT_TAR; - else if (!strcasecmp(argument, "xbstream")) + if (!strcasecmp(argument, "xbstream")) xtrabackup_stream_fmt = XB_STREAM_FMT_XBSTREAM; else { @@ -2412,7 +2406,7 @@ check_if_skip_table( Reads the space flags from a given data file and returns the compressed page size, or 0 if the space is not compressed. */ ulint -xb_get_zip_size(os_file_t file) +xb_get_zip_size(pfs_os_file_t file) { byte *buf; byte *page; @@ -3106,14 +3100,6 @@ files first, and then streams them in a serialized way when closed. */ static void xtrabackup_init_datasinks(void) { - if (xtrabackup_parallel > 1 && xtrabackup_stream && - xtrabackup_stream_fmt == XB_STREAM_FMT_TAR) { - msg("xtrabackup: warning: the --parallel option does not have " - "any effect when streaming in the 'tar' format. " - "You can use the 'xbstream' format instead.\n"); - xtrabackup_parallel = 1; - } - /* Start building out the pipelines from the terminus back */ if (xtrabackup_stream) { /* All streaming goes to stdout */ @@ -3131,30 +3117,17 @@ xtrabackup_init_datasinks(void) /* Stream formatting */ if (xtrabackup_stream) { ds_ctxt_t *ds; - if (xtrabackup_stream_fmt == XB_STREAM_FMT_TAR) { - ds = ds_create(xtrabackup_target_dir, DS_TYPE_ARCHIVE); - } else if (xtrabackup_stream_fmt == XB_STREAM_FMT_XBSTREAM) { - ds = ds_create(xtrabackup_target_dir, DS_TYPE_XBSTREAM); - } else { - /* bad juju... */ - ds = NULL; - } + + ut_a(xtrabackup_stream_fmt == XB_STREAM_FMT_XBSTREAM); + ds = ds_create(xtrabackup_target_dir, DS_TYPE_XBSTREAM); xtrabackup_add_datasink(ds); ds_set_pipe(ds, ds_data); ds_data = ds; - if (xtrabackup_stream_fmt != XB_STREAM_FMT_XBSTREAM) { - /* 'tar' does not allow parallel streams */ - ds_redo = ds_meta = ds_create(xtrabackup_target_dir, - DS_TYPE_TMPFILE); - xtrabackup_add_datasink(ds_meta); - ds_set_pipe(ds_meta, ds); - } else { - ds_redo = ds_meta = ds_data; - } + ds_redo = ds_meta = ds_data; } /* Encryption */ @@ -4856,7 +4829,7 @@ end: static my_bool xtrabackup_init_temp_log(void) { - os_file_t src_file = XB_FILE_UNDEFINED; + pfs_os_file_t src_file; char src_path[FN_REFLEN]; char dst_path[FN_REFLEN]; ibool success; @@ -5183,7 +5156,7 @@ xb_space_create_file( ulint space_id, /*!<in: space id */ ulint flags __attribute__((unused)),/*!<in: tablespace flags */ - os_file_t* file) /*!<out: file handle */ + pfs_os_file_t* file) /*!<out: file handle */ { ibool ret; byte* buf; @@ -5262,7 +5235,7 @@ mismatching ID, renames it to xtrabackup_tmp_#ID.ibd. If there was no matching file, creates a new tablespace. @return file handle of matched or created file */ static -os_file_t +pfs_os_file_t xb_delta_open_matching_space( const char* dbname, /* in: path to destination database dir */ const char* name, /* in: name of delta file (without .delta) */ @@ -5276,7 +5249,7 @@ xb_delta_open_matching_space( char dest_space_name[FN_REFLEN]; ibool ok; fil_space_t* fil_space; - os_file_t file = 0; + pfs_os_file_t file; ulint tablespace_flags; xb_filter_entry_t* table; @@ -5440,8 +5413,8 @@ xtrabackup_apply_delta( including the .delta extension */ void* /*data*/) { - os_file_t src_file = XB_FILE_UNDEFINED; - os_file_t dst_file = XB_FILE_UNDEFINED; + pfs_os_file_t src_file; + pfs_os_file_t dst_file; char src_path[FN_REFLEN]; char dst_path[FN_REFLEN]; char meta_path[FN_REFLEN]; @@ -5815,7 +5788,7 @@ xtrabackup_apply_deltas() static my_bool xtrabackup_close_temp_log(my_bool clear_flag) { - os_file_t src_file = XB_FILE_UNDEFINED; + pfs_os_file_t src_file; char src_path[FN_REFLEN]; char dst_path[FN_REFLEN]; ibool success; @@ -6597,7 +6570,7 @@ skip_check: if (xtrabackup_export) { msg("xtrabackup: export option is specified.\n"); - os_file_t info_file = XB_FILE_UNDEFINED; + pfs_os_file_t info_file; char info_file_path[FN_REFLEN]; ibool success; char table_name[FN_REFLEN]; @@ -7406,22 +7379,6 @@ int main(int argc, char **argv) innobase_file_per_table = TRUE; } - if (xtrabackup_incremental && xtrabackup_stream && - xtrabackup_stream_fmt == XB_STREAM_FMT_TAR) { - msg("xtrabackup: error: " - "streaming incremental backups are incompatible with the \n" - "'tar' streaming format. Use --stream=xbstream instead.\n"); - exit(EXIT_FAILURE); - } - - if ((xtrabackup_compress || xtrabackup_encrypt) && xtrabackup_stream && - xtrabackup_stream_fmt == XB_STREAM_FMT_TAR) { - msg("xtrabackup: error: " - "compressed and encrypted backups are incompatible with the \n" - "'tar' streaming format. Use --stream=xbstream instead.\n"); - exit(EXIT_FAILURE); - } - if (!xtrabackup_prepare && (innobase_log_arch_dir || xtrabackup_archived_to_lsn)) { diff --git a/extra/mariabackup/xtrabackup.h b/extra/mariabackup/xtrabackup.h index 51491ce1f00..d3c4c486d9f 100644 --- a/extra/mariabackup/xtrabackup.h +++ b/extra/mariabackup/xtrabackup.h @@ -27,7 +27,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA #include "changed_page_bitmap.h" #ifdef __WIN__ -#define XB_FILE_UNDEFINED NULL +#define XB_FILE_UNDEFINED INVALID_HANDLE_VALUE #else #define XB_FILE_UNDEFINED (-1) #endif @@ -194,7 +194,7 @@ void xb_data_files_close(void); /*********************************************************************** Reads the space flags from a given data file and returns the compressed page size, or 0 if the space is not compressed. */ -ulint xb_get_zip_size(os_file_t file); +ulint xb_get_zip_size(pfs_os_file_t file); /************************************************************************ Checks if a table specified as a name in the form "database/name" (InnoDB 5.6) |