Esempio n. 1
0
    def test_parse_config_tuning_level_unsafe(self, mog, config, mem):
        mem.return_value = "512M"
        config.return_value = {
            'tuning-level': 'unsafe',
        }

        helper = mysql.PerconaClusterHelper()
        mysql_config = helper.parse_config()

        self.assertEqual(mysql_config.get('innodb_flush_log_at_trx_commit'), 0)
Esempio n. 2
0
    def test_parse_config_innodb_pool_fixed(self, log, config, mem):
        mem.return_value = "100G"
        config.return_value = {
            'innodb-buffer-pool-size': "50%",
        }

        helper = mysql.PerconaClusterHelper()
        mysql_config = helper.parse_config()

        self.assertEqual(mysql_config.get('innodb_buffer_pool_size'),
                         helper.human_to_bytes("50G"))
Esempio n. 3
0
    def test_parse_config_innodb_invalid_values(self, mog, config, mem):
        mem.return_value = "512M"
        config.return_value = {
            'innodb-change-buffering': 'invalid',
        }

        helper = mysql.PerconaClusterHelper()
        mysql_config = helper.parse_config()

        self.assertTrue('innodb_change_buffering' not in mysql_config)
        self.assertTrue('innodb_io_capacity' not in mysql_config)
Esempio n. 4
0
    def test_parse_config_innodb_dataset_size(self, mog, config, mem):
        mem.return_value = "100G"
        config.return_value = {
            'dataset-size': "10G",
        }

        helper = mysql.PerconaClusterHelper()
        mysql_config = helper.parse_config()

        self.assertEqual(mysql_config.get('innodb_buffer_pool_size'),
                         int(helper.human_to_bytes("10G")))
Esempio n. 5
0
    def test_parse_config_innodb_pool_not_set(self, mog, config, mem):
        mem.return_value = "100G"
        config.return_value = {
            'innodb-buffer-pool-size': '',
        }

        helper = mysql.PerconaClusterHelper()
        mysql_config = helper.parse_config()

        self.assertEqual(mysql_config.get('innodb_buffer_pool_size'),
                         helper.DEFAULT_INNODB_BUFFER_SIZE_MAX)
Esempio n. 6
0
    def test_parse_config_wait_timeout(self, mog, config, mem):
        mem.return_value = "100G"

        timeout = 314
        config.return_value = {
            'wait-timeout': timeout,
        }

        helper = mysql.PerconaClusterHelper()
        mysql_config = helper.parse_config()

        self.assertEqual(mysql_config.get('wait_timeout'), timeout)
Esempio n. 7
0
    def test_parse_config_innodb_valid_values(self, mog, config, mem):
        mem.return_value = "512M"
        config.return_value = {
            'innodb-change-buffering': 'all',
            'innodb-io-capacity': 100,
        }

        helper = mysql.PerconaClusterHelper()
        mysql_config = helper.parse_config()

        self.assertEqual(mysql_config.get('innodb_change_buffering'), 'all')

        self.assertEqual(mysql_config.get('innodb_io_capacity'), 100)
Esempio n. 8
0
    def test_parse_config_innodb_buffer_unset_small(self, mog, mem):
        mem.return_value = "512M"
        self.config_data = {
            'innodb-buffer-pool-size': None,
            'dataset-size': None,
        }

        helper = mysql.PerconaClusterHelper()
        mysql_config = helper.parse_config()

        self.assertEqual(
            mysql_config.get('innodb_buffer_pool_size'),
            int(helper.human_to_bytes(mem.return_value) *
                helper.DEFAULT_INNODB_BUFFER_FACTOR))