List:Commits« Previous MessageNext Message »
From:tomas Date:January 23 2008 1:09pm
Subject:bk commit into 5.1 tree (tomas:1.2842)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of tomas.  When tomas does a push these changes
will be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2008-01-23 14:09:11+01:00, tomas@stripped +5 -0
  wl#4236 ndb control batch size

  sql/ha_ndbcluster.cc@stripped, 2008-01-23 14:09:09+01:00, tomas@stripped +6 -2
    wl#4236 ndb control batch size

  sql/ha_ndbcluster.h@stripped, 2008-01-23 14:09:09+01:00, tomas@stripped +1 -0
    wl#4236 ndb control batch size

  sql/mysqld.cc@stripped, 2008-01-23 14:09:09+01:00, tomas@stripped +6 -0
    wl#4236 ndb control batch size

  sql/set_var.cc@stripped, 2008-01-23 14:09:09+01:00, tomas@stripped +3 -1
    wl#4236 ndb control batch size

  sql/sql_class.h@stripped, 2008-01-23 14:09:09+01:00, tomas@stripped +1 -0
    wl#4236 ndb control batch size

diff -Nrup a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
--- a/sql/ha_ndbcluster.cc	2008-01-23 10:13:40 +01:00
+++ b/sql/ha_ndbcluster.cc	2008-01-23 14:09:09 +01:00
@@ -974,7 +974,7 @@ ha_ndbcluster::batch_copy_row_to_buffer(
     return NULL;
   uint unsent= thd_ndb->m_unsent_bytes;
   unsent+= m_bytes_per_write;
-  batch_full= unsent >= BATCH_FLUSH_SIZE;
+  batch_full= unsent >= thd_ndb->m_batch_size;
   thd_ndb->m_unsent_bytes= unsent;
   return row;
 }
@@ -991,7 +991,7 @@ ha_ndbcluster::batch_copy_key_to_buffer(
   uint unsent= thd_ndb->m_unsent_bytes;
   unsent+= op_batch_size;
   DBUG_ASSERT(op_batch_size > 0);
-  batch_full= unsent >= BATCH_FLUSH_SIZE;
+  batch_full= unsent >= thd_ndb->m_batch_size;
   thd_ndb->m_unsent_bytes= unsent;
   return row;
 }
@@ -5615,6 +5615,10 @@ static void transaction_checks(THD *thd,
   else if (!thd->variables.ndb_use_transactions)
     thd_ndb->trans_options|= TNTO_TRANSACTIONS_OFF;
   thd_ndb->m_force_send= thd->variables.ndb_force_send;
+  if (!thd->slave_thread)
+    thd_ndb->m_batch_size= thd->variables.ndb_batch_size;
+  else
+    thd_ndb->m_batch_size= global_system_variables.ndb_batch_size;
 }
 
 int ha_ndbcluster::start_statement(THD *thd,
diff -Nrup a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h
--- a/sql/ha_ndbcluster.h	2007-12-14 16:14:18 +01:00
+++ b/sql/ha_ndbcluster.h	2008-01-23 14:09:09 +01:00
@@ -322,6 +322,7 @@ class Thd_ndb 
     we execute() to flush the rows buffered in m_batch_mem_root.
   */
   uint m_unsent_bytes;
+  uint m_batch_size;
 
   uint m_execute_count;
   uint m_max_violation_count;
diff -Nrup a/sql/mysqld.cc b/sql/mysqld.cc
--- a/sql/mysqld.cc	2007-12-18 07:32:29 +01:00
+++ b/sql/mysqld.cc	2008-01-23 14:09:09 +01:00
@@ -5035,6 +5035,7 @@ enum options_mysqld
   OPT_NDB_USE_EXACT_COUNT, OPT_NDB_USE_TRANSACTIONS,
   OPT_NDB_FORCE_SEND, OPT_NDB_AUTOINCREMENT_PREFETCH_SZ,
   OPT_NDB_SHM, OPT_NDB_OPTIMIZED_NODE_SELECTION, OPT_NDB_CACHE_CHECK_TIME,
+  OPT_NDB_BATCH_SIZE,
   OPT_NDB_OPTIMIZATION_DELAY,
   OPT_NDB_WAIT_CONNECTED,
   OPT_NDB_CLUSTER_CONNECTION_POOL,
@@ -5658,6 +5659,11 @@ master-ssl",
    "A dedicated thread is created to, at the given millisecons interval, invalidate the query cache if another MySQL server in the cluster has changed the data in the database.",
    (uchar**) &opt_ndb_cache_check_time, (uchar**) &opt_ndb_cache_check_time, 0, GET_ULONG, REQUIRED_ARG,
     0, 0, LONG_TIMEOUT, 0, 1, 0},
+  {"ndb-batch-size", OPT_NDB_BATCH_SIZE,
+   "Batch size in bytes.",
+   (uchar**) &global_system_variables.ndb_batch_size,
+   (uchar**) &global_system_variables.ndb_batch_size,
+    0, GET_ULONG, REQUIRED_ARG, 32768, 0, LONG_TIMEOUT, 0, 1, 0},
   {"ndb-optimization-delay", OPT_NDB_OPTIMIZATION_DELAY,
    "For optimize table, specifies the delay in milliseconds for each batch of rows sent",
    (uchar**) &global_system_variables.ndb_optimization_delay,
diff -Nrup a/sql/set_var.cc b/sql/set_var.cc
--- a/sql/set_var.cc	2008-01-23 10:13:09 +01:00
+++ b/sql/set_var.cc	2008-01-23 14:09:09 +01:00
@@ -512,6 +512,8 @@ static sys_var_thd_bool
 sys_ndb_table_no_logging(&vars, "ndb_table_no_logging", &SV::ndb_table_no_logging);
 static sys_var_thd_bool
 sys_ndb_table_temporary(&vars, "ndb_table_temporary", &SV::ndb_table_temporary);
+static sys_var_thd_ulong
+sys_ndb_batch_size(&vars, "ndb_batch_size", &SV::ndb_batch_size);
 static sys_var_long_ptr
 sys_ndb_cache_check_time(&vars, "ndb_cache_check_time", &ndb_cache_check_time);
 static sys_var_const_str
@@ -576,7 +578,7 @@ static sys_var_thd_bit	sys_log_binlog(&v
 				       set_option_bit,
 				       OPTION_BIN_LOG);
 static sys_var_thd_bit
-sys_transaction_allow_batchine(&vars, "transaction_allow_batching", 0,
+sys_transaction_allow_batching(&vars, "transaction_allow_batching", 0,
                                set_option_bit,
                                OPTION_ALLOW_BATCH);
 static sys_var_thd_bit	sys_sql_warnings(&vars, "sql_warnings", 0,
diff -Nrup a/sql/sql_class.h b/sql/sql_class.h
--- a/sql/sql_class.h	2008-01-23 10:13:09 +01:00
+++ b/sql/sql_class.h	2008-01-23 14:09:09 +01:00
@@ -301,6 +301,7 @@ struct system_variables
   ulong ndb_index_stat_update_freq;
   ulong ndb_optimized_node_selection;
   ulong ndb_optimization_delay;
+  ulong ndb_batch_size;
   ulong binlog_format; // binlog format for this thd (see enum_binlog_format)
   /*
     In slave thread we need to know in behalf of which
Thread
bk commit into 5.1 tree (tomas:1.2842)tomas23 Jan