[Commits] Rev 3517: Parallel load fixes in file:///data0/psergey/dev2/5.5-cassandra-r02/

Sergey Petrunya psergey at askmonty.org
Thu Sep 20 20:52:24 EEST 2012


At file:///data0/psergey/dev2/5.5-cassandra-r02/

------------------------------------------------------------
revno: 3517
revision-id: psergey at askmonty.org-20120920175224-mgeb9lxj0s89uudb
parent: psergey at askmonty.org-20120920143237-og4d9qh8uiojasmi
committer: Sergey Petrunya <psergey at askmonty.org>
branch nick: 5.5-cassandra-r02
timestamp: Thu 2012-09-20 21:52:24 +0400
message:
  Parallel load fixes
=== modified file 'storage/cassandra/cassandra_se.cc'
--- a/storage/cassandra/cassandra_se.cc	2012-09-20 14:32:37 +0000
+++ b/storage/cassandra/cassandra_se.cc	2012-09-20 17:52:24 +0000
@@ -154,6 +154,7 @@
   void on_set_keyspace_fail();
   void on_describe_keyspace(org::apache::cassandra::KsDef ks_def_arg);
   void on_batch_mutate_done();
+  void on_batch_mutate_fail();
 
   uint connected;
   uint keyspace_set;
@@ -466,6 +467,12 @@
   batch_mutations_to_do--;
 }
 
+void Cassandra_se_impl::on_batch_mutate_fail()
+{
+  batch_mutations_to_do--;
+  error_happened= true;
+}
+
 
 bool Cassandra_se_impl::do_insert(bool flush)
 {
@@ -481,7 +488,9 @@
       return false;
     }
   }
-
+  
+  batch_mutations_to_do= 0;
+  error_happened= false;
   for (uint i= 0; i < size; i++)
   {
     /*
@@ -494,7 +503,8 @@
  
     batch_mutations_to_do++;
     async_clients[i]->batch_mutate(batch_mutations[i], cur_consistency_level).
-      setCallback(boost::bind(&Cassandra_se_impl::on_batch_mutate_done, this));
+      setCallback(boost::bind(&Cassandra_se_impl::on_batch_mutate_done, this)).
+        setErrback(boost::bind(&Cassandra_se_impl::on_batch_mutate_fail, this));
 
     cassandra_counters.row_inserts+= batch_mutations[i].size();
     cassandra_counters.row_insert_batches++;
@@ -506,6 +516,8 @@
     //fprintf(stderr, "bm processed %d events\n", (int)cnt);
   }
   res= false;
+  if (error_happened)
+    res= true;
 
   clear_insert_buffer();
 

=== modified file 'storage/cassandra/ha_cassandra.cc'
--- a/storage/cassandra/ha_cassandra.cc	2012-09-20 14:32:37 +0000
+++ b/storage/cassandra/ha_cassandra.cc	2012-09-20 17:52:24 +0000
@@ -72,7 +72,7 @@
 
 static MYSQL_THDVAR_ULONG(insert_batch_size, PLUGIN_VAR_RQCMDARG,
   "Number of rows in an INSERT batch",
-  NULL, NULL, /*default*/ 100, /*min*/ 1, /*max*/ 1024*1024*1024, 0);
+  NULL, NULL, /*default*/ 20, /*min*/ 1, /*max*/ 1024*1024*1024, 0);
 
 static MYSQL_THDVAR_ULONG(multiget_batch_size, PLUGIN_VAR_RQCMDARG,
   "Number of rows in a multiget(MRR) batch",



More information about the commits mailing list