Permalink
Browse files

CBQE-2336:: change logic for compaction when adding tasks

Change-Id: I57e6b388eeebc1f61b751de7deb4076bc852acc3
Reviewed-on: http://review.couchbase.org/39678
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Andrei Baranouski <andrei.baranouski@gmail.com>
  • Loading branch information...
1 parent 871d559 commit 48c5796cb472f57ade9c6c5065a7d47a08e87ef8 Parag Agarwal committed with paragagarwal Jul 22, 2014
@@ -6,7 +6,7 @@ rebalance.rebalanceinout.RebalanceInOutTests:
#incremental_rebalance_in_out_with_mutation_and_expiration,items=500000,value_size=512,max_verify=100000,GROUP=IN_OUT;P0
incremental_rebalance_out_in_with_mutation,replicas=2,value_size=2048,GROUP=IN_OUT;P1
incremental_rebalance_out_in_with_mutation,init_num_nodes=3,items=400000,GROUP=IN_OUT;P0
- incremental_rebalance_out_in_with_mutation_and_compaction,init_num_nodes=3,items=400000,GROUP=IN_OUT;P0
+ incremental_rebalance_in_out_with_mutation_and_compaction,init_num_nodes=3,items=400000,GROUP=IN_OUT;P0
incremental_rebalance_out_in_with_mutation,init_num_nodes=3,items=400000,standard_buckets=2,sasl_buckets=2,standard_bucket_priority=low:high,sasl_bucket_priority=low:high,GROUP=IN_OUT;P0
incremental_rebalance_out_in_with_mutation,replicas=3,init_num_nodes=3,GROUP=IN_OUT;P2
start_stop_rebalance_in_out,nodes_init=1,nodes_in=2,nodes_out=0,extra_nodes_in=1,extra_nodes_out=0,items=100000,max_verify=10000,value_size=1024,GROUP=IN_OUT;P0
@@ -380,16 +380,19 @@ def run_failover_operations_with_ops(self, chosen, failover_reason):
nodes = self.filter_servers(self.servers,chosen)
failed_over = self.cluster.async_failover([self.referenceNode], failover_nodes = chosen, graceful=self.graceful)
# Perform Compaction
+ compact_tasks = []
if self.compact:
for bucket in self.buckets:
- self.cluster.compact_bucket(self.referenceNode,bucket)
+ compact_tasks.append(self.cluster.async_compact_bucket(self.master,bucket))
# Run View Operations
if self.withViewsOps:
self.query_and_monitor_view_tasks(nodes)
# Run mutation operations
if self.withMutationOps:
self.run_mutation_operations()
failed_over.result()
+ for task in compact_tasks:
+ task.result()
msg = "rebalance failed while removing failover nodes {0}".format(node.id)
self.assertTrue(self.rest.monitorRebalance(stop_if_loop=True), msg=msg)
@@ -92,7 +92,7 @@ def rebalance_in_with_compaction_and_ops(self):
servs_in = [self.servers[i + self.nodes_init] for i in range(self.nodes_in)]
tasks = [self.cluster.async_rebalance(self.servers[:self.nodes_init], servs_in, [])]
for bucket in self.buckets:
- tasks += self.cluster.async_compact_bucket(self.master,bucket)
+ tasks.append(self.cluster.async_compact_bucket(self.master,bucket))
if(self.doc_ops is not None):
if("update" in self.doc_ops):
# 1/2th of data will be updated in each iteration
@@ -181,7 +181,7 @@ def incremental_rebalance_in_out_with_mutation_and_compaction(self):
for i in reversed(range(self.num_servers)[self.num_servers / 2:]):
tasks = self._async_load_all_buckets(self.master, gen, "update", 0, batch_size=batch_size, timeout_secs=60)
for bucket in self.buckets:
- self.cluster.compact_bucket(self.master,bucket)
+ tasks.append(self.cluster.async_compact_bucket(self.master,bucket))
self.cluster.rebalance(self.servers[:i], [], self.servers[i:self.num_servers])
self.sleep(10)
@@ -104,7 +104,7 @@ def rebalance_out_with_compaction_and_ops(self):
servs_out = [self.servers[self.num_servers - i - 1] for i in range(self.nodes_out)]
tasks = [self.cluster.async_rebalance(self.servers[:1], [], servs_out)]
for bucket in self.buckets:
- self.cluster.compact_bucket(self.master,bucket)
+ tasks.append(self.cluster.async_compact_bucket(self.master,bucket))
# define which doc's ops will be performed during rebalancing
# allows multiple of them but one by one
if(self.doc_ops is not None):

0 comments on commit 48c5796

Please sign in to comment.