This is an automated email from the ASF dual-hosted git repository.

mck pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cassandra-dtest.git


The following commit(s) were added to refs/heads/master by this push:
     new 92385ca  upgrade jolokia agent to 1.6.2 and drop 
remove_perf_disable_shared_mem workaround
92385ca is described below

commit 92385ca4e8392bec5247af58f274491673ea0036
Author: Christopher Lambert <[email protected]>
AuthorDate: Thu Sep 24 09:17:05 2020 +0200

    upgrade jolokia agent to 1.6.2 and drop remove_perf_disable_shared_mem 
workaround
    
    https://github.com/rhuss/jolokia/issues/198 has been fixed since jolokia 
1.3.7,
    so there is no reason to keep the remove_perf_disable_shared_mem workaround 
anymore.
    It is assumed that the '-XX:-PerfDisableSharedMem' usage was added 
exclusively for
    jolokia as well.
    
    patch by Christopher Lambert; reviewed by Mick Semb Wever
---
 README.md                                          |   2 --
 auth_test.py                                       |   4 +---
 batch_test.py                                      |   9 +-------
 configuration_test.py                              |   7 +-----
 consistency_test.py                                |   3 +--
 cql_tracing_test.py                                |   3 +--
 deletion_test.py                                   |   7 +-----
 disk_balance_test.py                               |   4 +---
 dtest_setup.py                                     |   1 -
 jmx_test.py                                        |   7 +-----
 lib/jolokia-jvm-1.2.3-agent.jar                    | Bin 395172 -> 0 bytes
 lib/jolokia-jvm-1.6.2-agent.jar                    | Bin 0 -> 465081 bytes
 ...ent.jar.txt => jolokia-jvm-1.6.2-agent.jar.txt} |   0
 materialized_views_test.py                         |   5 +----
 nodetool_test.py                                   |   3 +--
 repair_tests/deprecated_repair_test.py             |   4 +---
 repair_tests/incremental_repair_test.py            |   3 +--
 snitch_test.py                                     |   5 +----
 thrift_hsha_test.py                                |   3 +--
 tools/jmxutils.py                                  |  24 +--------------------
 upgrade_tests/regression_test.py                   |   2 +-
 upgrade_tests/upgrade_base.py                      |   9 --------
 22 files changed, 16 insertions(+), 89 deletions(-)

diff --git a/README.md b/README.md
index 4e64587..3333219 100644
--- a/README.md
+++ b/README.md
@@ -101,8 +101,6 @@ JAVA7_HOME and JAVA8_HOME, respectively.
 Writing Tests
 -------------
 
