~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/handler/ha_innodb.cc

  • Committer: Monty Taylor
  • Date: 2010-08-17 02:54:36 UTC
  • mfrom: (1711.1.7 build)
  • Revision ID: mordred@inaugust.com-20100817025436-iuuqihjal6ubyffy
boost::program_options for InnoDB.

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
#include <drizzled/transaction_services.h>
89
89
 
90
90
#include <boost/algorithm/string.hpp>
 
91
#include <boost/program_options.hpp>
 
92
#include <drizzled/module/option_map.h>
 
93
#include <iostream>
 
94
 
 
95
namespace po= boost::program_options;
 
96
using namespace std;
91
97
 
92
98
/** @file ha_innodb.cc */
93
99
 
180
186
 
181
187
static long innobase_mirrored_log_groups, innobase_log_files_in_group,
182
188
  innobase_log_buffer_size,
183
 
  innobase_additional_mem_pool_size, innobase_file_io_threads,
 
189
  innobase_file_io_threads,
184
190
  innobase_force_recovery, innobase_open_files;
 
191
static long innobase_additional_mem_pool_size= 8*1024*1024L;
185
192
static ulong innobase_commit_concurrency = 0;
186
193
static ulong innobase_read_io_threads;
187
194
static ulong innobase_write_io_threads;
189
196
/**
190
197
 * @TODO: Turn this into size_t as soon as we have a Variable<size_t>
191
198
 */
192
 
static int64_t innobase_buffer_pool_size, innobase_log_file_size;
 
199
static int64_t innobase_buffer_pool_size= 128*1024*1024;
 
200
static int64_t innobase_log_file_size;
193
201
 
194
202
/* The default values for the following char* start-up parameters
195
203
are determined in innobase_init below: */
296
304
      pthread_mutex_destroy(&commit_cond_m);
297
305
      pthread_cond_destroy(&commit_cond);
298
306
    }
 
307
    
 
308
    /* These get strdup'd from vm variables */
 
309
    free(innobase_data_home_dir);
 
310
 
299
311
  }
300
312
 
301
313
private:
1815
1827
  prebuilt->read_just_key = 0;
1816
1828
}
1817
1829
 
 
1830
template<class T>
 
1831
void align_value(T& value, size_t align_val= 1024)
 
1832
{
 
1833
  value= value - (value % align_val);
 
1834
}
 
1835
 
1818
1836
/*********************************************************************//**
1819
1837
Opens an InnoDB database.
1820
1838
@return 0 on success, error code on failure */
1830
1848
  char    *default_path;
1831
1849
  uint    format_id;
1832
1850
  InnobaseEngine *actuall_engine_ptr;
 
1851
  const module::option_map &vm= context.getOptions();
 
1852
 
 
1853
  if (vm.count("io-capacity"))
 
1854
  {
 
1855
    if (srv_io_capacity < 100)
 
1856
    {
 
1857
      errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for io-capacity\n"));
 
1858
      exit(-1);
 
1859
    }
 
1860
  }
 
1861
 
 
1862
  if (vm.count("data-home-dir"))
 
1863
  {
 
1864
    innobase_data_home_dir= strdup(vm["data-home-dir"].as<string>().c_str());
 
1865
  }
 
1866
 
 
1867
  else
 
1868
  {
 
1869
    innobase_data_home_dir= NULL;
 
1870
  }
 
1871
 
 
1872
  if (vm.count("fast-shutdown"))
 
1873
  {
 
1874
    if (innobase_fast_shutdown > 2)
 
1875
    {
 
1876
      errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for fast-shutdown\n"));
 
1877
      exit(-1);
 
1878
    }
 
1879
  }
 
1880
 
 
1881
  if (vm.count("file-format-check"))
 
1882
  {
 
1883
    innobase_file_format_check= const_cast<char *>(vm["file-format-check"].as<string>().c_str());
 
1884
  }
 
1885
 
 
1886
  if (vm.count("flush-log-at-trx-commit"))
 
