1981
2015
tuple= ib_tuple_clear(tuple);
1982
2016
ib_tuple_delete(tuple);
1983
2018
err= ib_cursor_reset(cursor);
1988
int HailDBCursor::doUpdateRecord(const unsigned char *,
2023
int HailDBCursor::doUpdateRecord(const unsigned char *old_data,
2024
unsigned char *new_data)
1991
2026
ib_tpl_t update_tuple;
2028
bool created_tuple= false;
1994
2030
update_tuple= ib_clust_read_tuple_create(cursor);
2034
ib_trx_t transaction= *get_trx(getTable()->in_use);
2036
if (cursor_is_sec_index)
2038
err= ib_cursor_close(cursor);
2039
assert(err == DB_SUCCESS);
2041
err= ib_cursor_open_table_using_id(table_id, transaction, &cursor);
2043
if (err != DB_SUCCESS)
2044
return ib_err_t_to_drizzle_error(err);
2045
cursor_is_sec_index= false;
2049
ib_cursor_attach_trx(cursor, transaction);
2052
store_key_value_from_haildb(getTable()->key_info + getTable()->getShare()->getPrimaryKey(),
2053
ref, ref_length, old_data);
2055
ib_tpl_t search_tuple= ib_clust_search_tuple_create(cursor);
2057
fill_ib_search_tpl_from_drizzle_key(search_tuple,
2058
getTable()->key_info + 0,
2061
err= ib_cursor_set_lock_mode(cursor, IB_LOCK_X);
2062
assert(err == DB_SUCCESS);
2065
err= ib_cursor_moveto(cursor, search_tuple, IB_CUR_GE, &res);
2066
assert(err == DB_SUCCESS);
2068
tuple= ib_clust_read_tuple_create(cursor);
2070
err= ib_cursor_read_row(cursor, tuple);
2071
assert(err == DB_SUCCESS);// FIXME
2073
created_tuple= true;
1996
2076
err= ib_tuple_copy(update_tuple, tuple);
1997
2077
assert(err == DB_SUCCESS);
1999
write_row_to_haildb_tuple(getTable()->getFields(), update_tuple);
2079
write_row_to_haildb_tuple(new_data, getTable()->getFields(), update_tuple);
2001
2081
err= ib_cursor_update_row(cursor, tuple, update_tuple);
2003
2083
ib_tuple_delete(update_tuple);
2087
ib_err_t ib_err= ib_cursor_reset(cursor); //fixme check error
2088
assert(ib_err == DB_SUCCESS);
2089
tuple= ib_tuple_clear(tuple);
2090
ib_tuple_delete(tuple);
2005
2094
advance_cursor= true;
2007
if (err == DB_SUCCESS)
2009
else if (err == DB_DUPLICATE_KEY)
2010
return HA_ERR_FOUND_DUPP_KEY;
2096
return ib_err_t_to_drizzle_error(err);
2015
2099
int HailDBCursor::doDeleteRecord(const unsigned char *)
2103
assert(ib_cursor_is_positioned(cursor) == IB_TRUE);
2019
2104
err= ib_cursor_delete_row(cursor);
2020
if (err != DB_SUCCESS)
2023
2106
advance_cursor= true;
2108
return ib_err_t_to_drizzle_error(err);
2027
2111
int HailDBCursor::delete_all_rows(void)
2029
2113
/* I *think* ib_truncate is non-transactional....
2030
2114
so only support TRUNCATE and not DELETE FROM t;
2031
(this is what ha_haildb does)
2115
(this is what ha_innodb does)
2033
2117
if (session_sql_command(getTable()->in_use) != SQLCOM_TRUNCATE)
2034
2118
return HA_ERR_WRONG_COMMAND;
2380
2505
if (flag & HA_STATUS_AUTO)
2381
2506
stats.auto_increment_value= 1;
2508
if (flag & HA_STATUS_ERRKEY) {
2509
const char *err_table_name;
2510
const char *err_index_name;
2512
ib_trx_t transaction= *get_trx(getTable()->in_use);
2514
err= ib_get_duplicate_key(transaction, &err_table_name, &err_index_name);
2518
for (unsigned int i = 0; i < getTable()->getShare()->keys; i++)
2520
if (strcmp(err_index_name, getTable()->key_info[i].name) == 0)
2385
2532
int HailDBCursor::doStartIndexScan(uint32_t keynr, bool)
2387
2535
ib_trx_t transaction= *get_trx(getTable()->in_use);
2389
2537
active_index= keynr;
2391
ib_cursor_attach_trx(cursor, transaction);
2393
2539
if (active_index == 0 && ! share->has_hidden_primary_key)
2541
if (cursor_is_sec_index)
2543
err= ib_cursor_close(cursor);
2544
assert(err == DB_SUCCESS);
2546
err= ib_cursor_open_table_using_id(table_id, transaction, &cursor);
2548
if (err != DB_SUCCESS)
2549
return ib_err_t_to_drizzle_error(err);
2554
ib_cursor_attach_trx(cursor, transaction);
2557
cursor_is_sec_index= false;
2395
2558
tuple= ib_clust_read_tuple_create(cursor);
2400
2562
ib_id_t index_id;
2401
2563
err= ib_index_get_id(table_path_to_haildb_name(getShare()->getPath()),
2402
2564
getShare()->getKeyInfo(keynr).name,
2404
2566
if (err != DB_SUCCESS)
2567
return ib_err_t_to_drizzle_error(err);
2407
2569
err= ib_cursor_close(cursor);
2408
2570
assert(err == DB_SUCCESS);
2409
2572
err= ib_cursor_open_index_using_id(index_id, transaction, &cursor);
2411
2574
if (err != DB_SUCCESS)
2575
return ib_err_t_to_drizzle_error(err);
2577
cursor_is_sec_index= true;
2414
2579
tuple= ib_clust_read_tuple_create(cursor);
2415
2580
ib_cursor_set_cluster_access(cursor);
2418
ib_err_t err= ib_cursor_set_lock_mode(cursor, ib_lock_mode);
2583
err= ib_cursor_set_lock_mode(cursor, ib_lock_mode);
2419
2584
assert(err == DB_SUCCESS);
2421
2586
advance_cursor= false;
2827
2992
static bool innobase_create_status_file;
2828
2993
static bool srv_use_sys_malloc;
2829
2994
static string innobase_file_format_name;
2830
static unsigned long srv_max_buf_pool_modified_pct;
2831
static unsigned long srv_max_purge_lag;
2832
static unsigned long innobase_lru_old_blocks_pct;
2833
static unsigned long innobase_lru_block_access_recency;
2834
static unsigned long innobase_read_io_threads;
2835
static unsigned long innobase_write_io_threads;
2836
2995
typedef constrained_check<unsigned int, 1000, 1> autoextend_constraint;
2837
2996
static autoextend_constraint srv_auto_extend_increment;
2838
static unsigned long innobase_lock_wait_timeout;
2839
static unsigned long srv_n_spin_wait_rounds;
2840
2997
typedef constrained_check<size_t, SIZE_MAX, 5242880, 1048576> buffer_pool_constraint;
2841
2998
static buffer_pool_constraint innobase_buffer_pool_size;
2842
2999
typedef constrained_check<size_t, SIZE_MAX, 512, 1024> additional_mem_pool_constraint;
2843
3000
static additional_mem_pool_constraint innobase_additional_mem_pool_size;
2844
3001
static bool innobase_use_checksums= true;
2845
3002
typedef constrained_check<unsigned int, UINT_MAX, 100> io_capacity_constraint;
2846
typedef constrained_check<uint16_t, 2, 0> trinary_constraint;
3003
typedef constrained_check<uint32_t, 2, 0> trinary_constraint;
2847
3004
static trinary_constraint innobase_fast_shutdown;
2848
3005
static trinary_constraint srv_flush_log_at_trx_commit;
2849
typedef constrained_check<uint16_t, 6, 0> force_recovery_constraint;
3006
typedef constrained_check<uint32_t, 6, 0> force_recovery_constraint;
2850
3007
static force_recovery_constraint innobase_force_recovery;
3008
typedef constrained_check<int64_t, INT64_MAX, 1024*1024, 1024*1024> log_file_constraint;
3009
static log_file_constraint haildb_log_file_size;
2851
3011
static io_capacity_constraint srv_io_capacity;
2853
static long innobase_open_files;
2854
static long innobase_log_buffer_size;
2855
static char default_haildb_data_file_path[]= "ibdata1:10M:autoextend";
2856
static char* haildb_data_file_path= NULL;
2858
static int64_t haildb_log_file_size;
2859
static int64_t haildb_log_files_in_group;
3012
typedef constrained_check<unsigned int, 100, 2> log_files_in_group_constraint;
3013
static log_files_in_group_constraint haildb_log_files_in_group;
3014
typedef constrained_check<unsigned int, 1024*1024*1024, 1> lock_wait_constraint;
3015
static lock_wait_constraint innobase_lock_wait_timeout;
3016
typedef constrained_check<long, LONG_MAX, 256*1024, 1024> log_buffer_size_constraint;
3017
static log_buffer_size_constraint innobase_log_buffer_size;
3018
typedef constrained_check<unsigned int, 97, 5> lru_old_blocks_constraint;
3019
static lru_old_blocks_constraint innobase_lru_old_blocks_pct;
3020
typedef constrained_check<unsigned int, 99, 0> max_dirty_pages_constraint;
3021
static max_dirty_pages_constraint haildb_max_dirty_pages_pct;
3022
static uint64_constraint haildb_max_purge_lag;
3023
static uint64_constraint haildb_sync_spin_loops;
3024
typedef constrained_check<uint32_t, UINT32_MAX, 10> open_files_constraint;
3025
static open_files_constraint haildb_open_files;
3026
typedef constrained_check<unsigned int, 64, 1> io_threads_constraint;
3027
static io_threads_constraint haildb_read_io_threads;
3028
static io_threads_constraint haildb_write_io_threads;
3031
static uint32_t innobase_lru_block_access_recency;
2861
3035
static int haildb_file_format_name_validate(Session*, set_var *var)
2896
3113
innobase_print_verbose_log= (vm.count("disable-print-verbose-log")) ? false : true;
2897
3114
srv_use_sys_malloc= (vm.count("use-internal-malloc")) ? false : true;
2899
if (vm.count("log-file-size"))
2901
if (haildb_log_file_size > INT64_MAX || haildb_log_file_size < 1*1024*1024L)
2903
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value of log-file-size"));
2906
haildb_log_file_size/= 1024*1024L;
2907
haildb_log_file_size*= 1024*1024L;
2910
if (vm.count("log-files-in-group"))
2912
if (haildb_log_files_in_group > 100 || haildb_log_files_in_group < 2)
2914
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value of log-files-in-group"));
2919
if (vm.count("lock-wait-timeout"))
2921
if (innobase_lock_wait_timeout > 1024*1024*1024 || innobase_lock_wait_timeout < 1)
2923
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value of lock-wait-timeout"));
2928
if (vm.count("log-buffer-size"))
2930
if (innobase_log_buffer_size > LONG_MAX || innobase_log_buffer_size < 256*1024L)
2932
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value of log-buffer-size"));
2935
innobase_log_buffer_size/= 1024;
2936
innobase_log_buffer_size*= 1024;
2939
if (vm.count("lru-old-blocks-pct"))
2941
if (innobase_lru_old_blocks_pct > 95 || innobase_lru_old_blocks_pct < 5)
2943
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value of lru-old-blocks-pct"));
2948
if (vm.count("lru-block-access-recency"))
2950
if (innobase_lru_block_access_recency > ULONG_MAX)
2952
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value of lru-block-access-recency"));
2957
if (vm.count("max-dirty-pages-pct"))
2959
if (srv_max_buf_pool_modified_pct > 99)
2961
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value of max-dirty-pages-pct"));
2966
if (vm.count("max-purge-lag"))
2968
if (srv_max_purge_lag > (unsigned long)~0L)
2970
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value of max-purge-lag"));
2975
if (vm.count("open-files"))
2977
if (innobase_open_files > LONG_MAX || innobase_open_files < 10L)
2979
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value of open-files"));
2984
if (vm.count("read-io-threads"))
2986
if (innobase_read_io_threads > 64 || innobase_read_io_threads < 1)
2988
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value of read-io-threads"));
2993
if (vm.count("sync-spin-loops"))
2995
if (srv_n_spin_wait_rounds > (unsigned long)~0L)
2997
errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value of sync_spin_loops"));
3002
if (vm.count("data-file-path"))
3004
haildb_data_file_path= const_cast<char *>(vm["data-file-path"].as<string>().c_str());
3185
3293
&innobase_use_checksums));
3186
3294
context.registerVariable(new sys_var_bool_ptr_readonly("doublewrite",
3187
3295
&innobase_use_doublewrite));
3296
context.registerVariable(new sys_var_const_string_val("data_file_path",
3297
vm["data-file-path"].as<string>()));
3188
3298
context.registerVariable(new sys_var_const_string_val("data_home_dir",
3189
vm.count("data-home-dir") ? vm["data-home-dir"].as<string>() : ""));
3299
vm["data-home-dir"].as<string>()));
3190
3300
context.registerVariable(new sys_var_constrained_value_readonly<unsigned int>("io_capacity", srv_io_capacity));
3191
context.registerVariable(new sys_var_constrained_value_readonly<uint16_t>("fast_shutdown", innobase_fast_shutdown));
3301
context.registerVariable(new sys_var_constrained_value_readonly<uint32_t>("fast_shutdown", innobase_fast_shutdown));
3192
3302
context.registerVariable(new sys_var_bool_ptr_readonly("file_per_table",
3193
3303
&srv_file_per_table));
3194
context.registerVariable(new sys_var_std_string("file-format",
3304
context.registerVariable(new sys_var_bool_ptr_readonly("rollback_on_timeout",
3305
&innobase_rollback_on_timeout));
3306
context.registerVariable(new sys_var_bool_ptr_readonly("print_verbose_log",
3307
&innobase_print_verbose_log));
3308
context.registerVariable(new sys_var_bool_ptr("status_file",
3309
&innobase_create_status_file,
3310
haildb_status_file_update));
3311
context.registerVariable(new sys_var_bool_ptr_readonly("use_sys_malloc",
3312
&srv_use_sys_malloc));
3313
context.registerVariable(new sys_var_std_string("file_format",
3195
3314
innobase_file_format_name,
3196
3315
haildb_file_format_name_validate));
3197
context.registerVariable(new sys_var_constrained_value_readonly<uint16_t>("flush_log_at_trx_commit", srv_flush_log_at_trx_commit));
3316
context.registerVariable(new sys_var_constrained_value_readonly<uint32_t>("flush_log_at_trx_commit", srv_flush_log_at_trx_commit));
3198
3317
context.registerVariable(new sys_var_const_string_val("flush_method",
3199
3318
vm.count("flush-method") ? vm["flush-method"].as<string>() : ""));
3200
context.registerVariable(new sys_var_constrained_value_readonly<uint16_t>("force_recovery", innobase_force_recovery));
3319
context.registerVariable(new sys_var_constrained_value_readonly<uint32_t>("force_recovery", innobase_force_recovery));
3201
3320
context.registerVariable(new sys_var_const_string_val("log_group_home_dir",
3202
3321
vm.count("log-group-home-dir") ? vm["log-group-home-dir"].as<string>() : ""));
3322
context.registerVariable(new sys_var_constrained_value<int64_t>("log_file_size", haildb_log_file_size));
3323
context.registerVariable(new sys_var_constrained_value_readonly<unsigned int>("log_files_in_group", haildb_log_files_in_group));
3324
context.registerVariable(new sys_var_constrained_value_readonly<unsigned int>("lock_wait_timeout", innobase_lock_wait_timeout));
3325
context.registerVariable(new sys_var_constrained_value_readonly<long>("log_buffer_size", innobase_log_buffer_size));
3326
context.registerVariable(new sys_var_constrained_value<unsigned int>("lru_old_blocks_pct", innobase_lru_old_blocks_pct, haildb_lru_old_blocks_pct_update));
3327
context.registerVariable(new sys_var_uint32_t_ptr("lru_block_access_recency",
3328
&innobase_lru_block_access_recency,
3329
haildb_lru_block_access_recency_update));
3330
context.registerVariable(new sys_var_constrained_value_readonly<unsigned int>("max_dirty_pages_pct", haildb_max_dirty_pages_pct));
3331
context.registerVariable(new sys_var_constrained_value_readonly<uint64_t>("max_purge_lag", haildb_max_purge_lag));
3332
context.registerVariable(new sys_var_constrained_value_readonly<uint64_t>("sync_spin_loops", haildb_sync_spin_loops));
3333
context.registerVariable(new sys_var_constrained_value_readonly<uint32_t>("open_files", haildb_open_files));
3334
context.registerVariable(new sys_var_constrained_value_readonly<unsigned int>("read_io_threads", haildb_read_io_threads));
3335
context.registerVariable(new sys_var_constrained_value_readonly<unsigned int>("write_io_threads", haildb_write_io_threads));
3204
3337
haildb_datadict_dump_func_initialize(context);
3205
3338
config_table_function_initialize(context);
3236
static void haildb_lru_old_blocks_pct_update(Session*, drizzle_sys_var*,
3243
pct= *static_cast<const unsigned long*>(save);
3245
ib_err_t err= ib_cfg_set_int("lru_old_blocks_pct", pct);
3246
if (err == DB_SUCCESS)
3247
innobase_lru_old_blocks_pct= pct;
3250
static void haildb_lru_block_access_recency_update(Session*, drizzle_sys_var*,
3257
ms= *static_cast<const unsigned long*>(save);
3259
ib_err_t err= ib_cfg_set_int("lru_block_access_recency", ms);
3261
if (err == DB_SUCCESS)
3262
innobase_lru_block_access_recency= ms;
3265
static void haildb_status_file_update(Session*, drizzle_sys_var*,
3270
bool status_file_enabled;
3273
status_file_enabled= *static_cast<const bool*>(save);
3276
if (status_file_enabled)
3277
err= ib_cfg_set_bool_on("status_file");
3279
err= ib_cfg_set_bool_off("status_file");
3281
if (err == DB_SUCCESS)
3282
innobase_create_status_file= status_file_enabled;
3285
static DRIZZLE_SYSVAR_STR(data_file_path, haildb_data_file_path,
3286
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
3287
"Path to individual files and their sizes.",
3290
static DRIZZLE_SYSVAR_LONGLONG(log_file_size, haildb_log_file_size,
3291
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
3292
"Size of each log file in a log group.",
3293
NULL, NULL, 20*1024*1024L, 1*1024*1024L, INT64_MAX, 1024*1024L);
3295
static DRIZZLE_SYSVAR_LONGLONG(log_files_in_group, haildb_log_files_in_group,
3296
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
3297
"Number of log files in the log group. HailDB writes to the files in a circular fashion. Value 3 is recommended here.",
3298
NULL, NULL, 2, 2, 100, 0);
3300
static DRIZZLE_SYSVAR_ULONG(lock_wait_timeout, innobase_lock_wait_timeout,
3301
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
3302
"Timeout in seconds an HailDB transaction may wait for a lock before being rolled back. Values above 100000000 disable the timeout.",
3303
NULL, NULL, 5, 1, 1024 * 1024 * 1024, 0);
3305
static DRIZZLE_SYSVAR_LONG(log_buffer_size, innobase_log_buffer_size,
3306
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
3307
"The size of the buffer which HailDB uses to write log to the log files on disk.",
3308
NULL, NULL, 8*1024*1024L, 256*1024L, LONG_MAX, 1024);
3310
static DRIZZLE_SYSVAR_ULONG(lru_old_blocks_pct, innobase_lru_old_blocks_pct,
3311
PLUGIN_VAR_RQCMDARG,
3312
"Sets the point in the LRU list from where all pages are classified as "
3313
"old (Advanced users)",
3315
haildb_lru_old_blocks_pct_update, 37, 5, 95, 0);
3317
static DRIZZLE_SYSVAR_ULONG(lru_block_access_recency, innobase_lru_block_access_recency,
3318
PLUGIN_VAR_RQCMDARG,
3319
"Milliseconds between accesses to a block at which it is made young. "
3320
"0=disabled (Advanced users)",
3322
haildb_lru_block_access_recency_update, 0, 0, ULONG_MAX, 0);
3325
static DRIZZLE_SYSVAR_ULONG(max_dirty_pages_pct, srv_max_buf_pool_modified_pct,
3326
PLUGIN_VAR_RQCMDARG,
3327
"Percentage of dirty pages allowed in bufferpool.",
3328
NULL, NULL, 75, 0, 99, 0);
3330
static DRIZZLE_SYSVAR_ULONG(max_purge_lag, srv_max_purge_lag,
3331
PLUGIN_VAR_RQCMDARG,
3332
"Desired maximum length of the purge queue (0 = no limit)",
3333
NULL, NULL, 0, 0, ~0L, 0);
3335
static DRIZZLE_SYSVAR_BOOL(rollback_on_timeout, innobase_rollback_on_timeout,
3336
PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY,
3337
"Roll back the complete transaction on lock wait timeout, for 4.x compatibility (disabled by default)",
3340
static DRIZZLE_SYSVAR_LONG(open_files, innobase_open_files,
3341
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
3342
"How many files at the maximum HailDB keeps open at the same time.",
3343
NULL, NULL, 300L, 10L, LONG_MAX, 0);
3345
static DRIZZLE_SYSVAR_ULONG(read_io_threads, innobase_read_io_threads,
3346
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
3347
"Number of background read I/O threads in HailDB.",
3348
NULL, NULL, 4, 1, 64, 0);
3350
static DRIZZLE_SYSVAR_ULONG(write_io_threads, innobase_write_io_threads,
3351
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
3352
"Number of background write I/O threads in HailDB.",
3353
NULL, NULL, 4, 1, 64, 0);
3355
static DRIZZLE_SYSVAR_BOOL(print_verbose_log, innobase_print_verbose_log,
3356
PLUGIN_VAR_NOCMDARG,
3357
"Disable if you want to reduce the number of messages written to the log (default: enabled).",
3360
static DRIZZLE_SYSVAR_BOOL(status_file, innobase_create_status_file,
3361
PLUGIN_VAR_OPCMDARG,
3362
"Enable SHOW HAILDB STATUS output in the log",
3363
NULL, haildb_status_file_update, false);
3365
static DRIZZLE_SYSVAR_ULONG(sync_spin_loops, srv_n_spin_wait_rounds,
3366
PLUGIN_VAR_RQCMDARG,
3367
"Count of spin-loop rounds in HailDB mutexes (30 by default)",
3368
NULL, NULL, 30L, 0L, ~0L, 0);
3370
static DRIZZLE_SYSVAR_BOOL(use_sys_malloc, srv_use_sys_malloc,
3371
PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
3372
"Use OS memory allocator instead of HailDB's internal memory allocator",
3375
3369
static void init_options(drizzled::module::option_context &context)
3377
3371
context("disable-adaptive-hash-index",
3416
3410
po::value<force_recovery_constraint>(&innobase_force_recovery)->default_value(0),
3417
3411
N_("Helps to save your data in case the disk image of the database becomes corrupt."));
3418
3412
context("data-file-path",
3419
po::value<string>(),
3413
po::value<string>()->default_value("ibdata1:10M:autoextend"),
3420
3414
N_("Path to individual files and their sizes."));
3421
3415
context("log-group-home-dir",
3422
3416
po::value<string>(),
3423
3417
N_("Path to HailDB log files."));
3424
3418
context("log-file-size",
3425
po::value<int64_t>(&haildb_log_file_size)->default_value(20*1024*1024L),
3419
po::value<log_file_constraint>(&haildb_log_file_size)->default_value(20*1024*1024L),
3426
3420
N_("Size of each log file in a log group."));
3427
3421
context("haildb-log-files-in-group",
3428
po::value<int64_t>(&haildb_log_files_in_group)->default_value(2),
3422
po::value<log_files_in_group_constraint>(&haildb_log_files_in_group)->default_value(2),
3429
3423
N_("Number of log files in the log group. HailDB writes to the files in a circular fashion. Value 3 is recommended here."));
3430
3424
context("lock-wait-timeout",
3431
po::value<unsigned long>(&innobase_lock_wait_timeout)->default_value(5),
3425
po::value<lock_wait_constraint>(&innobase_lock_wait_timeout)->default_value(5),
3432
3426
N_("Timeout in seconds an HailDB transaction may wait for a lock before being rolled back. Values above 100000000 disable the timeout."));
3433
3427
context("log-buffer-size",
3434
po::value<long>(&innobase_log_buffer_size)->default_value(8*1024*1024L),
3428
po::value<log_buffer_size_constraint>(&innobase_log_buffer_size)->default_value(8*1024*1024L),
3435
3429
N_("The size of the buffer which HailDB uses to write log to the log files on disk."));
3436
3430
context("lru-old-blocks-pct",
3437
po::value<unsigned long>(&innobase_lru_old_blocks_pct)->default_value(37),
3431
po::value<lru_old_blocks_constraint>(&innobase_lru_old_blocks_pct)->default_value(37),
3438
3432
N_("Sets the point in the LRU list from where all pages are classified as old (Advanced users)"));
3439
3433
context("lru-block-access-recency",
3440
po::value<unsigned long>(&innobase_lru_block_access_recency)->default_value(0),
3434
po::value<uint32_t>(&innobase_lru_block_access_recency)->default_value(0),
3441
3435
N_("Milliseconds between accesses to a block at which it is made young. 0=disabled (Advanced users)"));
3442
3436
context("max-dirty-pages-pct",
3443
po::value<unsigned long>(&srv_max_buf_pool_modified_pct)->default_value(75),
3437
po::value<max_dirty_pages_constraint>(&haildb_max_dirty_pages_pct)->default_value(75),
3444
3438
N_("Percentage of dirty pages allowed in bufferpool."));
3445
3439
context("max-purge-lag",
3446
po::value<unsigned long>(&srv_max_purge_lag)->default_value(0),
3440
po::value<uint64_constraint>(&haildb_max_purge_lag)->default_value(0),
3447
3441
N_("Desired maximum length of the purge queue (0 = no limit)"));
3448
3442
context("rollback-on-timeout",
3449
3443
po::value<bool>(&innobase_rollback_on_timeout)->default_value(false)->zero_tokens(),
3450
3444
N_("Roll back the complete transaction on lock wait timeout, for 4.x compatibility (disabled by default)"));
3451
3445
context("open-files",
3452
po::value<long>(&innobase_open_files)->default_value(300),
3446
po::value<open_files_constraint>(&haildb_open_files)->default_value(300),
3453
3447
N_("How many files at the maximum HailDB keeps open at the same time."));
3454
3448
context("read-io-threads",
3455
po::value<unsigned long>(&innobase_read_io_threads)->default_value(4),
3449
po::value<io_threads_constraint>(&haildb_read_io_threads)->default_value(4),
3456
3450
N_("Number of background read I/O threads in HailDB."));
3457
3451
context("write-io-threads",
3458
po::value<unsigned long>(&innobase_write_io_threads)->default_value(4),
3452
po::value<io_threads_constraint>(&haildb_write_io_threads)->default_value(4),
3459
3453
N_("Number of background write I/O threads in HailDB."));
3460
3454
context("disable-print-verbose-log",
3461
3455
N_("Disable if you want to reduce the number of messages written to the log (default: enabled)."));
3463
3457
po::value<bool>(&innobase_create_status_file)->default_value(false)->zero_tokens(),
3464
3458
N_("Enable SHOW HAILDB STATUS output in the log"));
3465
3459
context("sync-spin-loops",
3466
po::value<unsigned long>(&srv_n_spin_wait_rounds)->default_value(30L),
3460
po::value<uint64_constraint>(&haildb_sync_spin_loops)->default_value(30L),
3467
3461
N_("Count of spin-loop rounds in HailDB mutexes (30 by default)"));
3468
3462
context("use-internal-malloc",
3469
3463
N_("Use HailDB's internal memory allocator instead of the OS memory allocator"));
3472
static drizzle_sys_var* innobase_system_variables[]= {
3473
DRIZZLE_SYSVAR(data_file_path),
3474
DRIZZLE_SYSVAR(lock_wait_timeout),
3475
DRIZZLE_SYSVAR(log_file_size),
3476
DRIZZLE_SYSVAR(log_files_in_group),
3477
DRIZZLE_SYSVAR(log_buffer_size),
3478
DRIZZLE_SYSVAR(lru_old_blocks_pct),
3479
DRIZZLE_SYSVAR(lru_block_access_recency),
3480
DRIZZLE_SYSVAR(max_dirty_pages_pct),
3481
DRIZZLE_SYSVAR(max_purge_lag),
3482
DRIZZLE_SYSVAR(open_files),
3483
DRIZZLE_SYSVAR(read_io_threads),
3484
DRIZZLE_SYSVAR(rollback_on_timeout),
3485
DRIZZLE_SYSVAR(write_io_threads),
3486
DRIZZLE_SYSVAR(print_verbose_log),
3487
DRIZZLE_SYSVAR(status_file),
3488
DRIZZLE_SYSVAR(sync_spin_loops),
3489
DRIZZLE_SYSVAR(use_sys_malloc),
3493
3466
DRIZZLE_DECLARE_PLUGIN
3495
3468
DRIZZLE_VERSION_ID,