Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into scylla-4.x-merge-4.18.1

Changes skipped as part of conflict resolution:
 - We do not set `<jvm>${testing.jvm}/bin/java</jvm>` in surefire configuration,
 - CCMBridge: We do not override java version for specific DSE workloads
 - CCMBridge: Generally resolved a lot of sections in favor of our changes.
   Translation of old Cassandra configs into newer Cassandra configs was skipped.
   It seems it was needed for testing upstream against Cassandra 4.1.x.
   Our CI seems not to report any issues when running against those versions.

Other changes:
 - Set the version to 4.18.1.0-SNAPSHOT
 - Changed our usages of `AttributeKey.newInstance(String)` to `.valueOf(String)`
   Same as in upstream's 4c7133c
  • Loading branch information
Bouncheck committed Feb 18, 2025
2 parents 663064f + cbdde28 commit dbf4224
Show file tree
Hide file tree
Showing 51 changed files with 1,328 additions and 159 deletions.
60 changes: 35 additions & 25 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,6 @@ def initializeEnvironment() {
. ${JABBA_SHELL}
jabba which 1.8''', returnStdout: true).trim()

env.TEST_JAVA_HOME = sh(label: 'Get TEST_JAVA_HOME',script: '''#!/bin/bash -le
. ${JABBA_SHELL}
jabba which ${JABBA_VERSION}''', returnStdout: true).trim()
env.TEST_JAVA_VERSION = sh(label: 'Get TEST_JAVA_VERSION',script: '''#!/bin/bash -le
echo "${JABBA_VERSION##*.}"''', returnStdout: true).trim()

sh label: 'Download Apache CassandraⓇ or DataStax Enterprise',script: '''#!/bin/bash -le
. ${JABBA_SHELL}
jabba use 1.8
Expand Down Expand Up @@ -104,18 +98,25 @@ ENVIRONMENT_EOF
}

