2822
static bool innobase_use_checksums= true;
2823
static char* innobase_data_home_dir = NULL;
2821
2824
static char* innobase_log_group_home_dir = NULL;
2822
2825
static bool innobase_use_doublewrite= true;
2826
static unsigned long srv_io_capacity= 200;
2823
2827
static unsigned long innobase_fast_shutdown= 1;
2824
2828
static bool srv_file_per_table= false;
2825
2829
static bool innobase_adaptive_hash_index;
2837
2841
static unsigned long innobase_lru_block_access_recency;
2838
2842
static unsigned long innobase_read_io_threads;
2839
2843
static unsigned long innobase_write_io_threads;
2840
typedef constrained_check<unsigned int, 1000, 1> autoextend_constraint;
2841
static autoextend_constraint srv_auto_extend_increment;
2844
static unsigned int srv_auto_extend_increment;
2842
2845
static unsigned long innobase_lock_wait_timeout;
2843
2846
static unsigned long srv_n_spin_wait_rounds;
2844
typedef constrained_check<size_t, SIZE_MAX, 5242880, 1048576> buffer_pool_constraint;
2845
static buffer_pool_constraint innobase_buffer_pool_size;
2846
typedef constrained_check<size_t, SIZE_MAX, 512, 1024> additional_mem_pool_constraint;
2847
static additional_mem_pool_constraint innobase_additional_mem_pool_size;
2848
static bool innobase_use_checksums= true;
2849
typedef constrained_check<unsigned int, UINT_MAX, 100> io_capacity_constraint;
2850
static io_capacity_constraint srv_io_capacity;
2847
static int64_t innobase_buffer_pool_size;
2852
2848
static long innobase_open_files;
2849
static long innobase_additional_mem_pool_size;
2853
2850
static long innobase_force_recovery;
2854
2851
static long innobase_log_buffer_size;
2855
2852
static char default_haildb_data_file_path[]= "ibdata1:10M:autoextend";
2878
2875
innobase_print_verbose_log= (vm.count("disable-print-verbose-log")) ? false : true;
2879
2876
srv_use_sys_malloc= (vm.count("use-internal-malloc")) ? false : true;
2878
if (vm.count("additional-mem-pool-size"))
2880
if (innobase_additional_mem_pool_size > LONG_MAX || innobase_additional_mem_pool_size < 512*1024L)
2882
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value of additional-mem-pool-size"));
2885
innobase_additional_mem_pool_size/= 1024;
2886
innobase_additional_mem_pool_size*= 1024;
2889
if (vm.count("autoextend-increment"))
2891
if (srv_auto_extend_increment > 1000L || srv_auto_extend_increment < 1L)
2893
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value of autoextend-increment"));
2898
if (vm.count("buffer-pool-size"))
2900
if (innobase_buffer_pool_size > INT64_MAX || innobase_buffer_pool_size < 5*1024*1024L)
2902
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value of buffer-pool-size"));
2905
innobase_buffer_pool_size/= 1024*1024L;
2906
innobase_buffer_pool_size*= 1024*1024L;
2909
if (vm.count("io-capacity"))
2911
if (srv_io_capacity > (unsigned long)~0L || srv_io_capacity < 100)
2913
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value of io-capacity"));
2881
2918
if (vm.count("fast-shutdown"))
2883
2920
if (innobase_fast_shutdown > 2)
2885
2922
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value of fast-shutdown"));
3092
3133
if (err != DB_SUCCESS)
3093
3134
goto haildb_error;
3095
err= ib_cfg_set_int("additional_mem_pool_size", static_cast<size_t>(innobase_additional_mem_pool_size));
3096
if (err != DB_SUCCESS)
3099
err= ib_cfg_set_int("autoextend_increment", static_cast<unsigned int>(srv_auto_extend_increment));
3100
if (err != DB_SUCCESS)
3103
err= ib_cfg_set_int("buffer_pool_size", static_cast<size_t>(innobase_buffer_pool_size));
3104
if (err != DB_SUCCESS)
3107
err= ib_cfg_set_int("io_capacity", static_cast<unsigned int>(srv_io_capacity));
3136
err= ib_cfg_set_int("additional_mem_pool_size", innobase_additional_mem_pool_size);
3137
if (err != DB_SUCCESS)
3140
err= ib_cfg_set_int("autoextend_increment", srv_auto_extend_increment);
3141
if (err != DB_SUCCESS)
3144
err= ib_cfg_set_int("buffer_pool_size", innobase_buffer_pool_size);
3145
if (err != DB_SUCCESS)
3148
err= ib_cfg_set_int("io_capacity", srv_io_capacity);
3108
3149
if (err != DB_SUCCESS)
3109
3150
goto haildb_error;
3196
3237
haildb_engine= new HailDBEngine("InnoDB");
3197
3238
context.add(haildb_engine);
3198
context.registerVariable(new sys_var_bool_ptr_readonly("adaptive_hash_index",
3199
&innobase_adaptive_hash_index));
3200
context.registerVariable(new sys_var_bool_ptr_readonly("adaptive_flushing",
3201
&srv_adaptive_flushing));
3202
context.registerVariable(new sys_var_constrained_value_readonly<size_t>("additional_mem_pool_size",innobase_additional_mem_pool_size));
3203
context.registerVariable(new sys_var_constrained_value_readonly<unsigned int>("autoextend_increment", srv_auto_extend_increment));
3204
context.registerVariable(new sys_var_constrained_value_readonly<size_t>("buffer_pool_size", innobase_buffer_pool_size));
3205
context.registerVariable(new sys_var_bool_ptr_readonly("checksums",
3206
&innobase_use_checksums));
3207
context.registerVariable(new sys_var_bool_ptr_readonly("doublewrite",
3208
&innobase_use_doublewrite));
3209
context.registerVariable(new sys_var_const_string_val("data_home_dir",
3210
vm.count("data-home-dir") ? vm["data-home-dir"].as<string>() : ""));
3211
context.registerVariable(new sys_var_constrained_value_readonly<unsigned int>("io_capacity", srv_io_capacity));
3213
3240
haildb_datadict_dump_func_initialize(context);
3214
3241
config_table_function_initialize(context);
3339
3366
innobase_create_status_file= status_file_enabled;
3369
static DRIZZLE_SYSVAR_BOOL(adaptive_hash_index, innobase_adaptive_hash_index,
3370
PLUGIN_VAR_NOCMDARG,
3371
"Enable HailDB adaptive hash index (enabled by default). ",
3374
static DRIZZLE_SYSVAR_BOOL(adaptive_flushing, srv_adaptive_flushing,
3375
PLUGIN_VAR_NOCMDARG,
3376
"Attempt flushing dirty pages to avoid IO bursts at checkpoints.",
3379
static DRIZZLE_SYSVAR_LONG(additional_mem_pool_size, innobase_additional_mem_pool_size,
3380
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
3381
"Size of a memory pool HailDB uses to store data dictionary information and other internal data structures.",
3382
NULL, NULL, 8*1024*1024L, 512*1024L, LONG_MAX, 1024);
3384
static DRIZZLE_SYSVAR_UINT(autoextend_increment, srv_auto_extend_increment,
3385
PLUGIN_VAR_RQCMDARG,
3386
"Data file autoextend increment in megabytes",
3387
NULL, NULL, 8L, 1L, 1000L, 0);
3389
static DRIZZLE_SYSVAR_LONGLONG(buffer_pool_size, innobase_buffer_pool_size,
3390
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
3391
"The size of the memory buffer HailDB uses to cache data and indexes of its tables.",
3392
NULL, NULL, 128*1024*1024L, 5*1024*1024L, INT64_MAX, 1024*1024L);
3394
static DRIZZLE_SYSVAR_BOOL(checksums, innobase_use_checksums,
3395
PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
3396
"Enable HailDB checksums validation (enabled by default). "
3397
"Disable with --skip-haildb-checksums.",
3400
static DRIZZLE_SYSVAR_STR(data_home_dir, innobase_data_home_dir,
3401
PLUGIN_VAR_READONLY,
3402
"The common part for HailDB table spaces.",
3405
static DRIZZLE_SYSVAR_BOOL(doublewrite, innobase_use_doublewrite,
3406
PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
3407
"Enable HailDB doublewrite buffer (enabled by default). "
3408
"Disable with --skip-haildb-doublewrite.",
3411
static DRIZZLE_SYSVAR_ULONG(io_capacity, srv_io_capacity,
3412
PLUGIN_VAR_RQCMDARG,
3413
"Number of IOPs the server can do. Tunes the background IO rate",
3414
NULL, NULL, 200, 100, ~0L, 0);
3342
3416
static DRIZZLE_SYSVAR_ULONG(fast_shutdown, innobase_fast_shutdown,
3343
3417
PLUGIN_VAR_OPCMDARG,
3344
3418
"Speeds up the shutdown process of the HailDB storage engine. Possible "
3475
3549
context("disable-adaptive-flushing",
3476
3550
N_("Do not attempt to flush dirty pages to avoid IO bursts at checkpoints."));
3477
3551
context("additional-mem-pool-size",
3478
po::value<additional_mem_pool_constraint>(&innobase_additional_mem_pool_size)->default_value(8*1024*1024L),
3552
po::value<long>(&innobase_additional_mem_pool_size)->default_value(8*1024*1024L),
3479
3553
N_("Size of a memory pool HailDB uses to store data dictionary information and other internal data structures."));
3480
3554
context("autoextend-increment",
3481
po::value<autoextend_constraint>(&srv_auto_extend_increment)->default_value(8),
3555
po::value<unsigned int>(&srv_auto_extend_increment)->default_value(8L),
3482
3556
N_("Data file autoextend increment in megabytes"));
3483
3557
context("buffer-pool-size",
3484
po::value<buffer_pool_constraint>(&innobase_buffer_pool_size)->default_value(128*1024*1024L),
3558
po::value<int64_t>(&innobase_buffer_pool_size)->default_value(128*1024*1024L),
3485
3559
N_("The size of the memory buffer HailDB uses to cache data and indexes of its tables."));
3486
3560
context("data-home-dir",
3487
3561
po::value<string>(),
3491
3565
context("disable-doublewrite",
3492
3566
N_("Disable HailDB doublewrite buffer (enabled by default)."));
3493
3567
context("io-capacity",
3494
po::value<io_capacity_constraint>(&srv_io_capacity)->default_value(200),
3568
po::value<unsigned long>(&srv_io_capacity)->default_value(200),
3495
3569
N_("Number of IOPs the server can do. Tunes the background IO rate"));
3496
3570
context("fast-shutdown",
3497
3571
po::value<unsigned long>(&innobase_fast_shutdown)->default_value(1),
3571
3645
static drizzle_sys_var* innobase_system_variables[]= {
3646
DRIZZLE_SYSVAR(adaptive_hash_index),
3647
DRIZZLE_SYSVAR(adaptive_flushing),
3648
DRIZZLE_SYSVAR(additional_mem_pool_size),
3649
DRIZZLE_SYSVAR(autoextend_increment),
3650
DRIZZLE_SYSVAR(buffer_pool_size),
3651
DRIZZLE_SYSVAR(checksums),
3652
DRIZZLE_SYSVAR(data_home_dir),
3653
DRIZZLE_SYSVAR(doublewrite),
3654
DRIZZLE_SYSVAR(io_capacity),
3572
3655
DRIZZLE_SYSVAR(fast_shutdown),
3573
3656
DRIZZLE_SYSVAR(file_per_table),
3574
3657
DRIZZLE_SYSVAR(file_format),