Example #1
0
 def __init__(self, *args, **kwargs):
     if CASSANDRA_VERSION_FROM_BUILD >= '3.0':
         kwargs['cluster_options'] = {'enable_user_defined_functions': 'true',
                                      'enable_scripted_user_defined_functions': 'true'}
     else:
         kwargs['cluster_options'] = {'enable_user_defined_functions': 'true'}
     Tester.__init__(self, *args, **kwargs)
 def __init__(self, *args, **kwargs):
     kwargs['cluster_options'] = {'start_rpc': 'true'}
     # Ignore these log patterns:
     self.ignore_log_patterns = [
         r'Can\'t send migration request: node.*is down',
     ]
     Tester.__init__(self, *args, **kwargs)
 def __init__(self, *args, **kwargs):
     if CASSANDRA_VERSION_FROM_BUILD >= '3.0':
         kwargs['cluster_options'] = {'enable_user_defined_functions': 'true',
                                      'enable_scripted_user_defined_functions': 'true'}
     else:
         kwargs['cluster_options'] = {'enable_user_defined_functions': 'true'}
     Tester.__init__(self, *args, **kwargs)
Example #4
0
    def __init__(self, *args, **kwargs):
        Tester.__init__(self, *args, **kwargs)

        # Generate 1000 rows in memory so we can re-use the same ones over again:
        self.groups = ['group1', 'group2', 'group3', 'group4']
        self.rows = [(str(uuid.uuid1()), x, random.choice(self.groups))
                     for x in range(1000)]
 def __init__(self, *args, **kwargs):
     kwargs['cluster_options'] = {'start_rpc': 'true'}
     # Ignore these log patterns:
     self.ignore_log_patterns = [
         r'Can\'t send migration request: node.*is down',
     ]
     Tester.__init__(self, *args, **kwargs)
 def __init__(self, *args, **kwargs):
     CASSANDRA_DIR = os.environ.get('CASSANDRA_DIR')
     if get_version_from_build(CASSANDRA_DIR) >= '3.0':
         kwargs['cluster_options'] = {'enable_user_defined_functions': 'true',
                                      'enable_scripted_user_defined_functions': 'true'}
     else:
         kwargs['cluster_options'] = {'enable_user_defined_functions': 'true'}
     Tester.__init__(self, *args, **kwargs)
Example #7
0
    def init_config(self):
        Tester.init_config(self)

        if self.extra_config is not None:
            debug("Setting extra configuration options:\n{}".format(
                pprint.pformat(dict(self.extra_config), indent=4)))
            self.cluster.set_configuration_options(
                values=dict(self.extra_config))
 def __init__(self, *args, **kwargs):
     self.ignore_log_patterns = [
         # This one occurs if we do a non-rolling upgrade, the node
         # it's trying to send the migration to hasn't started yet,
         # and when it does, it gets replayed and everything is fine.
         r'Can\'t send migration request: node.*is down',
     ]
     Tester.__init__(self, *args, **kwargs)
 def __init__(self, *args, **kwargs):
     self.ignore_log_patterns = [
         # This one occurs if we do a non-rolling upgrade, the node
         # it's trying to send the migration to hasn't started yet,
         # and when it does, it gets replayed and everything is fine.
         r'Can\'t send migration request: node.*is down',
     ]
     Tester.__init__(self, *args, **kwargs)
 def __init__(self, *args, **kwargs):
     CASSANDRA_DIR = os.environ.get('CASSANDRA_DIR')
     if get_version_from_build(CASSANDRA_DIR) >= '3.0':
         kwargs['cluster_options'] = {'enable_user_defined_functions': 'true',
                                      'enable_scripted_user_defined_functions': 'true'}
     else:
         kwargs['cluster_options'] = {'enable_user_defined_functions': 'true'}
     Tester.__init__(self, *args, **kwargs)
 def __init__(self, *args, **kwargs):
     # Ignore these log patterns:
     self.ignore_log_patterns = [
         # This one occurs when trying to send the migration to a
         # node that hasn't started yet, and when it does, it gets
         # replayed and everything is fine.
         r'Can\'t send migration request: node.*is down',
     ]
     Tester.__init__(self, *args, **kwargs)
 def __init__(self, *args, **kwargs):
     # Ignore these log patterns:
     self.ignore_log_patterns = [
         # This one occurs when trying to send the migration to a
         # node that hasn't started yet, and when it does, it gets
         # replayed and everything is fine.
         r'Can\'t send migration request: node.*is down',
     ]
     Tester.__init__(self, *args, **kwargs)
    def init_config(self):
        Tester.init_config(self)

        if self.extra_config is not None:
            debug("Setting extra configuration options:\n{}".format(
                pprint.pformat(dict(self.extra_config), indent=4))
            )
            self.cluster.set_configuration_options(
                values=dict(self.extra_config)
            )
 def __init__(self, *args, **kwargs):
     # Ignore these log patterns:
     self.ignore_log_patterns = [
         # This one occurs if we do a non-rolling upgrade, the node
         # it's trying to send the migration to hasn't started yet,
         # and when it does, it gets replayed and everything is fine.
         r'Can\'t send migration request: node.*is down',
     ]
     # Force cluster options that are common among versions:
     kwargs['cluster_options'] = {'partitioner':'org.apache.cassandra.dht.RandomPartitioner'}
     Tester.__init__(self, *args, **kwargs)
