def test_rollback_and_persistence_race_condition(self): cluster = self.cluster gen_load = doc_generator(self.key, 0, self.num_items) for bucket in self.bucket_util.buckets: task = self.task.async_load_gen_docs( self.cluster, bucket, gen_load, "create", 0, batch_size=10, process_concurrency=8, replicate_to=self.replicate_to, persist_to=self.persist_to, timeout_secs=self.sdk_timeout, retries=self.sdk_retries) self.task.jython_task_manager.get_task_result(task) # Stop persistence for server in cluster.servers[:self.nodes_init]: # Create cbepctl command object node_shell_conn = RemoteMachineShellConnection(server) cbepctl_obj = Cbepctl(node_shell_conn) for bucket in self.bucket_util.buckets: cbepctl_obj.persistence(bucket.name, "stop") # Disconnect the shell_connection node_shell_conn.disconnect() self.sleep(10, "Wait after stop_persistence") # more (non-intersecting) load gen_load = doc_generator(self.key, 0, self.num_items, doc_size=64) for bucket in self.bucket_util.buckets: task = self.task.async_load_gen_docs( self.cluster, bucket, gen_load, "create", 0, batch_size=10, process_concurrency=8, replicate_to=self.replicate_to, persist_to=self.persist_to, timeout_secs=self.sdk_timeout, retries=self.sdk_retries) self.task.jython_task_manager.get_task_result(task) shell = RemoteMachineShellConnection(cluster.servers[0]) shell.kill_memcached() self.sleep(10, "Wait after kill memcached") node1_shell_conn = RemoteMachineShellConnection(cluster.servers[0]) node2_shell_conn = RemoteMachineShellConnection(cluster.servers[1]) node1_cb_stat_obj = Cbstats(node1_shell_conn) node2_cb_stat_obj = Cbstats(node2_shell_conn) node1_items = node1_cb_stat_obj.all_stats(bucket, "curr_items_tot") node2_items = node2_cb_stat_obj.all_stats(bucket, "curr_items_tot") # Disconnect the opened connections node1_shell_conn.disconnect() node2_shell_conn.disconnect() self.assertTrue(node1_items == node2_items, 'Node items not equal. Node 1:{0}, node 2:{1}' .format(node1_items, node2_items))
def tearDown(self): shell = RemoteMachineShellConnection(self.cluster.master) cbstat_obj = Cbstats(shell) for bucket in self.bucket_util.buckets: result = cbstat_obj.all_stats(bucket.name) self.log.info("Bucket: %s, Active Resident ratio(DGM): %s%%" % (bucket.name, result["vb_active_perc_mem_resident"])) self.log.info("Bucket: %s, Replica Resident ratio(DGM): %s%%" % (bucket.name, result["vb_replica_perc_mem_resident"])) if not self.skip_collections_cleanup: self.bucket_util.remove_scope_collections_for_bucket(bucket) shell.disconnect() if self.validate_docs_count_during_teardown: self.bucket_util.validate_docs_per_collections_all_buckets() super(CollectionBase, self).tearDown()
def tearDown(self): cbstat_obj = Cbstats(self.cluster.master) for bucket in self.cluster.buckets: if bucket.bucketType != Bucket.Type.MEMCACHED: result = cbstat_obj.all_stats(bucket.name) self.log.info("Bucket: %s, Active Resident ratio(DGM): %s%%" % (bucket.name, result["vb_active_perc_mem_resident"])) self.log.info("Bucket: %s, Replica Resident ratio(DGM): %s%%" % (bucket.name, result["vb_replica_perc_mem_resident"])) if not self.skip_collections_cleanup \ and bucket.bucketType != Bucket.Type.MEMCACHED: self.bucket_util.remove_scope_collections_for_bucket( self.cluster, bucket) if self.validate_docs_count_during_teardown: self.bucket_util.validate_docs_per_collections_all_buckets( self.cluster) if self.disk_optimized_thread_settings: self.set_num_writer_and_reader_threads(num_writer_threads="default", num_reader_threads="default") super(CollectionBase, self).tearDown()