1887
  {
 
1888
    if (srv_flush_log_at_trx_commit > 2)
 
1889
    {
 
1890
      errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for flush-log-at-trx-commit\n"));
 
1891
      exit(-1);
 
1892
    }
 
1893
  }
 
1894
 
 
1895
  if (vm.count("flush-method"))
 
1896
  {
 
1897
    innobase_unix_file_flush_method= const_cast<char *>(vm["flush-method"].as<string>().c_str());
 
1898
  }
 
1899
  else
 
1900
  {
 
1901
    innobase_unix_file_flush_method= NULL;
 
1902
  }
 
1903
 
 
1904
#ifdef UNIV_LOG_ARCHIVE
 
1905
  if (vm.count("log-arch-dir"))
 
1906
  {
 
1907
    innobase_log_arch_dir= const_cast<char *>(vm["log-arch-dir"].as<string>().c_str());
 
1908
  }
 
1909
 
 
1910
  else
 
1911
  {
 
1912
    innobase_log_arch_dir= NULL;
 
1913
  }
 
1914
#endif /* UNIV_LOG_ARCHIVE */
 
1915
 
 
1916
  if (vm.count("max-dirty-pages-pct"))
 
1917
  {
 
1918
    if (srv_max_buf_pool_modified_pct > 99)
 
1919
    {
 
1920
      errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for max-dirty-pages-pct\n"));
 
1921
      exit(-1);
 
1922
    }
 
1923
  }
 
1924
 
 
1925
  if (vm.count("stats-sample-pages"))
 
1926
  {
 
1927
    if (srv_stats_sample_pages < 8)
 
1928
    {
 
1929
      errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for stats-sample-pages\n"));
 
1930
      exit(-1);
 
1931
    }
 
1932
  }
 
1933
 
 
1934
  if (vm.count("additional-mem-pool-size"))
 
1935
  {
 
1936
    align_value(innobase_additional_mem_pool_size);
 
1937
 
 
1938
    if (innobase_additional_mem_pool_size < 512*1024L)
 
1939
    {
 
1940
      errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for additional-mem-pool-size\n"));
 
1941
      exit(-1);
 
1942
    }
 
1943
 
 
1944
  }
 
1945
 
 
1946
  if (vm.count("autoextend-increment"))
 
1947
  {
 
1948
    if (srv_auto_extend_increment < 1 || srv_auto_extend_increment > 1000)
 
1949
    {
 
1950
      errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for autoextend-increment\n"));
 
1951
      exit(-1);
 
1952
    }
 
1953
  }
 
1954
 
 
1955
  if (vm.count("buffer-pool-size"))
 
1956
  {
 
1957
    align_value(innobase_buffer_pool_size, 1024*1024);
 
1958
    if (innobase_buffer_pool_size < 5*1024*1024)
 
1959
    {
 
1960
      errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for buffer-pool-size\n"));
 
1961
      exit(-1);
 
1962
    }
 
1963
    
 
1964
  }
 
1965
 
 
1966
  if (vm.count("commit-concurrency"))
 
1967
  {
 
1968
    if (srv_replication_delay > 1000)
 
1969
    {
 
1970
      errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for commit-concurrency\n"));
 
1971
      exit(-1);
 
1972
    }
 
1973
  }
 
1974
 
 
1975
  if (vm.count("concurrency-tickets"))
 
1976
  {
 
1977
    if (srv_n_free_tickets_to_enter < 1)
 
1978
    {
 
1979
      errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for concurrency-tickets\n"));
 
1980
      exit(-1);
 
1981
    }
 
1982
  }
 
1983
 
 
1984
  if (vm.count("file-io-threads"))
 
1985
  {
 
1986
    if (innobase_file_io_threads < 4 || innobase_file_io_threads > 64)
 
1987
    {
 
1988
      errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for file-io-threads\n"));
 
1989
      exit(-1);
 
1990
    }
 
1991
  }
 
1992
 
 
1993
  if (vm.count("read-io-threads"))
 
1994
  {
 
1995
    if (innobase_read_io_threads < 1 || innobase_read_io_threads > 64)
 
1996
    {
 
1997
      errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for read-io-threads\n"));
 
1998
      exit(-1);
 
1999
    }
 
2000
  }
 