-- If you're using JMX via [the `tools.jmxutils` module](tools/jmxutils.py), 
make sure to call `remove_perf_disable_shared_mem` on the node or nodes you 
want to query with JMX _before starting the nodes_. 
`remove_perf_disable_shared_mem` disables a JVM option that's incompatible with 
JMX (see [this JMX ticket](https://github.com/rhuss/jolokia/issues/198)). It 
works by performing a string replacement in the node's Cassandra startup 
script, so changes will only propagate to the node at star [...]
-
 If you'd like to know what to expect during a code review, please see the 
included [CONTRIBUTING file](CONTRIBUTING.md).
 
 Debugging Tests
diff --git a/auth_test.py b/auth_test.py
index 4f12175..1061b17 100644
--- a/auth_test.py
+++ b/auth_test.py
@@ -17,8 +17,7 @@ from dtest import Tester
 from tools.assertions import (assert_all, assert_exception, assert_invalid,
                               assert_length_equal, assert_one,
                               assert_unauthorized)
-from tools.jmxutils import (JolokiaAgent, make_mbean,
-                            remove_perf_disable_shared_mem)
+from tools.jmxutils import (JolokiaAgent, make_mbean)
 from tools.metadata_wrapper import UpdatingKeyspaceMetadataWrapper
 from tools.misc import ImmutableMapping
 
@@ -1056,7 +1055,6 @@ class TestAuth(Tester):
         cluster.set_datadir_count(1)
         cluster.populate(1)
         [node] = cluster.nodelist()
-        remove_perf_disable_shared_mem(node)
         cluster.start()
 
         with JolokiaAgent(node) as jmx:
diff --git a/batch_test.py b/batch_test.py
index f10b78a..4091974 100644
--- a/batch_test.py
+++ b/batch_test.py
@@ -9,8 +9,7 @@ from cassandra.query import SimpleStatement
 from dtest import Tester, create_ks
 from tools.assertions import (assert_all, assert_invalid, assert_one,
                               assert_unavailable)
-from tools.jmxutils import (JolokiaAgent, make_mbean,
-                            remove_perf_disable_shared_mem)
+from tools.jmxutils import (JolokiaAgent, make_mbean)
 
 since = pytest.mark.since
 logger = logging.getLogger(__name__)
@@ -438,10 +437,6 @@ class TestBatch(Tester):
             logger.debug("Set cassandra dir to 
{}".format(self.cluster.get_install_dir()))
 
         self.cluster.populate(nodes, install_byteman=install_byteman)
-
-        for n in self.cluster.nodelist():
-            remove_perf_disable_shared_mem(n)
-
         self.cluster.start()
 
         node1 = self.cluster.nodelist()[0]
@@ -501,8 +496,6 @@ class TestBatch(Tester):
         node.stop(wait_other_notice=False)
         self.set_node_to_current_version(node)
         logger.debug("Set cassandra dir for {} to {}".format(node.name, 
node.get_install_dir()))
-        # needed for jmx
-        remove_perf_disable_shared_mem(node)
         # Restart nodes on new version
         logger.debug('Starting {} on new version ({})'.format(node.name, 
node.get_cassandra_version()))
         node.start(wait_for_binary_proto=True, 
jvm_args=['-Dcassandra.disable_max_protocol_auto_override=true'])
diff --git a/configuration_test.py b/configuration_test.py
index 5ae98f1..ad875cb 100644
--- a/configuration_test.py
+++ b/configuration_test.py
@@ -8,8 +8,7 @@ from cassandra.concurrent import execute_concurrent_with_args
 from tools.misc import ImmutableMapping
 from dtest_setup_overrides import DTestSetupOverrides
 from dtest import Tester, create_ks
-from tools.jmxutils import (JolokiaAgent, make_mbean,
-                            remove_perf_disable_shared_mem)
+from tools.jmxutils import (JolokiaAgent, make_mbean)
 
 logger = logging.getLogger(__name__)
 
@@ -72,9 +71,6 @@ class TestConfiguration(Tester):
             node = self.fixture_dtest_setup.cluster.nodelist()[0]
             self.fixture_dtest_setup.cluster.set_batch_commitlog(enabled=True)
 
-            # disable JVM option so we can use Jolokia
-            # this has to happen after .set_configuration_options because of 
implementation details
-            remove_perf_disable_shared_mem(node)
             self.fixture_dtest_setup.cluster.start()
             return node
 
@@ -116,7 +112,6 @@ class TestConfiguration(Tester):
         node1 = self.cluster.nodelist()[0]
         default_path = node1.data_directories()[0]
         node1.set_configuration_options({'saved_caches_directory': 
os.path.join(default_path, 'saved_caches')})
-        remove_perf_disable_shared_mem(node1)
         self.cluster.start()
 
         session = self.patient_exclusive_cql_connection(node1)
diff --git a/consistency_test.py b/consistency_test.py
index 1ee183f..493526b 100644
--- a/consistency_test.py
+++ b/consistency_test.py
@@ -15,7 +15,7 @@ from tools.assertions import (assert_all, 
assert_length_equal, assert_none,
 from dtest import MultiError, Tester, create_ks, create_cf
 from tools.data import (create_c1c2_table, insert_c1c2, insert_columns,
                         query_c1c2, rows_to_list)
-from tools.jmxutils import JolokiaAgent, make_mbean, 
remove_perf_disable_shared_mem
+from tools.jmxutils import JolokiaAgent, make_mbean
 
 since = pytest.mark.since
 logger = logging.getLogger(__name__)
@@ -1231,7 +1231,6 @@ class TestConsistency(Tester):
 
         cluster.populate(2)
         node1, node2 = cluster.nodelist()
-        remove_perf_disable_shared_mem(node1)  # necessary for jmx
         cluster.start()
 
         session = self.patient_cql_connection(node1)
diff --git a/cql_tracing_test.py b/cql_tracing_test.py
index da4414d..ca5c1b1 100644
--- a/cql_tracing_test.py
+++ b/cql_tracing_test.py
@@ -4,7 +4,7 @@ import logging
 from distutils.version import LooseVersion
 
 from dtest import Tester, create_ks
-from tools.jmxutils import make_mbean, JolokiaAgent, 
remove_perf_disable_shared_mem
+from tools.jmxutils import make_mbean, JolokiaAgent
 
 since = pytest.mark.since
 logger = logging.getLogger(__name__)
@@ -37,7 +37,6 @@ class TestCqlTracing(Tester):
 
         cluster.populate(nodes)
         node1 = cluster.nodelist()[0]
-        remove_perf_disable_shared_mem(node1)  # necessary for jmx
         cluster.start(jvm_args=jvm_args)
 
         session = self.patient_cql_connection(node1, 
protocol_version=protocol_version)
diff --git a/deletion_test.py b/deletion_test.py
index 88ca6cf..42c27e3 100644
--- a/deletion_test.py
+++ b/deletion_test.py
@@ -3,8 +3,7 @@ import logging
 
 from dtest import Tester, create_ks, create_cf
 from tools.data import rows_to_list
-from tools.jmxutils import (JolokiaAgent, make_mbean,
-                            remove_perf_disable_shared_mem)
+from tools.jmxutils import (JolokiaAgent, make_mbean)
 
 logger = logging.getLogger(__name__)
 
@@ -47,10 +46,6 @@ class TestDeletion(Tester):
 
     def test_tombstone_size(self):
         self.cluster.populate(1)
-        node1 = self.cluster.nodelist()[0]
-
-        remove_perf_disable_shared_mem(node1)
-
         self.cluster.start()
         [node1] = self.cluster.nodelist()
         session = self.patient_cql_connection(node1)
diff --git a/disk_balance_test.py b/disk_balance_test.py
index 6238f03..3d02ac1 100644
--- a/disk_balance_test.py
+++ b/disk_balance_test.py
@@ -9,8 +9,7 @@ from ccmlib.node import Node
 from dtest import Tester, create_ks
 from tools.assertions import assert_almost_equal
 from tools.data import create_c1c2_table, insert_c1c2, query_c1c2
-from tools.jmxutils import (JolokiaAgent, make_mbean,
-                            remove_perf_disable_shared_mem)
+from tools.jmxutils import (JolokiaAgent, make_mbean)
 from tools.misc import new_node
 from compaction_test import grep_sstables_in_each_level
 
@@ -127,7 +126,6 @@ class TestDiskBalance(Tester):
         cluster.set_datadir_count(3)
         cluster.populate(1)
         [node] = cluster.nodelist()
-        remove_perf_disable_shared_mem(node)
         cluster.start()
 
         session = self.patient_cql_connection(node)
diff --git a/dtest_setup.py b/dtest_setup.py
index 5688604..8cae7d1 100644
--- a/dtest_setup.py
+++ b/dtest_setup.py
@@ -65,7 +65,6 @@ class DTestSetup(object):
 
         self.last_log = os.path.join(self.log_saved_dir, "last")
         self.test_path = self.get_test_path()
-        self.enable_for_jolokia = False
         self.subprocs = []
         self.log_watch_thread = None
         self.last_test_dir = "last_test_dir"
diff --git a/jmx_test.py b/jmx_test.py
index dd90da6..f0661c5 100644
--- a/jmx_test.py
+++ b/jmx_test.py
@@ -11,8 +11,7 @@ from ccmlib.node import ToolError
 from distutils.version import LooseVersion
 
 from dtest import Tester
-from tools.jmxutils import (JolokiaAgent, enable_jmx_ssl, make_mbean,
-                            remove_perf_disable_shared_mem)
+from tools.jmxutils import (JolokiaAgent, enable_jmx_ssl, make_mbean)
 from tools.misc import generate_ssl_stores
 
 since = pytest.mark.since
@@ -72,7 +71,6 @@ class TestJMX(Tester):
         cluster = self.cluster
         cluster.populate(3)
         node1, node2, node3 = cluster.nodelist()
-        remove_perf_disable_shared_mem(node1)
         cluster.start()
 
         version = cluster.version()
@@ -113,7 +111,6 @@ class TestJMX(Tester):
         cluster.set_configuration_options({'enable_materialized_views': 
'true'})
         cluster.populate(1)
         node = cluster.nodelist()[0]
-        remove_perf_disable_shared_mem(node)
         cluster.start()
 
         node.run_cqlsh(cmds="""
@@ -187,7 +184,6 @@ class TestJMX(Tester):
         cluster = self.cluster
         cluster.populate(1)
         node = cluster.nodelist()[0]
-        remove_perf_disable_shared_mem(node)
         cluster.start()
 
         # Run a quick stress command to create the keyspace and table
@@ -282,7 +278,6 @@ class TestJMX(Tester):
         cluster = self.cluster
         cluster.populate(2)
         node = cluster.nodelist()[0]
-        remove_perf_disable_shared_mem(node)
         cluster.start()
 
         # Set and get throttle with JMX, ensuring that the rate change is 
logged
diff --git a/lib/jolokia-jvm-1.2.3-agent.jar b/lib/jolokia-jvm-1.2.3-agent.jar
deleted file mode 100644
index 4ed8498..0000000
Binary files a/lib/jolokia-jvm-1.2.3-agent.jar and /dev/null differ
diff --git a/lib/jolokia-jvm-1.6.2-agent.jar b/lib/jolokia-jvm-1.6.2-agent.jar
new file mode 100644
index 0000000..68ee3e8
Binary files /dev/null and b/lib/jolokia-jvm-1.6.2-agent.jar differ
diff --git a/lib/jolokia-jvm-1.2.3-agent.jar.txt 
b/lib/jolokia-jvm-1.6.2-agent.jar.txt
similarity index 100%
rename from lib/jolokia-jvm-1.2.3-agent.jar.txt
rename to lib/jolokia-jvm-1.6.2-agent.jar.txt
diff --git a/materialized_views_test.py b/materialized_views_test.py
index 60b49a5..625a697 100644
--- a/materialized_views_test.py
+++ b/materialized_views_test.py
@@ -26,7 +26,7 @@ from tools.assertions import (assert_all, 
assert_crc_check_chance_equal,
                               assert_unavailable)
 from tools.data import rows_to_list
 from tools.misc import new_node
-from tools.jmxutils import (JolokiaAgent, make_mbean, 
remove_perf_disable_shared_mem)
+from tools.jmxutils import (JolokiaAgent, make_mbean)
 
 since = pytest.mark.since
 logger = logging.getLogger(__name__)
@@ -2881,9 +2881,6 @@ class TestMaterializedViewsLockcontention(Tester):
             'concurrent_writes': 1,
         })
         self.nodes = list(self.cluster.nodes.values())
-        for node in self.nodes:
-            remove_perf_disable_shared_mem(node)
-
         self.cluster.start(jvm_args=[
             "-Dcassandra.test.fail_mv_locks_count=64"
         ])
diff --git a/nodetool_test.py b/nodetool_test.py
index abbf0bc..09e1dff 100644
--- a/nodetool_test.py
+++ b/nodetool_test.py
@@ -9,7 +9,7 @@ from ccmlib.node import ToolError
 
 from dtest import Tester, create_ks
 from tools.assertions import assert_all, assert_invalid, assert_none
-from tools.jmxutils import JolokiaAgent, make_mbean, 
remove_perf_disable_shared_mem
+from tools.jmxutils import JolokiaAgent, make_mbean
 
 since = pytest.mark.since
 logger = logging.getLogger(__name__)
@@ -254,7 +254,6 @@ class TestNodetool(Tester):
         cluster = self.cluster
         cluster.populate(1)
         node = cluster.nodelist()[0]
-        remove_perf_disable_shared_mem(node)  # for jmx
         cluster.start()
 
         session = self.patient_cql_connection(node)
diff --git a/repair_tests/deprecated_repair_test.py 
b/repair_tests/deprecated_repair_test.py
index fbeceb3..a411a12 100644
--- a/repair_tests/deprecated_repair_test.py
+++ b/repair_tests/deprecated_repair_test.py
@@ -13,8 +13,7 @@ import ccmlib.repository
 from dtest import Tester, create_ks, create_cf
 from tools.assertions import assert_length_equal
 from tools.data import insert_c1c2
-from tools.jmxutils import (JolokiaAgent, make_mbean,
-                            remove_perf_disable_shared_mem)
+from tools.jmxutils import (JolokiaAgent, make_mbean)
 
 since = pytest.mark.since
 logger = logging.getLogger(__name__)
@@ -147,7 +146,6 @@ class TestDeprecatedRepairAPI(Tester):
         logger.debug("Starting cluster..")
         cluster.populate([1, 1])
         node1, node2 = cluster.nodelist()
-        remove_perf_disable_shared_mem(node1)
         cluster.start()
         supports_pull_repair = cluster.version() >= LooseVersion('3.10')
 
diff --git a/repair_tests/incremental_repair_test.py 
b/repair_tests/incremental_repair_test.py
index 9cd8c75..9de303f 100644
--- a/repair_tests/incremental_repair_test.py
+++ b/repair_tests/incremental_repair_test.py
@@ -18,7 +18,7 @@ from dtest import Tester, create_ks, create_cf
 from tools.assertions import assert_almost_equal, assert_one
 from tools.data import insert_c1c2
 from tools.misc import new_node, ImmutableMapping
-from tools.jmxutils import make_mbean, JolokiaAgent, 
remove_perf_disable_shared_mem
+from tools.jmxutils import make_mbean, JolokiaAgent
 
 since = pytest.mark.since
 logger = logging.getLogger(__name__)
@@ -1077,7 +1077,6 @@ class TestIncRepair(Tester):
         self.init_default_config()
         self.cluster.populate(2)
         node1, node2 = self.cluster.nodelist()
-        remove_perf_disable_shared_mem(node1)  # necessary for jmx
         self.cluster.start()
 
         session = self.patient_exclusive_cql_connection(node1)
diff --git a/snitch_test.py b/snitch_test.py
index 33bae7a..7c08d0e 100644
--- a/snitch_test.py
+++ b/snitch_test.py
@@ -6,8 +6,7 @@ import logging
 
 from cassandra import ConsistencyLevel
 from dtest import Tester
-from tools.jmxutils import (JolokiaAgent, make_mbean,
-                            remove_perf_disable_shared_mem)
+from tools.jmxutils import (JolokiaAgent, make_mbean)
 
 since = pytest.mark.since
 logger = logging.getLogger(__name__)
@@ -159,8 +158,6 @@ class TestDynamicEndpointSnitch(Tester):
         
cluster.set_configuration_options(values={'dynamic_snitch_reset_interval_in_ms':
 10000,
                                                   
'dynamic_snitch_update_interval_in_ms': 50,
                                                   'phi_convict_threshold': 12})
-        remove_perf_disable_shared_mem(coordinator_node)
-        remove_perf_disable_shared_mem(degraded_node)
         # Delay reads on the degraded node by 50 milliseconds
         
degraded_node.start(jvm_args=['-Dcassandra.test.read_iteration_delay_ms=50',
                                       '-Dcassandra.allow_unsafe_join=true'])
diff --git a/thrift_hsha_test.py b/thrift_hsha_test.py
index 3d1e364..94d0b1d 100644
--- a/thrift_hsha_test.py
+++ b/thrift_hsha_test.py
@@ -9,7 +9,7 @@ import logging
 
 from dtest import DEFAULT_DIR, Tester, create_ks
 from thrift_test import get_thrift_client
-from tools.jmxutils import JolokiaAgent, make_mbean, 
remove_perf_disable_shared_mem
+from tools.jmxutils import JolokiaAgent, make_mbean
 
 since = pytest.mark.since
 logger = logging.getLogger(__name__)
@@ -48,7 +48,6 @@ class TestThriftHSHA(Tester):
 
         cluster.populate(1)
         (node1,) = cluster.nodelist()
-        remove_perf_disable_shared_mem(node1)
         cluster.start()
 
         session = self.patient_cql_connection(node1)
diff --git a/tools/jmxutils.py b/tools/jmxutils.py
index 6986129..165fa0d 100644
--- a/tools/jmxutils.py
+++ b/tools/jmxutils.py
@@ -1,4 +1,3 @@
-import glob
 import json
 import os
 import subprocess
@@ -8,11 +7,9 @@ import logging
 
 import ccmlib.common as common
 
-from distutils.version import LooseVersion
-
 logger = logging.getLogger(__name__)
 
-JOLOKIA_JAR = os.path.join('lib', 'jolokia-jvm-1.2.3-agent.jar')
+JOLOKIA_JAR = os.path.join('lib', 'jolokia-jvm-1.6.2-agent.jar')
 CLASSPATH_SEP = ';' if common.is_win() else ':'
 
 
@@ -155,25 +152,6 @@ def apply_jmx_authentication(node):
     common.replaces_in_file(node.envfilename(), replacement_list)
 
 
-def remove_perf_disable_shared_mem(node):
-    """
-    The Jolokia agent is incompatible with the -XX:+PerfDisableSharedMem JVM
-    option (see https://github.com/rhuss/jolokia/issues/198 for details).  This
-    edits cassandra-env.sh (or the Windows equivalent), or jvm.options file on 
3.2+ to remove that option.
-    """
-    if node.get_cassandra_version() >= LooseVersion('3.2'):
-        pattern = r'\-XX:\+PerfDisableSharedMem'
-        replacement = '#-XX:+PerfDisableSharedMem'
-        for f in glob.glob(os.path.join(node.get_conf_dir(), 
common.JVM_OPTS_PATTERN)):
-            if os.path.isfile(f):
-                common.replace_in_file(f, pattern, replacement)
-    else:
-        conf_file = node.envfilename()
-        pattern = 'PerfDisableSharedMem'
-        replacement = ''
-        common.replace_in_file(conf_file, pattern, replacement)
-
-
 class JolokiaAgent(object):
     """
     This class provides a simple way to read, write, and execute
diff --git a/upgrade_tests/regression_test.py b/upgrade_tests/regression_test.py
index ae101ec..138774f 100644
--- a/upgrade_tests/regression_test.py
+++ b/upgrade_tests/regression_test.py
@@ -80,7 +80,7 @@ class TestForRegressions(UpgradeTester):
         """
         cluster = self.cluster
         cluster.set_datadir_count(1)  # we want the same prefix for all 
sstables
-        session = self.prepare(jolokia=True)
+        session = self.prepare()
         session.execute("CREATE KEYSPACE test13294 WITH 
replication={'class':'SimpleStrategy', 'replication_factor': 2};")
         session.execute("CREATE TABLE test13294.t (id int PRIMARY KEY, d int) 
WITH compaction = {'class': 'SizeTieredCompactionStrategy','enabled':'false'}")
         for x in range(0, 5):
diff --git a/upgrade_tests/upgrade_base.py b/upgrade_tests/upgrade_base.py
index 057bd6a..62a06ea 100644
--- a/upgrade_tests/upgrade_base.py
+++ b/upgrade_tests/upgrade_base.py
@@ -7,7 +7,6 @@ import logging
 from abc import ABCMeta
 
 from ccmlib.common import get_version_from_build, is_win
-from tools.jmxutils import remove_perf_disable_shared_mem
 
 from dtest import Tester, create_ks
 
@@ -124,11 +123,6 @@ class UpgradeTester(Tester, metaclass=ABCMeta):
             cluster.set_configuration_options(values=extra_config_options)
 
         cluster.populate(nodes)
-        node1 = cluster.nodelist()[0]
-        self.fixture_dtest_setup.enable_for_jolokia = kwargs.pop('jolokia', 
False)
-        if self.fixture_dtest_setup.enable_for_jolokia:
-            remove_perf_disable_shared_mem(node1)
-
         cluster.start()
 
         node1 = cluster.nodelist()[0]
@@ -193,9 +187,6 @@ class UpgradeTester(Tester, metaclass=ABCMeta):
         if use_thrift and node1.get_cassandra_version() < '4':
             node1.set_configuration_options(values={'start_rpc': 'true'})
 
-        if self.fixture_dtest_setup.enable_for_jolokia:
-            remove_perf_disable_shared_mem(node1)
-
         node1.start(wait_for_binary_proto=True)
 
         sessions_and_meta = []


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to