Example #15
0
 def __init__(self, *args, **kwargs):
     # Ignore these log patterns:
     self.ignore_log_patterns = [
         # This one occurs if we do a non-rolling upgrade, the node
         # it's trying to send the migration to hasn't started yet,
         # and when it does, it gets replayed and everything is fine.
         r'Can\'t send migration request: node.*is down',
     ]
     self.subprocs = []
     # Force cluster options that are common among versions:
     kwargs['cluster_options'] = {'partitioner': 'org.apache.cassandra.dht.Murmur3Partitioner'}
     Tester.__init__(self, *args, **kwargs)
Example #16
0
 def __init__(self, *args, **kwargs):
     # Ignore these log patterns:
     self.ignore_log_patterns = [
         # This one occurs if we do a non-rolling upgrade, the node
         # it's trying to send the migration to hasn't started yet,
         # and when it does, it gets replayed and everything is fine.
         r'Can\'t send migration request: node.*is down',
         r'RejectedExecutionException.*ThreadPoolExecutor has shut down',
         r'Cannot update data center or rack from.*for live host'  # occurs due to test/ccm writing topo on down nodes
     ]
     self.subprocs = []
     Tester.__init__(self, *args, **kwargs)
 def __init__(self, *args, **kwargs):
     # Ignore these log patterns:
     self.ignore_log_patterns = [
         # This one occurs if we do a non-rolling upgrade, the node
         # it's trying to send the migration to hasn't started yet,
         # and when it does, it gets replayed and everything is fine.
         r'Can\'t send migration request: node.*is down',
         r'RejectedExecutionException.*ThreadPoolExecutor has shut down',
         r'Cannot update data center or rack from.*for live host'  # occurs due to test/ccm writing topo on down nodes
     ]
     self.subprocs = []
     Tester.__init__(self, *args, **kwargs)
Example #18
0
 def __init__(self, *args, **kwargs):
     # Ignore these log patterns:
     self.ignore_log_patterns = [
         # This one occurs when trying to send the migration to a
         # node that hasn't started yet, and when it does, it gets
         # replayed and everything is fine.
         r'Can\'t send migration request: node.*is down',
         # This is caused by starting a node improperly (replacing active/nonexistent)
         r'Exception encountered during startup',
         # This is caused by trying to replace a nonexistent node
         r'Exception in thread Thread'
     ]
     Tester.__init__(self, *args, **kwargs)