2001
 
 
2002
  if (vm.count("write-io-threads"))
 
2003
  {
 
2004
    if (innobase_write_io_threads < 1 || innobase_write_io_threads > 64)
 
2005
    {
 
2006
      errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for write-io-threads\n"));
 
2007
      exit(-1);
 
2008
    }
 
2009
  }
 
2010
 
 
2011
  if (vm.count("force-recovery"))
 
2012
  {
 
2013
    if (innobase_force_recovery > 6)
 
2014
    {
 
2015
      errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for force-recovery\n"));
 
2016
      exit(-1);
 
2017
    }
 
2018
  }
 
2019
 
 
2020
  if (vm.count("log-buffer-size"))
 
2021
  {
 
2022
    align_value(innobase_log_buffer_size);
 
2023
    if (innobase_log_buffer_size < 256*1024L)
 
2024
    {
 
2025
      errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for log-file-size\n"));
 
2026
      exit(-1);
 
2027
    }
 
2028
  }
 
2029
 
 
2030
  if (vm.count("log-file-size"))
 
2031
  {
 
2032
    align_value(innobase_log_file_size, 1024*1024);
 
2033
    if (innobase_log_file_size < 1*1024*1024L)
 
2034
    {
 
2035
      errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for log-file-size\n"));
 
2036
      exit(-1);
 
2037
    }
 
2038
  }
 
2039
 
 
2040
  if (vm.count("log-files-in-group"))
 
2041
  {
 
2042
    if (innobase_log_files_in_group < 2 || innobase_log_files_in_group > 100)
 
2043
    {
 
2044
      errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for log-files-in-group\n"));
 
2045
      exit(-1);
 
2046
    }
 
2047
  }
 
2048
 
 
2049
  if (vm.count("mirrored-log-groups"))
 
2050
  {
 
2051
    if (innobase_mirrored_log_groups < 1 || innobase_mirrored_log_groups > 10)
 
2052
    {
 
2053
      errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for mirrored-log-groups\n"));
 
2054
      exit(-1);
 
2055
    }
 
2056
  }
 
2057
 
 
2058
  if (vm.count("open-files"))
 
2059
  {
 
2060
    if (innobase_open_files < 10)
 
2061
    {
 
2062
      errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for open-files\n"));
 
2063
      exit(-1);
 
2064
    }
 
2065
  }
 
2066
 
 
2067
  if (vm.count("thread-concurrency"))
 
2068
  {
 
2069
    if (srv_thread_concurrency > 1000)
 
2070
    {
 
2071
      errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for thread-concurrency\n"));
 
2072
      exit(-1);
 
2073
    }
 
2074
  }
 
2075
 
 
2076
  if (vm.count("data-file-path"))
 
2077
  {
 
2078
    innobase_data_file_path= const_cast<char *>(vm["data-file-path"].as<string>().c_str());
 
2079
  }
 
2080
  else
 
2081
  {
 
2082
    innobase_data_file_path= NULL;
 
2083
  }
 
2084
 
 
2085
  if (vm.count("version"))
 
2086
  {
 
2087
    innodb_version_str= const_cast<char *>(vm["version"].as<string>().c_str());
 
2088
  }
 
2089
 
 
2090
  if (vm.count("read-ahead-threshold"))
 
2091
  {
 
2092
    if (srv_read_ahead_threshold > 64)
 
2093
    {
 
2094
      errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for read-ahead-threshold\n"));
 
2095
      exit(-1);
 
2096
    }
 
2097
  }
 
2098
 
 
2099
  if (vm.count("support-xa"))
 
2100
  {
 
2101
    (SessionVAR(NULL,support_xa))= vm["support-xa"].as<bool>();
 
2102
  }
 
2103
 
 
2104
  if (vm.count("table-locks"))
 
2105
  {
 
2106
    (SessionVAR(NULL,table_locks))= vm["table-locks"].as<bool>();
 
2107
  }
 
2108
 
 
2109
  if (vm.count("strict-mode"))
 
