Skip to content

Commit bed761b

Browse files
committed
Execute a single batch updateconf in CcmBridge
Previously, every configuration option set in a CCM cluster would get passed as a separate call to "ccm updateconf". After scylladb/scylla-ccm#410 was merged, this way stopped working correctly as it seems like only the first "ccm updateconf" was correctly applied. Moreover, during the investigation of the issue, it was found that in case of Scylla, "ccm updateconf client_encryption_options.[OPTION]" wouldn't get properly filled in (even before scylladb/scylla-ccm#410), as only a single option from "client_encryption_options.*" would get persisted. This change fixes the issue by not issuing separate "ccm updateconf", but by collecting all configuration options and batching them to a single "ccm updateconf" call. This follows the implementation in Java Driver 3.x.
1 parent 65a2835 commit bed761b

File tree

1 file changed

+10
-2
lines changed
  • test-infra/src/main/java/com/datastax/oss/driver/api/testinfra/ccm

1 file changed

+10
-2
lines changed

test-infra/src/main/java/com/datastax/oss/driver/api/testinfra/ccm/CcmBridge.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,12 +302,20 @@ public void create() {
302302
Arrays.stream(nodes).mapToObj(n -> "" + n).collect(Collectors.joining(":")),
303303
createOptions.stream().collect(Collectors.joining(" ")));
304304

305+
// Collect all cassandraConfiguration (and others) into a single "ccm updateconf" call.
306+
// Works around the behavior introduced in https://github.com/scylladb/scylla-ccm/pull/410
307+
StringBuilder updateConfArguments = new StringBuilder();
308+
305309
for (Map.Entry<String, Object> conf : cassandraConfiguration.entrySet()) {
306-
execute("updateconf", String.format("%s:%s", conf.getKey(), conf.getValue()));
310+
updateConfArguments.append(conf.getKey()).append(':').append(conf.getValue()).append(' ');
307311
}
308312
if (getCassandraVersion().compareTo(Version.V2_2_0) >= 0 && !SCYLLA_ENABLEMENT) {
309313
// @IntegrationTestDisabledScyllaJVMArgs @IntegrationTestDisabledScyllaUDF
310-
execute("updateconf", "enable_user_defined_functions:true");
314+
updateConfArguments.append("enable_user_defined_functions:true").append(' ');
315+
}
316+
317+
if (updateConfArguments.length() > 0) {
318+
execute("updateconf", updateConfArguments.toString());
311319
}
312320
if (DSE_ENABLEMENT) {
313321
for (Map.Entry<String, Object> conf : dseConfiguration.entrySet()) {

0 commit comments

Comments
 (0)