~akopytov/percona-xtrabackup/support-gtid-2.0

« back to all changes in this revision

Viewing changes to src/xtrabackup.cc

  • Committer: Alexey Kopytov
  • Date: 2013-04-23 11:04:23 UTC
  • Revision ID: akopytov@gmail.com-20130423110423-lt13snzi53lps1xf
Implementation of
https://blueprints.launchpad.net/percona-xtrabackup/+spec/support-56-innodb-page-size

innodb_page_size was only handled by XtraDB-based binaries, but ignored
by xtrabackup_56, since it is not XtraDB-based.

This revision also removes innodb_file_per_table from --print-param,
since it was not used by anything and is not required on any backup
stage.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1428
1428
long innobase_mirrored_log_groups = 1;
1429
1429
long innobase_open_files = 300L;
1430
1430
 
1431
 
long innobase_page_size = (1 << 14); /* 16KB */
 
1431
longlong innobase_page_size = (1LL << 14); /* 16KB */
1432
1432
#ifdef XTRADB_BASED
1433
1433
static ulong innobase_log_block_size = 512;
1434
1434
#endif
1623
1623
#if MYSQL_VERSION_ID >= 50500
1624
1624
  OPT_INNODB_USE_NATIVE_AIO,
1625
1625
#endif
1626
 
#ifdef XTRADB_BASED
 
1626
#if defined(XTRADB_BASED) || MYSQL_VERSION_ID >= 50600
1627
1627
  OPT_INNODB_PAGE_SIZE,
 
1628
#endif
 
1629
#ifdef XTRADB_BASED
1628
1630
  OPT_INNODB_LOG_BLOCK_SIZE,
1629
1631
  OPT_INNODB_FAST_CHECKSUM,
1630
1632
  OPT_INNODB_EXTRA_UNDOSLOTS,
1930
1932
   (G_PTR*) &srv_use_native_aio, 0, GET_BOOL, NO_ARG,
1931
1933
   FALSE, 0, 0, 0, 0, 0},
1932
1934
#endif
1933
 
#ifdef XTRADB_BASED
 
1935
#if defined(XTRADB_BASED) || MYSQL_VERSION_ID >= 50600
1934
1936
  {"innodb_page_size", OPT_INNODB_PAGE_SIZE,
1935
1937
   "The universal page size of the database.",
1936
1938
   (G_PTR*) &innobase_page_size, (G_PTR*) &innobase_page_size, 0,
1937
 
   GET_LONG, REQUIRED_ARG, (1 << 14), (1 << 12), (1 << UNIV_PAGE_SIZE_SHIFT_MAX), 0, 1L, 0},
 
1939
   /* Use GET_LL to support numeric suffixes in 5.6 */
 
1940
   GET_LL, REQUIRED_ARG,
 
1941
   (1LL << 14), (1LL << 12), (1LL << UNIV_PAGE_SIZE_SHIFT_MAX), 0, 1L, 0},
 
1942
#endif
 
1943
#ifdef XTRADB_BASED
1938
1944
  {"innodb_log_block_size", OPT_INNODB_LOG_BLOCK_SIZE,
1939
1945
  "The log block size of the transaction log file. "
1940
1946
   "Changing for created log file is not supported. Use on your own risk!",
2932
2938
        /* dummy for initialize all_charsets[] */
2933
2939
        get_charset_name(0);
2934
2940
 
2935
 
#ifdef XTRADB_BASED
 
2941
#if defined(XTRADB_BASED) || MYSQL_VERSION_ID >= 50600
2936
2942
        srv_page_size = 0;
2937
2943
        srv_page_size_shift = 0;
2938
2944
 
2939
 
        if (innobase_page_size != (1 << 14)) {
2940
 
                int n_shift = get_bit_shift(innobase_page_size);
 
2945
        if (innobase_page_size != (1LL << 14)) {
 
2946
                int n_shift = get_bit_shift((ulint) innobase_page_size);
2941
2947
 
2942
2948
                if (n_shift >= 12 && n_shift <= UNIV_PAGE_SIZE_SHIFT_MAX) {
2943
 
                        msg("InnoDB: Warning: innodb_page_size has been "
2944
 
                            "changed from default value 16384.\n");
2945
2949
                        srv_page_size_shift = n_shift;
2946
2950
                        srv_page_size = 1 << n_shift;
2947
2951
                        msg("InnoDB: The universal page size of the "
2948
2952
                            "database is set to %lu.\n", srv_page_size);
2949
2953
                } else {
2950
2954
                        msg("InnoDB: Error: invalid value of "
2951
 
                            "innobase_page_size: %lu", innobase_page_size);
 
2955
                            "innobase_page_size: %lld", innobase_page_size);
2952
2956
                        exit(EXIT_FAILURE);
2953
2957
                }
2954
2958
        } else {
2955
2959
                srv_page_size_shift = 14;
2956
2960
                srv_page_size = (1 << srv_page_size_shift);
2957
2961
        }
2958
 
 
 
2962
#endif
 
2963
#ifdef XTRADB_BASED
2959
2964
        if (!xb_init_log_block_size()) {
2960
2965
                goto error;
2961
2966
        }
7309
7314
        os_sync_mutex = NULL;
7310
7315
#ifdef INNODB_VERSION_SHORT
7311
7316
        ut_mem_init();
7312
 
#ifdef XTRADB_BASED
 
7317
#if defined(XTRADB_BASED) || MYSQL_VERSION_ID >= 50600
7313
7318
        /* temporally dummy value to avoid crash */
7314
7319
        srv_page_size_shift = 14;
7315
7320
        srv_page_size = (1 << srv_page_size_shift);
7818
7823
        my_load_path(xtrabackup_real_target_dir, xtrabackup_target_dir, NULL);
7819
7824
        xtrabackup_target_dir= xtrabackup_real_target_dir;
7820
7825
 
7821
 
#ifdef XTRADB_BASED
 
7826
#if defined(XTRADB_BASED) || MYSQL_VERSION_ID >= 50600
7822
7827
        /* temporary setting of enough size */
7823
7828
        srv_page_size_shift = UNIV_PAGE_SIZE_SHIFT_MAX;
7824
7829
        srv_page_size = UNIV_PAGE_SIZE_MAX;
 
7830
#endif
 
7831
#ifdef XTRADB_BASED
7825
7832
        srv_log_block_size = 512;
7826
7833
#endif
7827
7834
        if (xtrabackup_backup && xtrabackup_incremental) {
7922
7929
                printf("innodb_flush_method = \"%s\"\n",
7923
7930
                       (innobase_unix_file_flush_method != NULL) ?
7924
7931
                       innobase_unix_file_flush_method : "");
 
7932
#if defined(XTRADB_BASED) || MYSQL_VERSION_ID >= 50600
 
7933
                printf("innodb_page_size = %lld\n", innobase_page_size);
 
7934
#endif
7925
7935
#ifdef XTRADB_BASED
7926
7936
                printf("innodb_fast_checksum = %d\n", innobase_fast_checksum);
7927
 
                printf("innodb_page_size = %ld\n", innobase_page_size);
7928
7937
                printf("innodb_log_block_size = %lu\n", innobase_log_block_size);
7929
7938
                if (innobase_doublewrite_file != NULL) {
7930
7939
                        printf("innodb_doublewrite_file = %s\n", innobase_doublewrite_file);
7931
7940
                }
7932
 
                printf("innodb_file_per_table = %d\n",
7933
 
                       (int) innobase_file_per_table);
7934
7941
#endif
7935
7942
#if MYSQL_VERSION_ID >= 50600
7936
7943
                if (srv_undo_dir) {