2110
  {
 
2111
    (SessionVAR(NULL,strict_mode))= vm["strict-mode"].as<bool>();
 
2112
  }
 
2113
 
 
2114
  if (vm.count("lock-wait-timeout"))
 
2115
  {
 
2116
    if (vm["lock-wait-timeout"].as<unsigned long>() < 1 || vm["lock-wait-timeout"].as<unsigned long>() > 1024*1024*1024)
 
2117
    {
 
2118
      errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for lock-wait-timeout\n"));
 
2119
      exit(-1);
 
2120
    }
 
2121
 
 
2122
    (SessionVAR(NULL,lock_wait_timeout))= vm["lock-wait-timeout"].as<unsigned long>();
 
2123
  }
1833
2124
 
1834
2125
  innodb_engine_ptr= actuall_engine_ptr= new InnobaseEngine(innobase_engine_name);
1835
2126
 
1930
2221
 
1931
2222
  /* The default dir for log files is the datadir of MySQL */
1932
2223
 
1933
 
  if (!innobase_log_group_home_dir) {
 
2224
  if (vm.count("log-group-home-dir"))
 
2225
  {
 
2226
    innobase_log_group_home_dir= const_cast<char *>(vm["log-group-home-dir"].as<string>().c_str());
 
2227
  }
 
2228
  else
 
2229
  {
1934
2230
    innobase_log_group_home_dir = default_path;
1935
2231
  }
1936
2232
 
1954
2250
    goto mem_free_and_error;
1955
2251
  }
1956
2252
 
 
2253
 
1957
2254
  /* Validate the file format by animal name */
1958
 
  if (innobase_file_format_name != NULL) {
1959
 
 
 
2255
  if (vm.count("file-format"))
 
2256
  {
1960
2257
    format_id = innobase_file_format_name_lookup(
1961
 
                                                 innobase_file_format_name);
 
2258
                                                 vm["file-format"].as<string>().c_str());
1962
2259
 
1963
2260
    if (format_id > DICT_TF_FORMAT_MAX) {
1964
2261
 
1967
2264
      goto mem_free_and_error;
1968
2265
    }
1969
2266
  } else {
1970
 
    /* Set it to the default file format id. Though this
1971
 
      should never happen. */
 
2267
    /* Set it to the default file format id.*/
1972
2268
    format_id = 0;
1973
2269
  }
1974
2270
 
2007
2303
    }
2008
2304
  }
2009
2305
 
