[ https://issues.apache.org/jira/browse/CASSANDRA-14667?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17703962#comment-17703962 ]
Stefan Miklosovic edited comment on CASSANDRA-14667 at 3/23/23 8:51 AM: ------------------------------------------------------------------------ Ahaa I know what is going on ... the Java driver we use for tests itself uses Dropwizard of a different version we just stopped to use and imports are different suddenly. driver we are using, of version 3.11.0, uses <metrics.version>3.2.2</metrics.version> in https://central.sonatype.com/artifact/com.datastax.cassandra/cassandra-driver-parent/3.11.0 This parent https://central.sonatype.com/artifact/com.datastax.oss/java-driver-parent/4.15.0 uses metrics <metrics.version>4.1.18</metrics.version> However, what we could do is to do this: {code} try (com.datastax.driver.core.Cluster c = com.datastax.driver.core.Cluster.builder() .withoutMetrics() .addContactPoint("127.0.0.1").build(); {code} Do you see that ".withoutMetrics()" method? Once there, the test passes (e.g. tests extending AbstractNetstatsStreaming, modified populateData and changeReplicationFactor methods). So, we either put this "withoutMetrics()" everywhere where we are building Cluster, or we update the project to use Cassandra driver 4 (that is pretty challenging!) I am not completely sure if we use these "metrics" via driver, I do not think so but should be double checked. I think that for the sake of tests we do not need them at all. The draft where I tried to fix it is here (1). [~mmuzaf] feel free to take and build on top of this. Build is being run here (2) but today Jenkins is somehow sluggish, lets see what it builds if anything. I noticed that this would need to be turned off for tooling as well. E.g. FQL replayer is doing some CQL stuff so we would need to turn this off explicitly there as well. JavaDriverClient used for Stress tool uses "withoutMetrics()" already. This seems like a known issue we can circumvent like this for tools. One consequence of putting Cluster.builder().withoutMetrics() everywhere is that people would need to set it like that every single time they want to build Cluster. This is quite error-prone. One solution would be to introduce a checkstyle rule that "Cluster.builder()" can be called only in some helper method, nowhere else (plus some toolings) and that helper method would contain "Cluster.builder().withoutMetrics()" on it. The result is that people would be forced to use this method where "withoutMetrics" is so they could not miss that. (1) https://github.com/apache/cassandra/pull/2240 (2) https://ci-cassandra.apache.org/view/patches/job/Cassandra-devbranch/2383/ was (Author: smiklosovic): Ahaa I know what is going on ... the Java driver we use for tests itself uses Dropwizard of a different version we just stopped to use and imports are different suddenly. driver we are using, of version 3.11.0, uses <metrics.version>3.2.2</metrics.version> in https://central.sonatype.com/artifact/com.datastax.cassandra/cassandra-driver-parent/3.11.0 This parent https://central.sonatype.com/artifact/com.datastax.oss/java-driver-parent/4.15.0 uses metrics <metrics.version>4.1.18</metrics.version> However, what we could do is to do this: {code} try (com.datastax.driver.core.Cluster c = com.datastax.driver.core.Cluster.builder() .withoutMetrics() .addContactPoint("127.0.0.1").build(); {code} Do you see that ".withoutMetrics()" method? Once there, the test passes (e.g. tests extending AbstractNetstatsStreaming, modified populateData and changeReplicationFactor methods). So, we either put this "withoutMetrics()" everywhere where we are building Cluster, or we update the project to use Cassandra driver 4 (that is pretty challenging!) I am not completely sure if we use these "metrics" via driver, I do not think so but should be double checked. I think that for the sake of tests we do not need them at all. The draft where I tried to fix it is here (1). [~mmuzaf] feel free to take and build on top of this. Build is being run here (2) but today Jenkins is somehow sluggish, lets see what it builds if anything. I noticed that this would need to be turned off for tooling as well. E.g. FQL replayer is doing some CQL stuff so we would need to turn this off explicitly there as well. One consequence of putting Cluster.builder().withoutMetrics() everywhere is that people would need to set it like that every single time they want to build Cluster. This is quite error-prone. One solution would be to introduce a checkstyle rule that "Cluster.builder()" can be called only in some helper method, nowhere else (plus some toolings) and that helper method would contain "Cluster.builder().withoutMetrics()" on it. The result is that people would be forced to use this method where "withoutMetrics" is so they could not miss that. (1) https://github.com/apache/cassandra/pull/2240 (2) https://ci-cassandra.apache.org/view/patches/job/Cassandra-devbranch/2383/ > Upgrade Dropwizard Metrics to 4.x > --------------------------------- > > Key: CASSANDRA-14667 > URL: https://issues.apache.org/jira/browse/CASSANDRA-14667 > Project: Cassandra > Issue Type: Task > Components: Observability/Metrics > Reporter: Stig Rohde Døssing > Assignee: Maxim Muzafarov > Priority: Normal > Fix For: 5.x > > Time Spent: 20m > Remaining Estimate: 0h > > Cassandra currently uses Metrics 3.1.5. Version 4.0.0 added some fixes for > Java 9 compatibility. It would be good to upgrade the Metrics library as part > of the version of Cassandra that adds Java 9 compatibility > (https://issues.apache.org/jira/browse/CASSANDRA-9608). -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org