diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2017-05-21 22:19:06 +0000 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2017-05-21 22:19:06 +0000 |
commit | ee4eda40b9b49376c32ede357af0e3c5721195f8 (patch) | |
tree | 4d8e2e853e35f23da63c63c82a39e2135b261036 | |
parent | 90c52e5291b3ad0935df7da56ec0fcbf530733b4 (diff) | |
download | mariadb-git-ee4eda40b9b49376c32ede357af0e3c5721195f8.tar.gz |
MDEV-12832 : remove libarchive support from mariabackup,
due to different packaging issues.
Also, Percona thinks that tar support has many limitations
and should be removed as well( see discussion in
https://bugs.launchpad.net/percona-xtrabackup/+bug/1681721)
there is an alternative streaming format xbstream that is supported and
does not have these limitations.
-rw-r--r-- | extra/mariabackup/CMakeLists.txt | 96 | ||||
-rw-r--r-- | extra/mariabackup/innobackupex.cc | 4 | ||||
-rw-r--r-- | extra/mariabackup/xbstream.h | 1 | ||||
-rw-r--r-- | extra/mariabackup/xtrabackup.cc | 53 | ||||
-rw-r--r-- | mysql-test/suite/mariabackup/suite.pm | 5 | ||||
-rw-r--r-- | mysql-test/suite/mariabackup/tar.result | 12 | ||||
-rw-r--r-- | mysql-test/suite/mariabackup/tar.test | 30 | ||||
-rw-r--r-- | mysql-test/suite/mariabackup/xbstream.test | 2 |
8 files changed, 7 insertions, 196 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/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/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 c55466c07c1..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 { @@ -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 */ @@ -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/mysql-test/suite/mariabackup/suite.pm b/mysql-test/suite/mariabackup/suite.pm index 8eecd4e8018..26d5c06cdad 100644 --- a/mysql-test/suite/mariabackup/suite.pm +++ b/mysql-test/suite/mariabackup/suite.pm @@ -21,11 +21,6 @@ $ENV{XBSTREAM}= ::mtr_exe_maybe_exists( "$::bindir/extra/mariabackup/$::opt_vs_config/mbstream", "$::path_client_bindir/mbstream"); -my $tar_version = `tar --version 2>&1`; -$ENV{HAVE_TAR} = $! ? 0: 1; -my $mariabackup_help=`$mariabackup_exe --help 2>&1`; -$ENV{HAVE_XTRABACKUP_TAR_SUPPORT} = (index($mariabackup_help,"'tar'") == -1) ? 0 : 1; - $ENV{INNOBACKUPEX}= "$mariabackup_exe --innobackupex"; sub skip_combinations { diff --git a/mysql-test/suite/mariabackup/tar.result b/mysql-test/suite/mariabackup/tar.result deleted file mode 100644 index bbb546d7add..00000000000 --- a/mysql-test/suite/mariabackup/tar.result +++ /dev/null @@ -1,12 +0,0 @@ -CREATE TABLE t(i INT) ENGINE INNODB; -INSERT INTO t VALUES(1); -# xtrabackup backup -# xtrabackup prepare -# shutdown server -# remove datadir -# xtrabackup move back -# restart server -SELECT * FROM t; -i -1 -DROP TABLE t; diff --git a/mysql-test/suite/mariabackup/tar.test b/mysql-test/suite/mariabackup/tar.test deleted file mode 100644 index 3938d597e05..00000000000 --- a/mysql-test/suite/mariabackup/tar.test +++ /dev/null @@ -1,30 +0,0 @@ -if (`select $HAVE_TAR = 0`) -{ - --skip No tar -} -if (`select $HAVE_XTRABACKUP_TAR_SUPPORT = 0`) -{ - --skip Compiled without libarchive -} - - -CREATE TABLE t(i INT) ENGINE INNODB; -INSERT INTO t VALUES(1); - -echo # xtrabackup backup; -let $targetdir=$MYSQLTEST_VARDIR/tmp/backup; -let $streamfile=$MYSQLTEST_VARDIR/tmp/backup.tar; -mkdir $targetdir; - - -exec $XTRABACKUP "--defaults-file=$MYSQLTEST_VARDIR/my.cnf" --backup --stream=tar > $streamfile 2>$targetdir/backup_stream.log; ---disable_result_log -exec tar -C $targetdir -x < $streamfile; -echo # xtrabackup prepare; -exec $XTRABACKUP --prepare --target-dir=$targetdir; - --- source include/restart_and_restore.inc ---enable_result_log -SELECT * FROM t; -DROP TABLE t; -rmdir $targetdir; diff --git a/mysql-test/suite/mariabackup/xbstream.test b/mysql-test/suite/mariabackup/xbstream.test index 06e5685276c..f2b4704a87e 100644 --- a/mysql-test/suite/mariabackup/xbstream.test +++ b/mysql-test/suite/mariabackup/xbstream.test @@ -9,7 +9,7 @@ echo # xtrabackup backup to stream; exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --stream=xbstream > $streamfile 2>$targetdir/backup_stream.log; echo # xbstream extract; --disable_result_log -exec $XBSTREAM -x -C $targetdir --parallel=16 < $streamfile; +exec $XBSTREAM -x -C $targetdir < $streamfile; echo # xtrabackup prepare; exec $XTRABACKUP --prepare --target-dir=$targetdir; |