2746
2754
static int embedded_innodb_init(drizzled::module::Context &context)
2757
const module::option_map &vm= context.getOptions();
2758
if (vm.count("additional-mem-pool-size"))
2760
if (innobase_additional_mem_pool_size > LONG_MAX || innobase_additional_mem_pool_size < 512*1024L)
2762
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value of additional-mem-pool-size"));
2765
innobase_additional_mem_pool_size/= 1024;
2766
innobase_additional_mem_pool_size*= 1024;
2769
if (vm.count("autoextend-increment"))
2771
if (srv_auto_extend_increment > 1000L || srv_auto_extend_increment < 1L)
2773
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value of autoextend-increment"));
2778
if (vm.count("buffer-pool-size"))
2780
if (innobase_buffer_pool_size > INT64_MAX || innobase_buffer_pool_size < 5*1024*1024L)
2782
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value of buffer-pool-size"));
2785
innobase_buffer_pool_size/= 1024*1024L;
2786
innobase_buffer_pool_size*= 1024*1024L;
2789
if (vm.count("io-capacity"))
2791
if (srv_io_capacity > (unsigned long)~0L || srv_io_capacity < 100)
2793
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value of io-capacity"));
2798
if (vm.count("fast-shutdown"))
2800
if (innobase_fast_shutdown > 2)
2802
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value of fast-shutdown"));
2807
if (vm.count("flush-log-at-trx-commit"))
2809
if (srv_flush_log_at_trx_commit > 2)
2811
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value of flush-log-at-trx-commit"));
2816
if (vm.count("force-recovery"))
2818
if (innobase_force_recovery > 6)
2820
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value of force-recovery"));
2825
if (vm.count("log-file-size"))
2827
if (innodb_log_file_size > INT64_MAX || innodb_log_file_size < 1*1024*1024L)
2829
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value of log-file-size"));
2832
innodb_log_file_size/= 1024*1024L;
2833
innodb_log_file_size*= 1024*1024L;
2836
if (vm.count("log-files-in-group"))
2838
if (innodb_log_files_in_group > 100 || innodb_log_files_in_group < 2)
2840
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value of log-files-in-group"));
2845
if (vm.count("lock-wait-timeout"))
2847
if (innobase_lock_wait_timeout > 1024*1024*1024 || innobase_lock_wait_timeout < 1)
2849
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value of lock-wait-timeout"));
2854
if (vm.count("log-buffer-size"))
2856
if (innobase_log_buffer_size > LONG_MAX || innobase_log_buffer_size < 256*1024L)
2858
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value of log-buffer-size"));
2861
innobase_log_buffer_size/= 1024;
2862
innobase_log_buffer_size*= 1024;
2865
if (vm.count("lru-old-blocks-pct"))
2867
if (innobase_lru_old_blocks_pct > 95 || innobase_lru_old_blocks_pct < 5)
2869
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value of lru-old-blocks-pct"));
2874
if (vm.count("lru-block-access-recency"))
2876
if (innobase_lru_block_access_recency > ULONG_MAX)
2878
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value of lru-block-access-recency"));
2883
if (vm.count("max-dirty-pages-pct"))
2885
if (srv_max_buf_pool_modified_pct > 99)
2887
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value of max-dirty-pages-pct"));
2892
if (vm.count("max-purge-lag"))
2894
if (srv_max_purge_lag > (unsigned long)~0L)
2896
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value of max-purge-lag"));
2901
if (vm.count("open-files"))
2903
if (innobase_open_files > LONG_MAX || innobase_open_files < 10L)
2905
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value of open-files"));
2910
if (vm.count("read-io-threads"))
2912
if (innobase_read_io_threads > 64 || innobase_read_io_threads < 1)
2914
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value of read-io-threads"));
2919
if (vm.count("sync-spin-loops"))
2921
if (srv_n_spin_wait_rounds > (unsigned long)~0L)
2923
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value of sync_spin_loops"));
2928
if (vm.count("data-home-dir"))
2930
innobase_data_home_dir= strdup(vm["data-home-dir"].as<string>().c_str());
2935
innobase_data_home_dir= NULL;
2938
if (vm.count("file-format"))
2940
innobase_file_format_name= strdup(vm["file-format"].as<string>().c_str());
2945
innobase_file_format_name= strdup("Barracuda");
2948
if (vm.count("log-group-home-dir"))
2950
innobase_log_group_home_dir= strdup(vm["log-group-home-dir"].as<string>().c_str());
2955
innobase_log_group_home_dir= NULL;
2958
if (vm.count("flush-method"))
2960
innobase_unix_file_flush_method= strdup(vm["flush-method"].as<string>().c_str());
2965
innobase_unix_file_flush_method= NULL;
2968
if (vm.count("data-file-path"))
2970
innodb_data_file_path= strdup(vm["data-file-path"].as<string>().c_str());
2975
innodb_data_file_path= NULL;
2978
if (vm.count("data-home-dir"))
2980
innobase_data_home_dir= strdup(vm["data-home-dir"].as<string>().c_str());
2985
innobase_data_home_dir= NULL;
2750
2990
err= ib_init();
3217
3465
"Use OS memory allocator instead of InnoDB's internal memory allocator",
3218
3466
NULL, NULL, true);
3468
static void init_options(drizzled::module::option_context &context)
3470
context("adaptive-hash-index",
3471
po::value<bool>(&innobase_adaptive_hash_index)->default_value(true),
3472
N_("Enable InnoDB adaptive hash index (enabled by default)."));
3473
context("adaptive-flushing",
3474
po::value<bool>(&srv_adaptive_flushing)->default_value(true),
3475
N_("Attempt flushing dirty pages to avoid IO bursts at checkpoints."));
3476
context("additional-mem-pool-size",
3477
po::value<long>(&innobase_additional_mem_pool_size)->default_value(8*1024*1024L),
3478
N_("Size of a memory pool InnoDB uses to store data dictionary information and other internal data structures."));
3479
context("autoextend-increment",
3480
po::value<unsigned int>(&srv_auto_extend_increment)->default_value(8L),
3481
N_("Data file autoextend increment in megabytes"));
3482
context("buffer-pool-size",
3483
po::value<int64_t>(&innobase_buffer_pool_size)->default_value(128*1024*1024L),
3484
N_("The size of the memory buffer InnoDB uses to cache data and indexes of its tables."));
3485
context("data-home-dir",
3486
po::value<string>(),
3487
N_("The common part for InnoDB table spaces."));
3488
context("checksums",
3489
po::value<bool>(&innobase_use_checksums)->default_value(true),
3490
N_("Enable InnoDB checksums validation (enabled by default). Disable with --skip-innodb-checksums."));
3491
context("doublewrite",
3492
po::value<bool>(&innobase_use_doublewrite)->default_value(true),
3493
N_("Enable InnoDB doublewrite buffer (enabled by default). Disable with --skip-innodb-doublewrite."));
3494
context("io-capacity",
3495
po::value<unsigned long>(&srv_io_capacity)->default_value(200),
3496
N_("Number of IOPs the server can do. Tunes the background IO rate"));
3497
context("fast-shutdown",
3498
po::value<unsigned long>(&innobase_fast_shutdown)->default_value(1),
3499
N_("Speeds up the shutdown process of the InnoDB storage engine. Possible values are 0, 1 (faster) or 2 (fastest - crash-like)."));
3500
context("file-per-table",
3501
po::value<bool>(&srv_file_per_table)->default_value(false),
3502
N_("Stores each InnoDB table to an .ibd file in the database dir."));
3503
context("file-format",
3504
po::value<string>(),
3505
N_("File format to use for new tables in .ibd files."));
3506
context("flush-log-at-trx-commit",
3507
po::value<unsigned long>(&srv_flush_log_at_trx_commit)->default_value(1),
3508
N_("Set to 0 (write and flush once per second),1 (write and flush at each commit) or 2 (write at commit, flush once per second)."));
3509
context("flush-method",
3510
po::value<string>(),
3511
N_("With which method to flush data."));
3512
context("force-recovery",
3513
po::value<long>(&innobase_force_recovery)->default_value(0),
3514
N_("Helps to save your data in case the disk image of the database becomes corrupt."));
3515
context("data-file-path",
3516
po::value<string>(),
3517
N_("Path to individual files and their sizes."));
3518
context("log-group-home-dir",
3519
po::value<string>(),
3520
N_("Path to individual files and their sizes."));
3521
context("log-group-home-dir",
3522
po::value<string>(),
3523
N_("Path to InnoDB log files."));
3524
context("log-file-size",
3525
po::value<int64_t>(&innodb_log_file_size)->default_value(20*1024*1024L),
3526
N_("Size of each log file in a log group."));
3527
context("innodb-log-files-in-group",
3528
po::value<int64_t>(&innodb_log_files_in_group)->default_value(2),
3529
N_("Number of log files in the log group. InnoDB writes to the files in a circular fashion. Value 3 is recommended here."));
3530
context("lock-wait-timeout",
3531
po::value<unsigned long>(&innobase_lock_wait_timeout)->default_value(5),
3532
N_("Timeout in seconds an InnoDB transaction may wait for a lock before being rolled back. Values above 100000000 disable the timeout."));
3533
context("log-buffer-size",
3534
po::value<long>(&innobase_log_buffer_size)->default_value(8*1024*1024L),
3535
N_("The size of the buffer which InnoDB uses to write log to the log files on disk."));
3536
context("lru-old-blocks-pct",
3537
po::value<unsigned long>(&innobase_lru_old_blocks_pct)->default_value(37),
3538
N_("Sets the point in the LRU list from where all pages are classified as old (Advanced users)"));
3539
context("lru-block-access-recency",
3540
po::value<unsigned long>(&innobase_lru_block_access_recency)->default_value(0),
3541
N_("Milliseconds between accesses to a block at which it is made young. 0=disabled (Advanced users)"));
3542
context("max-dirty-pages-pct",
3543
po::value<unsigned long>(&srv_max_buf_pool_modified_pct)->default_value(75),
3544
N_("Percentage of dirty pages allowed in bufferpool."));
3545
context("max-purge-lag",
3546
po::value<unsigned long>(&srv_max_purge_lag)->default_value(0),
3547
N_("Desired maximum length of the purge queue (0 = no limit)"));
3548
context("rollback-on-timeout",
3549
po::value<bool>(&innobase_rollback_on_timeout)->default_value(false),
3550
N_("Roll back the complete transaction on lock wait timeout, for 4.x compatibility (disabled by default)"));
3551
context("open-files",
3552
po::value<long>(&innobase_open_files)->default_value(300),
3553
N_("How many files at the maximum InnoDB keeps open at the same time."));
3554
context("read-io-threads",
3555
po::value<unsigned long>(&innobase_read_io_threads)->default_value(4),
3556
N_("Number of background read I/O threads in InnoDB."));
3557
context("write-io-threads",
3558
po::value<unsigned long>(&innobase_write_io_threads)->default_value(4),
3559
N_("Number of background write I/O threads in InnoDB."));
3560
context("print-verbose-log",
3561
po::value<bool>(&innobase_print_verbose_log)->default_value(true),
3562
N_("Disable if you want to reduce the number of messages written to the log (default: enabled)."));
3563
context("status-file",
3564
po::value<bool>(&innobase_create_status_file)->default_value(false),
3565
N_("Enable SHOW INNODB STATUS output in the log"));
3566
context("sync-spin-loops",
3567
po::value<unsigned long>(&srv_n_spin_wait_rounds)->default_value(30L),
3568
N_("Count of spin-loop rounds in InnoDB mutexes (30 by default)"));
3569
context("use-sys-malloc",
3570
po::value<bool>(&srv_use_sys_malloc)->default_value(true),
3571
N_("Use OS memory allocator instead of InnoDB's internal memory allocator"));
3220
3574
static drizzle_sys_var* innobase_system_variables[]= {
3221
3575
DRIZZLE_SYSVAR(adaptive_hash_index),
3222
3576
DRIZZLE_SYSVAR(adaptive_flushing),