~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/transaction_log/module.cc

  • Committer: lbieber
  • Date: 2010-08-23 22:45:16 UTC
  • mfrom: (1727.2.1 staging)
  • Revision ID: lbieber@orisndriz03-20100823224516-k12j5r4znqnznr9d
Merge Vijay - bug 621866 - Changed --transaction-log.sync-method to --transaction-log.flush-frequency
Merge Lee - bug 622005 updateing test results that need to sorted by adding --sorted_result - 
Merge Andrew - bug #617537 re-connect connectionID is wrong 
Merge Andrew - bug #617534 incorrect error when reconnecting

Show diffs side-by-side

added added

removed removed

Lines of Context:
80
80
 * Numeric option controlling the sync/flush behaviour of the transaction
81
81
 * log.  Options are:
82
82
 *
83
 
 * TransactionLog::SYNC_METHOD_OS == 0            ... let OS do sync'ing
84
 
 * TransactionLog::SYNC_METHOD_EVERY_WRITE == 1   ... sync on every write
85
 
 * TransactionLog::SYNC_METHOD_EVERY_SECOND == 2  ... sync at most once a second
 
83
 * TransactionLog::FLUSH_FREQUENCY_OS == 0            ... let OS do sync'ing
 
84
 * TransactionLog::FLUSH_FREQUENCY_EVERY_WRITE == 1   ... sync on every write
 
85
 * TransactionLog::FLUSH_FREQUENCY_EVERY_SECOND == 2  ... sync at most once a second
86
86
 */
87
 
static uint32_t sysvar_transaction_log_sync_method= 0;
 
87
static uint32_t sysvar_transaction_log_flush_frequency= 0;
88
88
/**
89
89
 * Transaction Log plugin system variable - Number of slots to create
90
90
 * for managing write buffers
130
130
{
131
131
  const module::option_map &vm= context.getOptions();
132
132
 
133
 
  if (vm.count("sync-method"))
 
133
  if (vm.count("flush-frequency"))
134
134
  {
135
 
    if (sysvar_transaction_log_sync_method > 2)
 
135
    if (sysvar_transaction_log_flush_frequency > 2)
136
136
    {
137
137
      errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid value for sync-method\n"));
138
138
      exit(-1);
172
172
  if (sysvar_transaction_log_enabled)
173
173
  {
174
174
    transaction_log= new (nothrow) TransactionLog(string(sysvar_transaction_log_file),
175
 
                                                  sysvar_transaction_log_sync_method,
 
175
                                                  sysvar_transaction_log_flush_frequency,
176
176
                                                  sysvar_transaction_log_checksum_enabled);
177
177
 
178
178
    if (transaction_log == NULL)
321
321
                           NULL, /* update func */
322
322
                           false /* default */);
323
323
 
324
 
static DRIZZLE_SYSVAR_UINT(sync_method,
325
 
                           sysvar_transaction_log_sync_method,
 
324
static DRIZZLE_SYSVAR_UINT(flush_frequency,
 
325
                           sysvar_transaction_log_flush_frequency,
326
326
                           PLUGIN_VAR_OPCMDARG,
327
327
                           N_("0 == rely on operating system to sync log file (default), "
328
328
                              "1 == sync file at each transaction write, "
362
362
  context("use-replicator",
363
363
          po::value<string>(),
364
364
          N_("Name of the replicator plugin to use (default='default_replicator')")); 
365
 
  context("sync-method",
366
 
          po::value<uint32_t>(&sysvar_transaction_log_sync_method)->default_value(0),
 
365
  context("flush-frequency",
 
366
          po::value<uint32_t>(&sysvar_transaction_log_flush_frequency)->default_value(0),
367
367
          N_("0 == rely on operating system to sync log file (default), 1 == sync file at each transaction write, 2 == sync log file once per second"));
368
368
  context("num-write-buffers",
369
369
          po::value<uint32_t>(&sysvar_transaction_log_num_write_buffers)->default_value(8),
375
375
  DRIZZLE_SYSVAR(truncate_debug),
376
376
  DRIZZLE_SYSVAR(file),
377
377
  DRIZZLE_SYSVAR(enable_checksum),
378
 
  DRIZZLE_SYSVAR(sync_method),
 
378
  DRIZZLE_SYSVAR(flush_frequency),
379
379
  DRIZZLE_SYSVAR(num_write_buffers),
380
380
  DRIZZLE_SYSVAR(use_replicator),
381
381
  NULL