def buildDriver(jabbaVersion) {
withEnv(["BUILD_JABBA_VERSION=${jabbaVersion}"]) {
sh label: 'Build driver', script: '''#!/bin/bash -le
. ${JABBA_SHELL}
jabba use ${BUILD_JABBA_VERSION}
def buildDriverScript = '''#!/bin/bash -le
mvn -B -V install -DskipTests -Dmaven.javadoc.skip=true
'''
}
. ${JABBA_SHELL}
jabba use '''+jabbaVersion+'''
echo "Building with Java version '''+jabbaVersion+'''"
mvn -B -V install -DskipTests -Dmaven.javadoc.skip=true
'''
sh label: 'Build driver', script: buildDriverScript
}

def executeTests() {
sh label: 'Execute tests', script: '''#!/bin/bash -le
def testJavaHome = sh(label: 'Get TEST_JAVA_HOME',script: '''#!/bin/bash -le
. ${JABBA_SHELL}
jabba which ${JABBA_VERSION}''', returnStdout: true).trim()
def testJavaVersion = (JABBA_VERSION =~ /.*\.(\d+)/)[0][1]

def executeTestScript = '''#!/bin/bash -le
# Load CCM environment variables
set -o allexport
. ${HOME}/environment.txt
Expand All @@ -137,8 +138,8 @@ def executeTests() {
printenv | sort
mvn -B -V ${INTEGRATION_TESTS_FILTER_ARGUMENT} -T 1 verify \
-Ptest-jdk-${TEST_JAVA_VERSION} \
-DtestJavaHome=${TEST_JAVA_HOME} \
-Ptest-jdk-'''+testJavaVersion+''' \
-DtestJavaHome='''+testJavaHome+''' \
-DfailIfNoTests=false \
-Dmaven.test.failure.ignore=true \
-Dmaven.javadoc.skip=${SKIP_JAVADOCS} \
Expand All @@ -149,6 +150,8 @@ def executeTests() {
${ISOLATED_ITS_ARGUMENT} \
${PARALLELIZABLE_ITS_ARGUMENT}
'''
echo "Invoking Maven with parameters test-jdk-${testJavaVersion} and testJavaHome = ${testJavaHome}"
sh label: 'Execute tests', script: executeTestScript
}

def executeCodeCoverage() {
Expand Down Expand Up @@ -255,8 +258,10 @@ pipeline {
choices: ['2.1', // Legacy Apache CassandraⓇ
'2.2', // Legacy Apache CassandraⓇ
'3.0', // Previous Apache CassandraⓇ
'3.11', // Current Apache CassandraⓇ
'4.0', // Development Apache CassandraⓇ
'3.11', // Previous Apache CassandraⓇ
'4.0', // Previous Apache CassandraⓇ
'4.1', // Current Apache CassandraⓇ
'5.0', // Development Apache CassandraⓇ
'dse-4.8.16', // Previous EOSL DataStax Enterprise
'dse-5.0.15', // Long Term Support DataStax Enterprise
'dse-5.1.35', // Legacy DataStax Enterprise
Expand Down Expand Up @@ -290,7 +295,11 @@ pipeline {
</tr>
<tr>
<td><strong>4.0</strong></td>
<td>Apache Cassandra&reg; v4.x (<b>CURRENTLY UNDER DEVELOPMENT</b>)</td>
<td>Apache Cassandra&reg; v4.0.x</td>
</tr>
<tr>
<td><strong>4.1</strong></td>
<td>Apache Cassandra&reg; v4.1.x</td>
</tr>
<tr>
<td><strong>dse-4.8.16</strong></td>
Expand Down Expand Up @@ -444,7 +453,7 @@ pipeline {
axis {
name 'SERVER_VERSION'
values '3.11', // Latest stable Apache CassandraⓇ
'4.0', // Development Apache CassandraⓇ
'4.1', // Development Apache CassandraⓇ
'dse-6.8.30' // Current DataStax Enterprise
}
axis {
Expand Down Expand Up @@ -477,7 +486,7 @@ pipeline {
}
stage('Build-Driver') {
steps {
buildDriver('default')
buildDriver('1.8')
}
}
stage('Execute-Tests') {
Expand Down Expand Up @@ -553,8 +562,10 @@ pipeline {
name 'SERVER_VERSION'
values '2.1', // Legacy Apache CassandraⓇ
'3.0', // Previous Apache CassandraⓇ
'3.11', // Current Apache CassandraⓇ
'4.0', // Development Apache CassandraⓇ
'3.11', // Previous Apache CassandraⓇ
'4.0', // Previous Apache CassandraⓇ
'4.1', // Current Apache CassandraⓇ
'5.0', // Development Apache CassandraⓇ
'dse-4.8.16', // Previous EOSL DataStax Enterprise
'dse-5.0.15', // Last EOSL DataStax Enterprise
'dse-5.1.35', // Legacy DataStax Enterprise
Expand Down Expand Up @@ -591,8 +602,7 @@ pipeline {
}
stage('Build-Driver') {
steps {
// Jabba default should be a JDK8 for now
buildDriver('default')
buildDriver('1.8')
}
}
stage('Execute-Tests') {
Expand Down
18 changes: 9 additions & 9 deletions bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<groupId>com.scylladb</groupId>
<artifactId>java-driver-parent</artifactId>
<version>4.18.0.3-SNAPSHOT</version>
<version>4.18.1.0-SNAPSHOT</version>
</parent>
<artifactId>java-driver-bom</artifactId>
<packaging>pom</packaging>
Expand All @@ -38,42 +38,42 @@
<dependency>
<groupId>com.scylladb</groupId>
<artifactId>java-driver-core</artifactId>
<version>4.18.0.3-SNAPSHOT</version>
<version>4.18.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.scylladb</groupId>
<artifactId>java-driver-core-shaded</artifactId>
<version>4.18.0.3-SNAPSHOT</version>
<version>4.18.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.scylladb</groupId>
<artifactId>java-driver-mapper-processor</artifactId>
<version>4.18.0.3-SNAPSHOT</version>
<version>4.18.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.scylladb</groupId>
<artifactId>java-driver-mapper-runtime</artifactId>
<version>4.18.0.3-SNAPSHOT</version>
<version>4.18.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.scylladb</groupId>
<artifactId>java-driver-query-builder</artifactId>
<version>4.18.0.3-SNAPSHOT</version>
<version>4.18.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.scylladb</groupId>
<artifactId>java-driver-test-infra</artifactId>
<version>4.18.0.3-SNAPSHOT</version>
<version>4.18.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.scylladb</groupId>
<artifactId>java-driver-metrics-micrometer</artifactId>
<version>4.18.0.3-SNAPSHOT</version>
<version>4.18.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.scylladb</groupId>
<artifactId>java-driver-metrics-microprofile</artifactId>
<version>4.18.0.3-SNAPSHOT</version>
<version>4.18.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.datastax.oss</groupId>
Expand Down
20 changes: 20 additions & 0 deletions changelog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,26 @@ under the License.

<!-- Note: contrary to 3.x, insert new entries *first* in their section -->

### 4.18.1

- [improvement] JAVA-3142: Ability to specify ordering of remote local dc's via new configuration for graceful automatic failovers
- [bug] CASSANDRA-19457: Object reference in Micrometer metrics prevent GC from reclaiming Session instances
- [improvement] CASSANDRA-19468: Don't swallow exception during metadata refresh
- [bug] CASSANDRA-19333: Fix data corruption in VectorCodec when using heap buffers
- [improvement] CASSANDRA-19290: Replace uses of AttributeKey.newInstance
- [improvement] CASSANDRA-19352: Support native_transport_(address|port) + native_transport_port_ssl for DSE 6.8 (4.x edition)
- [improvement] CASSANDRA-19180: Support reloading keystore in cassandra-java-driver

### 4.18.0

- [improvement] PR 1689: Add support for publishing percentile time series for the histogram metrics (nparaddi-walmart)
- [improvement] JAVA-3104: Do not eagerly pre-allocate array when deserializing CqlVector
- [improvement] JAVA-3111: upgrade jackson-databind to 2.13.4.2 to address gradle dependency issue
- [improvement] PR 1617: Improve ByteBufPrimitiveCodec readBytes (chibenwa)
- [improvement] JAVA-3095: Fix CREATE keyword in vector search example in upgrade guide
- [improvement] JAVA-3100: Update jackson-databind to 2.13.4.1 and jackson-jaxrs-json-provider to 2.13.4 to address recent CVEs
- [improvement] JAVA-3089: Forbid wildcard imports

### 4.17.0

- [improvement] JAVA-3070: Make CqlVector and CqlDuration serializable
Expand Down
2 changes: 1 addition & 1 deletion core-shaded/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<groupId>com.scylladb</groupId>
<artifactId>java-driver-parent</artifactId>
<version>4.18.0.3-SNAPSHOT</version>
<version>4.18.1.0-SNAPSHOT</version>
</parent>
<artifactId>java-driver-core-shaded</artifactId>
<name>Java driver for Scylla and Apache Cassandra(R) - core with shaded deps</name>
Expand Down
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<groupId>com.scylladb</groupId>
<artifactId>java-driver-parent</artifactId>
<version>4.18.0.3-SNAPSHOT</version>
<version>4.18.1.0-SNAPSHOT</version>
</parent>
<artifactId>java-driver-core</artifactId>
<packaging>bundle</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,19 @@ public enum DefaultDriverOption implements DriverOption {
* <p>Value-type: boolean
*/
METRICS_GENERATE_AGGREGABLE_HISTOGRAMS("advanced.metrics.histograms.generate-aggregable"),
;
/**
* The duration between attempts to reload the keystore.
*
* <p>Value-type: {@link java.time.Duration}
*/
SSL_KEYSTORE_RELOAD_INTERVAL("advanced.ssl-engine-factory.keystore-reload-interval"),
/**
* Ordered preference list of remote dcs optionally supplied for automatic failover.
*
* <p>Value type: {@link java.util.List List}&#60;{@link String}&#62;
*/
LOAD_BALANCING_DC_FAILOVER_PREFERRED_REMOTE_DCS(
"advanced.load-balancing-policy.dc-failover.preferred-remote-dcs");

private final String path;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,8 @@ protected static void fillWithDriverDefaults(OptionsMap map) {
map.put(TypedDriverOption.LOAD_BALANCING_DC_FAILOVER_MAX_NODES_PER_REMOTE_DC, 0);
map.put(TypedDriverOption.LOAD_BALANCING_DC_FAILOVER_ALLOW_FOR_LOCAL_CONSISTENCY_LEVELS, false);
map.put(TypedDriverOption.METRICS_GENERATE_AGGREGABLE_HISTOGRAMS, true);
map.put(
TypedDriverOption.LOAD_BALANCING_DC_FAILOVER_PREFERRED_REMOTE_DCS, ImmutableList.of(""));
}

@Immutable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,12 @@ public String toString() {
/** The keystore password. */
public static final TypedDriverOption<String> SSL_KEYSTORE_PASSWORD =
new TypedDriverOption<>(DefaultDriverOption.SSL_KEYSTORE_PASSWORD, GenericType.STRING);

/** The duration between attempts to reload the keystore. */
public static final TypedDriverOption<Duration> SSL_KEYSTORE_RELOAD_INTERVAL =
new TypedDriverOption<>(
DefaultDriverOption.SSL_KEYSTORE_RELOAD_INTERVAL, GenericType.DURATION);

/** The location of the truststore file. */
public static final TypedDriverOption<String> SSL_TRUSTSTORE_PATH =
new TypedDriverOption<>(DefaultDriverOption.SSL_TRUSTSTORE_PATH, GenericType.STRING);
Expand Down Expand Up @@ -897,6 +903,16 @@ public String toString() {
DefaultDriverOption.LOAD_BALANCING_DC_FAILOVER_ALLOW_FOR_LOCAL_CONSISTENCY_LEVELS,
GenericType.BOOLEAN);

/**
* Ordered preference list of remote dcs optionally supplied for automatic failover and included
* in query plan. This feature is enabled only when max-nodes-per-remote-dc is greater than 0.
*/
public static final TypedDriverOption<List<String>>
LOAD_BALANCING_DC_FAILOVER_PREFERRED_REMOTE_DCS =
new TypedDriverOption<>(
DefaultDriverOption.LOAD_BALANCING_DC_FAILOVER_PREFERRED_REMOTE_DCS,
GenericType.listOf(String.class));

private static Iterable<TypedDriverOption<?>> introspectBuiltInValues() {
try {
ImmutableList.Builder<TypedDriverOption<?>> result = ImmutableList.builder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@
@ThreadSafe
public class DriverChannel {

static final AttributeKey<String> CLUSTER_NAME_KEY = AttributeKey.newInstance("cluster_name");
static final AttributeKey<String> CLUSTER_NAME_KEY = AttributeKey.valueOf("cluster_name");
static final AttributeKey<Map<String, List<String>>> OPTIONS_KEY =
AttributeKey.newInstance("options");
AttributeKey.valueOf("options");
static final AttributeKey<ConnectionShardingInfo> SHARDING_INFO_KEY =
AttributeKey.newInstance("sharding_info");
static final AttributeKey<LwtInfo> LWT_INFO_KEY = AttributeKey.newInstance("lwt_info");
AttributeKey.valueOf("sharding_info");
static final AttributeKey<LwtInfo> LWT_INFO_KEY = AttributeKey.valueOf("lwt_info");

@SuppressWarnings("RedundantStringConstructorCall")
static final Object GRACEFUL_CLOSE_MESSAGE = new String("GRACEFUL_CLOSE_MESSAGE");
Expand Down
Loading

0 comments on commit dbf4224

Please sign in to comment.