2010
 
  if (innobase_change_buffering) {
 
2306
  if (vm.count("change-buffering"))
 
2307
  {
2011
2308
    ulint use;
2012
2309
 
2013
2310
    for (use = 0;
2014
2311
         use < UT_ARR_SIZE(innobase_change_buffering_values);
2015
2312
         use++) {
2016
2313
      if (!innobase_strcasecmp(
2017
 
                               innobase_change_buffering,
 
2314
                               vm["change-buffering"].as<string>().c_str(),
2018
2315
                               innobase_change_buffering_values[use])) {
2019
2316
        ibuf_use = (ibuf_use_t) use;
2020
2317
        goto innobase_change_buffering_inited_ok;
2024
2321
    errmsg_printf(ERRMSG_LVL_ERROR,
2025
2322
                  "InnoDB: invalid value "
2026
2323
                  "innodb_file_format_check=%s",
2027
 
                  innobase_change_buffering);
 
2324
                  vm["change-buffering"].as<string>().c_str());
2028
2325
    goto mem_free_and_error;
2029
2326
  }
2030
2327
 
8352
8649
/* plugin options */
8353
8650
static DRIZZLE_SYSVAR_BOOL(checksums, innobase_use_checksums,
8354
8651
  PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
8355
 
  "Enable InnoDB checksums validation (enabled by default). "
8356
 
  "Disable with --skip-innodb-checksums.",
 
8652
  "Enable InnoDB checksums validation (enabled by default). ",
8357
8653
  NULL, NULL, TRUE);
8358
8654
 
8359
8655
static DRIZZLE_SYSVAR_STR(data_home_dir, innobase_data_home_dir,
8363
8659
 
8364
8660
static DRIZZLE_SYSVAR_BOOL(doublewrite, innobase_use_doublewrite,
8365
8661
  PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
8366
 
  "Enable InnoDB doublewrite buffer (enabled by default). "
8367
 
  "Disable with --skip-innodb-doublewrite.",
 
8662
  "Enable InnoDB doublewrite buffer (enabled by default). ",
8368
8663
  NULL, NULL, TRUE);
8369
8664
 
8370
8665
static DRIZZLE_SYSVAR_ULONG(io_capacity, srv_io_capacity,
8455
8750
 
8456
8751
static DRIZZLE_SYSVAR_BOOL(adaptive_hash_index, btr_search_enabled,
8457
8752
  PLUGIN_VAR_OPCMDARG,
8458
 
  "Enable InnoDB adaptive hash index (enabled by default).  "
8459
 
  "Disable with --skip-innodb-adaptive-hash-index.",
 
8753
  "Enable InnoDB adaptive hash index (enabled by default).",
8460
8754
  NULL, innodb_adaptive_hash_index_update, TRUE);
8461
8755
 
8462
8756
static DRIZZLE_SYSVAR_ULONG(replication_delay, srv_replication_delay,
8582
8876
  "trigger a readahead.",
8583
8877
  NULL, NULL, 56, 0, 64, 0);
8584
8878
 
 
8879
static void init_options(drizzled::module::option_context &context)
 
8880
{
 
8881
  context("checksums",
 
8882
          po::value<bool>(&innobase_use_checksums)->default_value(true)->zero_tokens(),
 
8883
          "Enable InnoDB checksums validation.");
 
8884
  context("data-home-dir",
 
8885
          po::value<string>(),
 
8886
          "The common part for InnoDB table spaces.");
 
8887
  context("doublewrite",
 
8888
          po::value<bool>(&innobase_use_doublewrite)->default_value(true)->zero_tokens(),
 
8889
          "Enable InnoDB doublewrite buffer.");
 
8890
  context("io-capacity",
 
8891
          po::value<unsigned long>(&srv_io_capacity)->default_value(200),
 
8892
          "Number of IOPs the server can do. Tunes the background IO rate");
 
8893
  context("fast-shutdown",
 
8894
          po::value<unsigned long>(&innobase_fast_shutdown)->default_value(1), 
 
8895
          "Speeds up the shutdown process of the InnoDB storage engine. Possible values are 0, 1 (faster) or 2 (fastest - crash-like).");
 
8896
  context("file-per-table",
 
8897
          po::value<bool>(&srv_file_per_table)->default_value(false)->zero_tokens(),
 
8898
          "Stores each InnoDB table to an .ibd file in the database dir.");
 
8899
  context("file-format",
 
8900
          po::value<string>()->default_value("Antelope"),
 
8901
          "File format to use for new tables in .ibd files.");
 
8902
  context("file-format-check",
 
8903
          po::value<string>()->default_value("on"),
 
8904
          "The highest file format in the tablespace.");
 
8905
  context("flush-log-at-trx-commit",
 
8906
          po::value<unsigned long>(&srv_flush_log_at_trx_commit)->default_value(1),
 
8907
          "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).");
 
8908
  context("flush-method",
 
8909
          po::value<string>(),
 
8910
          "With which method to flush data.");
 
8911
#ifdef UNIV_LOG_ARCHIVE
 
8912
  context("log-arch-dir",
 
8913
          po::value<string>(),
 
8914
          "Where full logs should be archived.");
 
8915
  context("log-archive",
 
8916
          po::value<bool>(&innobase_log_archive)->default_value(false)->zero_tokens(),
 
8917
          "Set to 1 if you want to have logs archived.");
 
8918
#endif /* UNIV_LOG_ARCHIVE */
 
8919
  context("log-group-home-dir",
 
8920
          po::value<string>(),
 
8921
          "Path to InnoDB log files.");
 
8922
  context("max-dirty-pages-pct",
 
8923
          po::value<unsigned long>(&srv_max_buf_pool_modified_pct)->default_value(75),
 
8924
          "Percentage of dirty pages allowed in bufferpool.");
 
8925
  context("adaptive-flushing",
 
8926
          po::value<bool>(&srv_adaptive_flushing)->default_value(true)->zero_tokens(),
 
8927
          "Attempt flushing dirty pages to avoid IO bursts at checkpoints.");
 
8928
  context("max-purge-lag",
 
8929
          po::value<unsigned long>(&srv_max_purge_lag)->default_value(0),
 
8930
          "Desired maximum length of the purge queue (0 = no limit)");
 
8931
  context("status-file",
 
8932
          po::value<bool>(&innobase_create_status_file)->default_value(false)->zero_tokens(),
 
8933
          "Enable SHOW INNODB STATUS output in the innodb_status.<pid> file");
 
8934
  context("stats-on-metadata",
 
8935
          po::value<bool>(&innobase_stats_on_metadata)->default_value(true)->zero_tokens(),
 
8936
          "Enable statistics gathering for metadata commands such as SHOW TABLE STATUS (on by default)");
 
8937
  context("stats-sample-pages",
 
8938
          po::value<uint64_t>(&srv_stats_sample_pages)->default_value(8),
 
8939
          "The number of index pages to sample when calculating statistics (default 8)");
 
8940
  context("adaptive-hash-index",
 
8941
          po::value<bool>(&btr_search_enabled)->default_value(true)->zero_tokens(),
 
8942
          "Enable InnoDB adaptive hash index (enabled by default)");
 
8943
  context("replication-delay",
 
8944
          po::value<unsigned long>(&srv_replication_delay)->default_value(0),
 
8945
          "Replication thread delay (ms) on the slave server if innodb_thread_concurrency is reached (0 by default)");
 
8946
  context("additional-mem-pool-size",
 
8947
          po::value<long>(&innobase_additional_mem_pool_size)->default_value(8*1024*1024L),
 
8948
          "Size of a memory pool InnoDB uses to store data dictionary information and other internal data structures.");
 
8949
  context("autoextend-increment",
 
8950
          po::value<uint32_t>(&srv_auto_extend_increment)->default_value(8L),
 
8951
          "Data file autoextend increment in megabytes");
 
8952
  context("buffer-pool-size",
 
8953
          po::value<int64_t>(&innobase_buffer_pool_size)->default_value(128*1024*1024L),
 
8954
          "The size of the memory buffer InnoDB uses to cache data and indexes of its tables.");
 
8955
  context("commit-concurrency",
 
8956
          po::value<unsigned long>(&innobase_commit_concurrency)->default_value(0),
 
8957
          "Helps in performance tuning in heavily concurrent environments.");
 
8958
  context("concurrency-tickets",
 
8959
          po::value<unsigned long>(&srv_n_free_tickets_to_enter)->default_value(500L),
 
8960
          "Number of times a thread is allowed to enter InnoDB within the same SQL query after it has once got the ticket");
 
8961
  context("file-io-threads",
 
8962
          po::value<long>(&innobase_file_io_threads)->default_value(4),
 
8963
          "Number of file I/O threads in InnoDB.");
 
8964
  context("read-io-threads",
 
8965
          po::value<unsigned long>(&innobase_read_io_threads)->default_value(4),
 
8966
          "Number of background read I/O threads in InnoDB.");
 
8967
  context("write-io-threads",
 
8968
          po::value<unsigned long>(&innobase_write_io_threads)->default_value(4),
 
8969
          "Number of background write I/O threads in InnoDB.");
 
8970
  context("force-recovery",
 
8971
          po::value<long>(&innobase_force_recovery)->default_value(0),
 
8972
          "Helps to save your data in case the disk image of the database becomes corrupt.");
 
8973
  context("log-buffer-size",
 
8974
          po::value<long>(&innobase_log_buffer_size)->default_value(8*1024*1024L),
 
8975
          "The size of the buffer which InnoDB uses to write log to the log files on disk.");
 
8976
  context("log-file-size",
 
8977
          po::value<int64_t>(&innobase_log_file_size)->default_value(20*1024*1024L),
 
8978
          "The size of the buffer which InnoDB uses to write log to the log files on disk.");
 
8979
  context("log-files-in-group",
 
8980
          po::value<long>(&innobase_log_files_in_group)->default_value(2),
 
8981
          "Number of log files in the log group. InnoDB writes to the files in a circular fashion.");
 
8982
  context("mirrored-log-groups",
 
8983
          po::value<long>(&innobase_mirrored_log_groups)->default_value(1),
 
8984
          "Number of identical copies of log groups we keep for the database. Currently this should be set to 1.");
 
8985
  context("open-files",
 
8986
          po::value<long>(&innobase_open_files)->default_value(300L),
 
8987
          "How many files at the maximum InnoDB keeps open at the same time.");
 
8988
  context("sync-spin-loops",
 
8989
          po::value<unsigned long>(&srv_n_spin_wait_rounds)->default_value(30L),
 
8990
          "Count of spin-loop rounds in InnoDB mutexes (30 by default)");
 
8991
  context("spin-wait-delay",
 
8992
          po::value<unsigned long>(&srv_spin_wait_delay)->default_value(6L),
 
8993
          "Maximum delay between polling for a spin lock (6 by default)");
 
8994
  context("thread-concurrency",
 
8995
          po::value<unsigned long>(&srv_thread_concurrency)->default_value(0),
 
8996
          "Helps in performance tuning in heavily concurrent environments. Sets the maximum number of threads allowed inside InnoDB. Value 0 will disable the thread throttling.");
 
8997
  context("thread-sleep-delay",
 
8998
          po::value<unsigned long>(&srv_thread_sleep_delay)->default_value(10000L),
 
8999
          "Time of innodb thread sleeping before joining InnoDB queue (usec). Value 0 disable a sleep");
 
9000
  context("data-file-path",
 
9001
          po::value<string>(),
 
9002
          "Path to individual files and their sizes.");
 
9003
  context("version",
 
9004
          po::value<string>()->default_value(INNODB_VERSION_STR),
 
9005
          "InnoDB version");
 
9006
  context("use-sys-malloc",
 
9007
          po::value<bool>(&srv_use_sys_malloc)->default_value(true)->zero_tokens(),
 
9008
          "Use OS memory allocator instead of InnoDB's internal memory allocator");
 
9009
  context("change-buffering",
 
9010
          po::value<string>(),
 
9011
          "Buffer changes to reduce random access: OFF, ON, inserting, deleting, changing, or purging.");
 
9012
  context("read-ahead-threshold",
 
9013
          po::value<unsigned long>(&srv_read_ahead_threshold)->default_value(56),
 
9014
          "Number of pages that must be accessed sequentially for InnoDB to trigger a readahead.");
 
9015
  context("support-xa",
 
9016
          po::value<bool>()->default_value(true)->zero_tokens(),
 
9017
          "Enable InnoDB support for the XA two-phase commit");
 
9018
  context("table-locks",
 
9019
          po::value<bool>()->default_value(true)->zero_tokens(),
 
9020
          "Enable InnoDB locking in LOCK TABLES");
 
9021
  context("strict-mode",
 
9022
          po::value<bool>()->default_value(false)->zero_tokens(),
 
9023
          "Use strict mode when evaluating create options.");
 
9024
  context("lock-wait-timeout",
 
9025
          po::value<unsigned long>()->default_value(50),
 
9026
          "Timeout in seconds an InnoDB transaction may wait for a lock before being rolled back. Values above 100000000 disable the timeout.");
 
9027
}
 
9028
 
8585
9029
static drizzle_sys_var* innobase_system_variables[]= {
8586
9030
  DRIZZLE_SYSVAR(additional_mem_pool_size),
8587
9031
  DRIZZLE_SYSVAR(autoextend_increment),
8646
9090
  PLUGIN_LICENSE_GPL,
8647
9091
  innobase_init, /* Plugin Init */
8648
9092
  innobase_system_variables, /* system variables */
8649
 
  NULL /* reserved */
 
9093
  init_options /* reserved */
8650
9094
}
8651
9095
DRIZZLE_DECLARE_PLUGIN_END;
8652
9096