Example #19
0
    def __init__(self, *args, **kwargs):
        # Ignore these log patterns:
        self.ignore_log_patterns = [
            # This one occurs if we do a non-rolling upgrade, the node
            # it's trying to send the migration to hasn't started yet,
            # and when it does, it gets replayed and everything is fine.
            r'Can\'t send migration request: node.*is down',
        ]

        # Force cluster options that are common among versions:
        kwargs['cluster_options'] = {'authenticator': 'PasswordAuthenticator',
                                     'authorizer': 'CassandraAuthorizer'}
        Tester.__init__(self, *args, **kwargs)
 def __init__(self, *args, **kwargs):
     # Ignore these log patterns:
     self.ignore_log_patterns = [
         # This one occurs when trying to send the migration to a
         # node that hasn't started yet, and when it does, it gets
         # replayed and everything is fine.
         r'Can\'t send migration request: node.*is down',
         # This is caused by starting a node improperly (replacing active/nonexistent)
         r'Exception encountered during startup',
         # This is caused by trying to replace a nonexistent node
         r'Exception in thread Thread'
     ]
     Tester.__init__(self, *args, **kwargs)
 def __init__(self, *args, **kwargs):
     kwargs["cluster_options"] = {"start_rpc": "true"}
     # Ignore these log patterns:
     self.ignore_log_patterns = [
         # This one occurs when trying to send the migration to a
         # node that hasn't started yet, and when it does, it gets
         # replayed and everything is fine.
         r"Can\'t send migration request: node.*is down",
         # ignore streaming error during bootstrap
         r"Exception encountered during startup",
         r"Streaming error occurred",
     ]
     Tester.__init__(self, *args, **kwargs)
 def __init__(self, *args, **kwargs):
     kwargs['cluster_options'] = {'start_rpc': 'true'}
     # Ignore these log patterns:
     self.ignore_log_patterns = [
         # This one occurs when trying to send the migration to a
         # node that hasn't started yet, and when it does, it gets
         # replayed and everything is fine.
         r'Can\'t send migration request: node.*is down',
         # ignore streaming error during bootstrap
         r'Exception encountered during startup',
         r'Streaming error occurred'
     ]
     Tester.__init__(self, *args, **kwargs)
 def __init__(self, *args, **kwargs):
     kwargs['cluster_options'] = {'start_rpc': 'true'}
     # Ignore these log patterns:
     self.ignore_log_patterns = [
         # This one occurs when trying to send the migration to a
         # node that hasn't started yet, and when it does, it gets
         # replayed and everything is fine.
         r'Can\'t send migration request: node.*is down',
         # ignore streaming error during bootstrap
         r'Exception encountered during startup',
         r'Streaming error occurred'
     ]
     Tester.__init__(self, *args, **kwargs)
Example #24
0
    def setUp(self):
        """
        Prepares a cluster for tests of the repair history tables by starting
        a 5-node cluster, then inserting 5000 values with RF=3.
        """

        Tester.setUp(self)
        self.cluster.populate(5).start(wait_for_binary_proto=True)
        self.node1 = self.cluster.nodelist()[0]
        self.session = self.patient_cql_connection(self.node1)

        self.node1.stress(stress_options=['write', 'n=5K', 'no-warmup', 'cl=ONE', '-schema', 'replication(factor=3)'])

        self.cluster.flush()
    def setUp(self):
        Tester.setUp(self)
        cluster = self.cluster
        cluster.schema_event_refresh_window = 0

        if cluster.version() >= '3.0':
            cluster.set_configuration_options({'enable_user_defined_functions': 'true',
                                               'enable_scripted_user_defined_functions': 'true'})
        elif cluster.version() >= '2.2':
            cluster.set_configuration_options({'enable_user_defined_functions': 'true'})
        cluster.populate(1).start()

        self.session = self.patient_cql_connection(cluster.nodelist()[0])
        self.create_ks(self.session, 'ks', 1)
Example #26
0
    def setUp(self):
        """
        Prepares a cluster for tests of the repair history tables by starting
        a 5-node cluster, then inserting 5000 values with RF=3.
        """

        Tester.setUp(self)
        self.cluster.populate(5).start(wait_for_binary_proto=True)
        self.node1 = self.cluster.nodelist()[0]
        self.session = self.patient_cql_connection(self.node1)

        self.node1.stress(stress_options=['write', 'n=5000', 'cl=ONE', '-schema', 'replication(factor=3)'])

        self.cluster.flush()
    def setUp(self):
        Tester.setUp(self)
        cluster = self.cluster
        cluster.schema_event_refresh_window = 0

        if cluster.version() >= '3.0':
            cluster.set_configuration_options({'enable_user_defined_functions': 'true',
                                               'enable_scripted_user_defined_functions': 'true'})
        elif cluster.version() >= '2.2':
            cluster.set_configuration_options({'enable_user_defined_functions': 'true'})
        cluster.populate(1).start()

        self.session = self.patient_cql_connection(cluster.nodelist()[0])
        self.create_ks(self.session, 'ks', 1)
Example #28
0
 def __init__(self, *args, **kwargs):
     # Ignore these log patterns:
     self.ignore_log_patterns = [
         # This one occurs if we do a non-rolling upgrade, the node
         # it's trying to send the migration to hasn't started yet,
         # and when it does, it gets replayed and everything is fine.
         r'Can\'t send migration request: node.*is down',
         r'RejectedExecutionException.*ThreadPoolExecutor has shut down',
         # Occurs due to test/ccm writing topo on down nodes
         r'Cannot update data center or rack from.*for live host',
         # Normal occurance. See CASSANDRA-12026. Likely won't be needed after C* 4.0.
         r'Unknown column cdc during deserialization',
     ]
     self.subprocs = []
     Tester.__init__(self, *args, **kwargs)
 def __init__(self, *args, **kwargs):
     kwargs['cluster_options'] = {'start_rpc': 'true'}
     self.replacement_node = None
     # Ignore these log patterns:
     self.ignore_log_patterns = [
         # This one occurs when trying to send the migration to a
         # node that hasn't started yet, and when it does, it gets
         # replayed and everything is fine.
         r'Can\'t send migration request: node.*is down',
         r'Migration task failed to complete',  # 10978
         # ignore streaming error during bootstrap
         r'Streaming error occurred',
         r'failed stream session'
     ]
     Tester.__init__(self, *args, **kwargs)
 def __init__(self, *args, **kwargs):
     # Ignore these log patterns:
     self.ignore_log_patterns = [
         # This one occurs if we do a non-rolling upgrade, the node
         # it's trying to send the migration to hasn't started yet,
         # and when it does, it gets replayed and everything is fine.
         r'Can\'t send migration request: node.*is down',
         r'RejectedExecutionException.*ThreadPoolExecutor has shut down',
         # Occurs due to test/ccm writing topo on down nodes
         r'Cannot update data center or rack from.*for live host',
         # Normal occurance. See CASSANDRA-12026. Likely won't be needed after C* 4.0.
         r'Unknown column cdc during deserialization',
     ]
     self.subprocs = []
     Tester.__init__(self, *args, **kwargs)
    def __init__(self, *args, **kwargs):
        self.ignore_log_patterns = [
            # This one occurs if we do a non-rolling upgrade, the node
            # it's trying to send the migration to hasn't started yet,
            # and when it does, it gets replayed and everything is fine.
            r'Can\'t send migration request: node.*is down',
        ]
        if CASSANDRA_VERSION_FROM_BUILD < '2.2':
            _known_teardown_race_error = (
                'ScheduledThreadPoolExecutor$ScheduledFutureTask@[0-9a-f]+ '
                'rejected from org.apache.cassandra.concurrent.DebuggableScheduledThreadPoolExecutor'
            )
            # don't alter ignore_log_patterns on the class, just the obj for this test
            self.ignore_log_patterns += [_known_teardown_race_error]

        Tester.__init__(self, *args, **kwargs)
    def __init__(self, *args, **kwargs):
        self.ignore_log_patterns = [
            # This one occurs if we do a non-rolling upgrade, the node
            # it's trying to send the migration to hasn't started yet,
            # and when it does, it gets replayed and everything is fine.
            r'Can\'t send migration request: node.*is down',
        ]
        if CASSANDRA_VERSION_FROM_BUILD < '2.2':
            _known_teardown_race_error = (
                'ScheduledThreadPoolExecutor$ScheduledFutureTask@[0-9a-f]+ '
                'rejected from org.apache.cassandra.concurrent.DebuggableScheduledThreadPoolExecutor'
            )
            # don't alter ignore_log_patterns on the class, just the obj for this test
            self.ignore_log_patterns += [_known_teardown_race_error]

        Tester.__init__(self, *args, **kwargs)
 def __init__(self, *args, **kwargs):
     kwargs['cluster_options'] = {'start_rpc': 'true'}
     # Ignore these log patterns:
     self.ignore_log_patterns = [
         # This one occurs when trying to send the migration to a
         # node that hasn't started yet, and when it does, it gets
         # replayed and everything is fine.
         r'Can\'t send migration request: node.*is down',
         # This is caused by starting a node improperly (replacing active/nonexistent)
         r'Exception encountered during startup',
         # This is caused by trying to replace a nonexistent node
         r'Exception in thread Thread',
         # ignore streaming error during bootstrap
         r'Streaming error occurred'
     ]
     Tester.__init__(self, *args, **kwargs)
     self.allow_log_errors = True
Example #34
0
    def setUp(self):
        Tester.setUp(self)
        self.cluster.populate(3).start(wait_for_binary_proto=True)
        self.node1 = self.cluster.nodelist()[0]
        self.node2 = self.cluster.nodelist()[1]
        self.node3 = self.cluster.nodelist()[2]
        self.session = self.patient_cql_connection(self.node1)

        cursor = self.patient_exclusive_cql_connection(self.node1)

        cursor.execute("CREATE KEYSPACE ks WITH replication = {'class': 'NetworkTopologyStrategy', 'datacenter1': 2}")
        cursor.execute("""
            CREATE TABLE ks.cf (
                key    int primary key,
                value  double,
                txt    text
            );
        """)
Example #35
0
    def setUp(self):
        Tester.setUp(self)
        self.cluster.populate(3).start(wait_for_binary_proto=True)
        self.node1 = self.cluster.nodelist()[0]
        self.node2 = self.cluster.nodelist()[1]
        self.node3 = self.cluster.nodelist()[2]
        self.session = self.patient_cql_connection(self.node1)

        session = self.patient_exclusive_cql_connection(self.node1)

        session.execute(
            "CREATE KEYSPACE ks WITH replication = {'class': 'NetworkTopologyStrategy', 'datacenter1': 2}"
        )
        session.execute("""
            CREATE TABLE ks.cf (
                key    int primary key,
                value  double,
                txt    text
            );
        """)
 def __init__(self, *args, **kwargs):
     self.subprocs = []
     Tester.__init__(self, *args, **kwargs)
 def __init__(self, *args, **kwargs):
     Tester.__init__(self, *args, **kwargs)
     self.lock = threading.Lock()
Example #38
0
 def __init__(self, *args, **kwargs):
     kwargs['cluster_options'] = {'start_rpc': 'true'}
     Tester.__init__(self, *args, **kwargs)
    def __init__(self, *args, **kwargs):
        Tester.__init__(self, *args, **kwargs)

        # Generate 1000 rows in memory so we can re-use the same ones over again:
        self.groups = ['group1', 'group2', 'group3', 'group4']
        self.rows = [(str(uuid.uuid1()), x, random.choice(self.groups)) for x in range(1000)]
Example #40
0
 def __init__(self, *args, **kwargs):
     Tester.__init__(self, *args, **kwargs)
 def __init__(self, *args, **kwargs):
     # Ignore these log patterns:
     self.ignore_log_patterns = [
         r'Can\'t send migration request: node.*is down',
     ]
     Tester.__init__(self, *args, **kwargs)
Example #42
0
 def setUp(self):
     Tester.setUp(self)
     # compaction test for version 2.2.2 and above relies on DEBUG log in debug.log
     self.cluster.set_log_level("DEBUG")
 def __init__(self, *args, **kwargs):
     kwargs["cluster_options"] = {"start_rpc": "true"}
     Tester.__init__(self, *args, **kwargs)
 def __init__(self, *args, **kwargs):
     # Forcing cluster version on purpose
     os.environ['CASSANDRA_VERSION'] = versions[0]
     # Force cluster options that are common among versions:
     kwargs['cluster_options'] = {'partitioner':'org.apache.cassandra.dht.RandomPartitioner'}
     Tester.__init__(self, *args, **kwargs)
Example #45
0
 def __init__(self, *argv, **kwargs):
     if self.jvm_args is None:
         self.jvm_args = []
     kwargs['cluster_options'] = {'start_rpc': True}
     Tester.__init__(self, *argv, **kwargs)
     self.allow_log_errors = True
 def setUp(self):
     Tester.setUp(self)
     # compaction test for version 2.2.2 and above relies on DEBUG log in debug.log
     self.cluster.set_log_level("DEBUG")
 def __init__(self, *args, **kwargs):
     Tester.__init__(self, *args, **kwargs)
     self.lock = threading.Lock()
Example #48
0
 def setUp(self):
     Tester.setUp(self)
     self.cluster.set_configuration_options(
         values={'hinted_handoff_enabled': False})
     self.cluster.populate(3).start(wait_for_binary_proto=True)
 def __init__(self, *argv, **kwargs):
     if self.jvm_args is None:
         self.jvm_args = []
     kwargs['cluster_options'] = {'start_rpc': True}
     Tester.__init__(self, *argv, **kwargs)
     self.allow_log_errors = True
 def setUp(self):
     Tester.setUp(self)
     self.cluster.set_configuration_options(values={'hinted_handoff_enabled': False})
     self.cluster.populate(3).start(wait_for_binary_proto=True)
 def __init__(self, *args, **kwargs):
     Tester.__init__(self, *args, **kwargs)
Example #52
0
 def __init__(self, *args, **kwargs):
     Tester.__init__(self, *args, **kwargs)
     self.ignore_log_patterns = ["Fatal exception during initialization",
                                 "Cannot start node if snitch's rack (.*) differs from previous rack (.*)",
                                 "Cannot update data center or rack"]
 def __init__(self, *args, **kwargs):
     self.subprocs = []
     Tester.__init__(self, *args, **kwargs)
Example #54
0
 def setUp(self):
     Tester.setUp(self)
     self.cluster.populate(3).start(wait_for_binary_proto=True)