From 19bc9b1bcddfbcc562e1c082e977323934175b2a Mon Sep 17 00:00:00 2001 From: Felix de Souza Date: Mon, 13 Jan 2020 16:00:30 +0000 Subject: [PATCH] =?UTF-8?q?[Timelock=20Partitioning]=20Part=2048:=20Make?= =?UTF-8?q?=20use=20of=20templates=20for=20conf=E2=80=A6=20(#4426)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Make use of templates for config whilst testing. * Configure the port correctly... * Checkstyle. * Test failure. --- timelock-server/build.gradle | 1 + ...ctAsyncTimelockServiceIntegrationTest.java | 13 +++- .../AsyncTimelockServiceIntegrationTest.java | 2 +- ...tedPaxosTimeLockServerIntegrationTest.java | 9 ++- .../NonBlockingAppenderIntegrationTest.java | 45 ----------- .../PaxosTimeLockServerIntegrationTest.java | 9 +-- .../TemporaryConfigurationHolderTest.java | 74 ------------------- .../TimeLockServerDownIntegrationTest.java | 7 +- ...SingleServer.yml => paxosSingleServer.ftl} | 15 ++-- ...xosSingleServerWithNonBlockingAppender.yml | 56 -------------- ...ervers.yml => paxosStaticThreeServers.ftl} | 12 ++- .../atlasdb/timelock/suite/PaxosSuite.java | 41 +++++++--- .../atlasdb/timelock/TemplateVariables.java | 50 +++++++++++++ .../TemporaryConfigurationHolder.java | 60 +++++++-------- .../timelock/TestableTimelockCluster.java | 52 +++++-------- ...sMultiServer0.yml => paxosMultiServer.ftl} | 22 +++--- .../resources/paxosMultiServer1.yml | 62 ---------------- .../resources/paxosMultiServer2.yml | 62 ---------------- .../resources/paxosMultiServerBatch0.yml | 62 ---------------- .../resources/paxosMultiServerBatch1.yml | 62 ---------------- .../resources/paxosMultiServerBatch2.yml | 62 ---------------- versions.props | 1 + 22 files changed, 179 insertions(+), 600 deletions(-) delete mode 100644 timelock-server/src/integTest/java/com/palantir/atlasdb/timelock/NonBlockingAppenderIntegrationTest.java delete mode 100644 timelock-server/src/integTest/java/com/palantir/atlasdb/timelock/TemporaryConfigurationHolderTest.java rename timelock-server/src/integTest/resources/{paxosSingleServer.yml => paxosSingleServer.ftl} (87%) delete mode 100644 timelock-server/src/integTest/resources/paxosSingleServerWithNonBlockingAppender.yml rename timelock-server/src/integTest/resources/{paxosThreeServers.yml => paxosStaticThreeServers.ftl} (87%) create mode 100644 timelock-server/src/testCommon/java/com/palantir/atlasdb/timelock/TemplateVariables.java rename timelock-server/src/testCommon/resources/{paxosMultiServer0.yml => paxosMultiServer.ftl} (74%) delete mode 100644 timelock-server/src/testCommon/resources/paxosMultiServer1.yml delete mode 100644 timelock-server/src/testCommon/resources/paxosMultiServer2.yml delete mode 100644 timelock-server/src/testCommon/resources/paxosMultiServerBatch0.yml delete mode 100644 timelock-server/src/testCommon/resources/paxosMultiServerBatch1.yml delete mode 100644 timelock-server/src/testCommon/resources/paxosMultiServerBatch2.yml diff --git a/timelock-server/build.gradle b/timelock-server/build.gradle index 327a1c6b40d..3822dbd839b 100644 --- a/timelock-server/build.gradle +++ b/timelock-server/build.gradle @@ -79,6 +79,7 @@ dependencies { testCommonImplementation (project(":atlasdb-tests-shared")) { exclude group: 'com.fasterxml.jackson.jaxrs' } + testCommonImplementation group: 'org.freemarker', name: 'freemarker' testCommonApi group: 'io.dropwizard', name: 'dropwizard-testing' testCommonApi group: 'com.github.peterwippermann.junit4', name: 'parameterized-suite' diff --git a/timelock-server/src/integTest/java/com/palantir/atlasdb/timelock/AbstractAsyncTimelockServiceIntegrationTest.java b/timelock-server/src/integTest/java/com/palantir/atlasdb/timelock/AbstractAsyncTimelockServiceIntegrationTest.java index 6ce15434a92..2d1ac8054ca 100644 --- a/timelock-server/src/integTest/java/com/palantir/atlasdb/timelock/AbstractAsyncTimelockServiceIntegrationTest.java +++ b/timelock-server/src/integTest/java/com/palantir/atlasdb/timelock/AbstractAsyncTimelockServiceIntegrationTest.java @@ -18,13 +18,18 @@ import org.junit.ClassRule; import org.junit.rules.RuleChain; +import com.palantir.atlasdb.timelock.ImmutableTemplateVariables.TimestampPaxos; + public abstract class AbstractAsyncTimelockServiceIntegrationTest { - protected static final String LOCALHOST = "https://localhost"; + public static final TemplateVariables DEFAULT_SINGLE_SERVER = ImmutableTemplateVariables.builder() + .localServerPort(9050) + .addServerPorts() + .clientPaxos(TimestampPaxos.builder().isUseBatchPaxos(true).build()) + .build(); - protected static final TestableTimelockCluster CLUSTER_WITH_ASYNC = new TestableTimelockCluster( - LOCALHOST, - "paxosSingleServer.yml"); + protected static final TestableTimelockCluster CLUSTER_WITH_ASYNC = + new TestableTimelockCluster("paxosSingleServer.ftl", DEFAULT_SINGLE_SERVER); @ClassRule public static final RuleChain ASYNC_RULE_CHAIN = CLUSTER_WITH_ASYNC.getRuleChain(); diff --git a/timelock-server/src/integTest/java/com/palantir/atlasdb/timelock/AsyncTimelockServiceIntegrationTest.java b/timelock-server/src/integTest/java/com/palantir/atlasdb/timelock/AsyncTimelockServiceIntegrationTest.java index 51e827b6e5f..17d83f2b022 100644 --- a/timelock-server/src/integTest/java/com/palantir/atlasdb/timelock/AsyncTimelockServiceIntegrationTest.java +++ b/timelock-server/src/integTest/java/com/palantir/atlasdb/timelock/AsyncTimelockServiceIntegrationTest.java @@ -182,7 +182,7 @@ public void taggedMetricsCanBeIteratedThrough() { assertThat(metrics).hasKeySatisfying(new Condition("contains random namespace") { @Override public boolean matches(MetricName value) { - return value.safeTags().get("client").equals(randomNamespace.namespace()); + return randomNamespace.namespace().equals(value.safeTags().get("client")); } }); } diff --git a/timelock-server/src/integTest/java/com/palantir/atlasdb/timelock/IsolatedPaxosTimeLockServerIntegrationTest.java b/timelock-server/src/integTest/java/com/palantir/atlasdb/timelock/IsolatedPaxosTimeLockServerIntegrationTest.java index 27210c13d60..2cf84d29ee1 100644 --- a/timelock-server/src/integTest/java/com/palantir/atlasdb/timelock/IsolatedPaxosTimeLockServerIntegrationTest.java +++ b/timelock-server/src/integTest/java/com/palantir/atlasdb/timelock/IsolatedPaxosTimeLockServerIntegrationTest.java @@ -28,6 +28,7 @@ import com.google.common.collect.Iterables; import com.palantir.atlasdb.http.AtlasDbHttpClients; import com.palantir.atlasdb.http.TestProxyUtils; +import com.palantir.atlasdb.timelock.ImmutableTemplateVariables.TimestampPaxos; import com.palantir.atlasdb.timelock.paxos.PaxosTimeLockConstants; import com.palantir.atlasdb.timelock.util.ExceptionMatchers; import com.palantir.atlasdb.timelock.util.TestProxies; @@ -42,9 +43,13 @@ */ public class IsolatedPaxosTimeLockServerIntegrationTest { + private static final TemplateVariables SINGLE_NODE = ImmutableTemplateVariables.builder() + .localServerPort(9060) + .clientPaxos(TimestampPaxos.builder().isUseBatchPaxos(false).build()) + .build(); + private static final TestableTimelockCluster CLUSTER = new TestableTimelockCluster( - "https://localhost", - "paxosThreeServers.yml"); + "paxosStaticThreeServers.ftl", SINGLE_NODE); private static final TestableTimelockServer SERVER = Iterables.getOnlyElement(CLUSTER.servers()); diff --git a/timelock-server/src/integTest/java/com/palantir/atlasdb/timelock/NonBlockingAppenderIntegrationTest.java b/timelock-server/src/integTest/java/com/palantir/atlasdb/timelock/NonBlockingAppenderIntegrationTest.java deleted file mode 100644 index 63ada115124..00000000000 --- a/timelock-server/src/integTest/java/com/palantir/atlasdb/timelock/NonBlockingAppenderIntegrationTest.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * (c) Copyright 2019 Palantir Technologies Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.palantir.atlasdb.timelock; - -import org.junit.BeforeClass; -import org.junit.ClassRule; -import org.junit.Test; -import org.junit.rules.RuleChain; - -import com.google.common.collect.ImmutableList; - -public class NonBlockingAppenderIntegrationTest { - private static final TestableTimelockCluster CLUSTER = new TestableTimelockCluster( - "https://localhost", - "paxosSingleServerWithNonBlockingAppender.yml"); - - @ClassRule - public static final RuleChain ruleChain = CLUSTER.getRuleChain(); - private static NamespacedClients namespace; - - @BeforeClass - public static void setUp() { - namespace = CLUSTER.clientForRandomNamespace(); - CLUSTER.waitUntilLeaderIsElected(ImmutableList.of(namespace.namespace())); - } - - @Test - public void canDeserializeConfigAndStart() { - namespace.getFreshTimestamp(); - } - -} diff --git a/timelock-server/src/integTest/java/com/palantir/atlasdb/timelock/PaxosTimeLockServerIntegrationTest.java b/timelock-server/src/integTest/java/com/palantir/atlasdb/timelock/PaxosTimeLockServerIntegrationTest.java index 6c42c630313..7f2d9738da5 100644 --- a/timelock-server/src/integTest/java/com/palantir/atlasdb/timelock/PaxosTimeLockServerIntegrationTest.java +++ b/timelock-server/src/integTest/java/com/palantir/atlasdb/timelock/PaxosTimeLockServerIntegrationTest.java @@ -18,7 +18,8 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; -import java.io.File; +import static com.palantir.atlasdb.timelock.AbstractAsyncTimelockServiceIntegrationTest.DEFAULT_SINGLE_SERVER; + import java.util.List; import java.util.SortedMap; import java.util.concurrent.TimeUnit; @@ -44,8 +45,6 @@ import com.palantir.lock.v2.TimelockService; import com.palantir.timestamp.TimestampManagementService; -import io.dropwizard.testing.ResourceHelpers; - public class PaxosTimeLockServerIntegrationTest { private static final String CLIENT_1 = "test"; private static final String CLIENT_2 = "test2"; @@ -63,12 +62,10 @@ public class PaxosTimeLockServerIntegrationTest { private static final LockDescriptor LOCK_1 = StringLockDescriptor.of("lock1"); private static final SortedMap LOCK_MAP = ImmutableSortedMap.of(LOCK_1, LockMode.WRITE); - private static final File TIMELOCK_CONFIG_TEMPLATE = - new File(ResourceHelpers.resourceFilePath("paxosSingleServer.yml")); private static final TemporaryFolder TEMPORARY_FOLDER = new TemporaryFolder(); private static final TemporaryConfigurationHolder TEMPORARY_CONFIG_HOLDER = - new TemporaryConfigurationHolder(TEMPORARY_FOLDER, TIMELOCK_CONFIG_TEMPLATE); + new TemporaryConfigurationHolder(TEMPORARY_FOLDER, "paxosSingleServer.ftl", DEFAULT_SINGLE_SERVER); private static final TimeLockServerHolder TIMELOCK_SERVER_HOLDER = new TimeLockServerHolder(TEMPORARY_CONFIG_HOLDER::getTemporaryConfigFileLocation); private static final TestableTimelockServer TIMELOCK = diff --git a/timelock-server/src/integTest/java/com/palantir/atlasdb/timelock/TemporaryConfigurationHolderTest.java b/timelock-server/src/integTest/java/com/palantir/atlasdb/timelock/TemporaryConfigurationHolderTest.java deleted file mode 100644 index 89329857866..00000000000 --- a/timelock-server/src/integTest/java/com/palantir/atlasdb/timelock/TemporaryConfigurationHolderTest.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * (c) Copyright 2018 Palantir Technologies Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.palantir.atlasdb.timelock; - -import static org.assertj.core.api.Assertions.assertThatThrownBy; -import static org.junit.Assert.assertEquals; - -import java.io.File; -import java.io.IOException; - -import org.apache.commons.io.FileUtils; -import org.junit.ClassRule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; - -public class TemporaryConfigurationHolderTest { - private static final String TEMP_DATA_DIR = TemporaryConfigurationHolder.TEMP_DATA_DIR; - private static final String PREFIX = "_"; - private static final String TEST_FILE_DATA = PREFIX + TEMP_DATA_DIR; - private static final String SUBSTITUTION = "sub"; - - @ClassRule - public static final TemporaryFolder TEMPORARY_FOLDER = new TemporaryFolder(); - - @Test - public void canReplaceTempDataDirWithActualDirectory() { - String substituted = TemporaryConfigurationHolder.replaceTempDataDirPlaceholder(TEMP_DATA_DIR, SUBSTITUTION); - assertEquals(SUBSTITUTION, substituted); - } - - @Test - public void canHandlePotentiallyRecursiveSubstitution() { - String substituted = TemporaryConfigurationHolder.replaceTempDataDirPlaceholder(TEMP_DATA_DIR, TEMP_DATA_DIR); - assertEquals(TEMP_DATA_DIR, substituted); - } - - @Test - public void canWriteToNewFile() throws IOException { - File source = TEMPORARY_FOLDER.newFile(); - FileUtils.writeStringToFile(source, TEST_FILE_DATA); - File destination = TEMPORARY_FOLDER.newFile(); - TemporaryConfigurationHolder.writeNewFileWithPlaceholderSubstituted(source, SUBSTITUTION, destination); - - String destinationFileContent = FileUtils.readFileToString(destination); - assertEquals(PREFIX + SUBSTITUTION, destinationFileContent); - } - - @Test - public void throwsIfTryingToOverwriteSourceFile() throws IOException { - File source = TEMPORARY_FOLDER.newFile(); - FileUtils.writeStringToFile(source, TEST_FILE_DATA); - File destination = new File(source.getPath()); - - assertThatThrownBy(() -> - TemporaryConfigurationHolder.writeNewFileWithPlaceholderSubstituted(source, "", destination)) - .isInstanceOf(IllegalArgumentException.class); - - String sourceFileContent = FileUtils.readFileToString(source); - assertEquals(TEST_FILE_DATA, sourceFileContent); - } -} diff --git a/timelock-server/src/integTest/java/com/palantir/atlasdb/timelock/TimeLockServerDownIntegrationTest.java b/timelock-server/src/integTest/java/com/palantir/atlasdb/timelock/TimeLockServerDownIntegrationTest.java index fd0a3e786df..b2180ab849b 100644 --- a/timelock-server/src/integTest/java/com/palantir/atlasdb/timelock/TimeLockServerDownIntegrationTest.java +++ b/timelock-server/src/integTest/java/com/palantir/atlasdb/timelock/TimeLockServerDownIntegrationTest.java @@ -18,6 +18,8 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static com.palantir.atlasdb.timelock.AbstractAsyncTimelockServiceIntegrationTest.DEFAULT_SINGLE_SERVER; + import org.junit.ClassRule; import org.junit.Test; import org.junit.rules.RuleChain; @@ -36,9 +38,8 @@ public class TimeLockServerDownIntegrationTest { private static final byte[] DATA = "foo".getBytes(); private static final Cell CELL = Cell.create("bar".getBytes(), "baz".getBytes()); - private static final TestableTimelockCluster CLUSTER = new TestableTimelockCluster( - "https://localhost", - "paxosSingleServer.yml"); + private static final TestableTimelockCluster CLUSTER = + new TestableTimelockCluster("paxosSingleServer.ftl", DEFAULT_SINGLE_SERVER); @ClassRule public static final RuleChain ruleChain = CLUSTER.getRuleChain(); diff --git a/timelock-server/src/integTest/resources/paxosSingleServer.yml b/timelock-server/src/integTest/resources/paxosSingleServer.ftl similarity index 87% rename from timelock-server/src/integTest/resources/paxosSingleServer.yml rename to timelock-server/src/integTest/resources/paxosSingleServer.ftl index 6162f319c23..aaf93be54de 100644 --- a/timelock-server/src/integTest/resources/paxosSingleServer.yml +++ b/timelock-server/src/integTest/resources/paxosSingleServer.ftl @@ -5,7 +5,7 @@ install: ttl: PT5M maximum-size: 1000 paxos: - data-directory: "" + data-directory: "${dataDirectory}" is-new-service: false cluster: cluster: @@ -16,12 +16,15 @@ install: keyStorePassword: "keystore" keyStoreType: "JKS" uris: - - "localhost:9050" - local-server: "localhost:9050" + - "localhost:${localServerPort?c}" + local-server: "localhost:${localServerPort?c}" enableNonstandardAndPossiblyDangerousTopology: true timestampBoundPersistence: runtime: + paxos: + timestamp-paxos: + use-batch-paxos: ${clientPaxos.useBatchPaxos?c} targeted-sweep-locks: mode: disabled-by-default excluded-clients: @@ -41,7 +44,7 @@ server: maxThreads: 200 applicationConnectors: - type: h2 - port: 9050 + port: ${localServerPort?c} selectorThreads: 8 acceptorThreads: 4 keyStorePath: var/security/keyStore.jks @@ -64,6 +67,4 @@ server: - TLS_RSA_WITH_AES_256_CBC_SHA - TLS_RSA_WITH_AES_128_CBC_SHA - TLS_EMPTY_RENEGOTIATION_INFO_SCSV - adminConnectors: - - type: http - port: 7050 + adminConnectors: [] diff --git a/timelock-server/src/integTest/resources/paxosSingleServerWithNonBlockingAppender.yml b/timelock-server/src/integTest/resources/paxosSingleServerWithNonBlockingAppender.yml deleted file mode 100644 index 4877e7fb412..00000000000 --- a/timelock-server/src/integTest/resources/paxosSingleServerWithNonBlockingAppender.yml +++ /dev/null @@ -1,56 +0,0 @@ -install: - paxos: - data-directory: "" - is-new-service: false - cluster: - cluster: - security: - trustStorePath: "var/security/trustStore.jks" - trustStoreType: "JKS" - keyStorePath: "var/security/keyStore.jks" - keyStorePassword: "keystore" - keyStoreType: "JKS" - uris: - - "localhost:9030" - local-server: "localhost:9030" - enableNonstandardAndPossiblyDangerousTopology: true - timestampBoundPersistence: - -runtime: - paxos: - -server: - requestLog: - appenders: - - archivedFileCount: 10 - maxFileSize: 1GB - archivedLogFilenamePattern: "var/log/timelock-server-request-%i.log.gz" - currentLogFilename: var/log/timelock-server-request.log - threshold: INFO - timeZone: UTC - type: non-blocking-file - applicationConnectors: - - type: h2 - port: 9030 - selectorThreads: 8 - acceptorThreads: 4 - keyStorePath: var/security/keyStore.jks - keyStorePassword: keystore - trustStorePath: var/security/trustStore.jks - validateCerts: false - supportedCipherSuites: - - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 - - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 - - TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 - - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 - - TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 - - TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 - - TLS_RSA_WITH_AES_128_CBC_SHA256 - - TLS_RSA_WITH_AES_256_CBC_SHA256 - - TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA - - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA - - TLS_ECDH_RSA_WITH_AES_256_CBC_SHA - - TLS_ECDH_RSA_WITH_AES_128_CBC_SHA - - TLS_RSA_WITH_AES_256_CBC_SHA - - TLS_RSA_WITH_AES_128_CBC_SHA - - TLS_EMPTY_RENEGOTIATION_INFO_SCSV \ No newline at end of file diff --git a/timelock-server/src/integTest/resources/paxosThreeServers.yml b/timelock-server/src/integTest/resources/paxosStaticThreeServers.ftl similarity index 87% rename from timelock-server/src/integTest/resources/paxosThreeServers.yml rename to timelock-server/src/integTest/resources/paxosStaticThreeServers.ftl index 21818525db3..1b637560073 100644 --- a/timelock-server/src/integTest/resources/paxosThreeServers.yml +++ b/timelock-server/src/integTest/resources/paxosStaticThreeServers.ftl @@ -1,6 +1,6 @@ install: paxos: - data-directory: "" + data-directory: "${dataDirectory}" is-new-service: false cluster: cluster: @@ -11,10 +11,10 @@ install: keyStorePassword: "keystore" keyStoreType: "JKS" uris: + - "localhost:${localServerPort?c}" - "localhost:9061" - - "localhost:9060" - "localhost:9062" - local-server: "localhost:9060" + local-server: "localhost:${localServerPort?c}" timestampBoundPersistence: runtime: @@ -23,7 +23,7 @@ runtime: server: applicationConnectors: - type: h2 - port: 9060 + port: ${localServerPort?c} keyStorePath: var/security/keyStore.jks keyStorePassword: keystore trustStorePath: var/security/trustStore.jks @@ -44,6 +44,4 @@ server: - TLS_RSA_WITH_AES_256_CBC_SHA - TLS_RSA_WITH_AES_128_CBC_SHA - TLS_EMPTY_RENEGOTIATION_INFO_SCSV - adminConnectors: - - type: http - port: 7060 + adminConnectors: [] diff --git a/timelock-server/src/suiteTest/java/com/palantir/atlasdb/timelock/suite/PaxosSuite.java b/timelock-server/src/suiteTest/java/com/palantir/atlasdb/timelock/suite/PaxosSuite.java index e5338ce6a03..4a2328d2c64 100644 --- a/timelock-server/src/suiteTest/java/com/palantir/atlasdb/timelock/suite/PaxosSuite.java +++ b/timelock-server/src/suiteTest/java/com/palantir/atlasdb/timelock/suite/PaxosSuite.java @@ -17,6 +17,10 @@ package com.palantir.atlasdb.timelock.suite; import java.util.Collection; +import java.util.List; +import java.util.function.UnaryOperator; +import java.util.stream.Collectors; +import java.util.stream.IntStream; import org.junit.Rule; import org.junit.runner.RunWith; @@ -25,8 +29,9 @@ import com.github.peterwippermann.junit4.parameterizedsuite.ParameterizedSuite; import com.google.common.collect.ImmutableSet; -import com.palantir.atlasdb.timelock.ImmutableClusterName; +import com.palantir.atlasdb.timelock.ImmutableTemplateVariables; import com.palantir.atlasdb.timelock.MultiNodePaxosTimeLockServerIntegrationTest; +import com.palantir.atlasdb.timelock.TemplateVariables; import com.palantir.atlasdb.timelock.TestableTimelockCluster; @RunWith(ParameterizedSuite.class) @@ -34,18 +39,18 @@ public class PaxosSuite { public static final TestableTimelockCluster NON_BATCHED_TIMESTAMP_PAXOS = new TestableTimelockCluster( - ImmutableClusterName.of("non-batched paxos"), - "https://localhost", - "paxosMultiServer0.yml", - "paxosMultiServer1.yml", - "paxosMultiServer2.yml"); + "non-batched paxos", + "paxosMultiServer.ftl", + generateThreeNodeTimelockCluster(9080, builder -> + builder.clientPaxosBuilder( + builder.clientPaxosBuilder().isUseBatchPaxos(false)))); public static final TestableTimelockCluster BATCHED_TIMESTAMP_PAXOS = new TestableTimelockCluster( - ImmutableClusterName.of("batched paxos"), - "https://localhost", - "paxosMultiServerBatch0.yml", - "paxosMultiServerBatch1.yml", - "paxosMultiServerBatch2.yml"); + "batched paxos", + "paxosMultiServer.ftl", + generateThreeNodeTimelockCluster(9083, builder -> + builder.clientPaxosBuilder( + builder.clientPaxosBuilder().isUseBatchPaxos(true)))); @Parameterized.Parameters(name = "{0}") public static Collection params() { @@ -55,4 +60,18 @@ public static Collection params() { @Rule @Parameterized.Parameter public TestableTimelockCluster cluster; + + private static Iterable generateThreeNodeTimelockCluster( + int startingPort, + UnaryOperator customizer) { + List allPorts = IntStream.range(startingPort, startingPort + 3).boxed().collect(Collectors.toList()); + return IntStream.range(startingPort, startingPort + 3) + .boxed() + .map(port -> ImmutableTemplateVariables.builder() + .serverPorts(allPorts) + .localServerPort(port)) + .map(customizer) + .map(ImmutableTemplateVariables.Builder::build) + .collect(Collectors.toList()); + } } diff --git a/timelock-server/src/testCommon/java/com/palantir/atlasdb/timelock/TemplateVariables.java b/timelock-server/src/testCommon/java/com/palantir/atlasdb/timelock/TemplateVariables.java new file mode 100644 index 00000000000..cb7488e9c33 --- /dev/null +++ b/timelock-server/src/testCommon/java/com/palantir/atlasdb/timelock/TemplateVariables.java @@ -0,0 +1,50 @@ +/* + * (c) Copyright 2019 Palantir Technologies Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.palantir.atlasdb.timelock; + +import java.util.List; + +import javax.annotation.Nullable; + +import org.immutables.value.Value; + +@Value.Immutable +@Value.Enclosing +@Value.Style(attributeBuilderDetection = true) +public interface TemplateVariables { + @Nullable + String getDataDirectory(); + List getServerPorts(); + Integer getLocalServerPort(); + TimestampPaxos getClientPaxos(); + + @Value.Check + default TemplateVariables putLocalServerPortAmongstAllServerPorts() { + if (getServerPorts().contains(getLocalServerPort())) { + return this; + } + + return ImmutableTemplateVariables.builder().from(this) + .addServerPorts(getLocalServerPort()) + .build(); + } + + @Value.Immutable + interface TimestampPaxos { + boolean isUseBatchPaxos(); + } +} diff --git a/timelock-server/src/testCommon/java/com/palantir/atlasdb/timelock/TemporaryConfigurationHolder.java b/timelock-server/src/testCommon/java/com/palantir/atlasdb/timelock/TemporaryConfigurationHolder.java index c5373adc075..544cb98e3a0 100644 --- a/timelock-server/src/testCommon/java/com/palantir/atlasdb/timelock/TemporaryConfigurationHolder.java +++ b/timelock-server/src/testCommon/java/com/palantir/atlasdb/timelock/TemporaryConfigurationHolder.java @@ -16,59 +16,59 @@ package com.palantir.atlasdb.timelock; import java.io.File; -import java.io.IOException; -import java.nio.charset.StandardCharsets; +import java.io.FileWriter; +import java.util.Locale; -import org.apache.commons.io.FileUtils; import org.junit.rules.ExternalResource; import org.junit.rules.TemporaryFolder; -import com.google.common.annotations.VisibleForTesting; -import com.google.common.base.Preconditions; +import freemarker.template.Configuration; +import freemarker.template.Template; +import freemarker.template.TemplateExceptionHandler; public class TemporaryConfigurationHolder extends ExternalResource { - @VisibleForTesting - static final String TEMP_DATA_DIR = ""; + + private static final Configuration TEMPLATE_CONFIG = templateConfig(); private final TemporaryFolder temporaryFolder; - private final File configTemplate; + private final String templateName; + private final ImmutableTemplateVariables variables; private File temporaryConfigFile; - private File temporaryLogDirectory; - TemporaryConfigurationHolder(TemporaryFolder temporaryFolder, File configTemplate) { + TemporaryConfigurationHolder( + TemporaryFolder temporaryFolder, + String templateName, + TemplateVariables variables) { this.temporaryFolder = temporaryFolder; - this.configTemplate = configTemplate; + this.templateName = templateName; + this.variables = ImmutableTemplateVariables.copyOf(variables); + } + + private static Configuration templateConfig() { + Configuration config = new Configuration(Configuration.VERSION_2_3_29); + config.setClassLoaderForTemplateLoading(TemporaryConfigurationHolder.class.getClassLoader(), "/"); + config.setDefaultEncoding("UTF-8"); + config.setLocale(Locale.UK); + config.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER); + return config; } @Override public void before() throws Exception { temporaryConfigFile = temporaryFolder.newFile(); - temporaryLogDirectory = temporaryFolder.newFolder(); createTemporaryConfigFile(); } - private void createTemporaryConfigFile() throws IOException { - writeNewFileWithPlaceholderSubstituted(configTemplate, temporaryLogDirectory.getPath(), temporaryConfigFile); - } - - @VisibleForTesting - static void writeNewFileWithPlaceholderSubstituted(File sourceFile, String substitution, File destinationFile) - throws IOException { - Preconditions.checkArgument(!sourceFile.getCanonicalFile().equals(destinationFile.getCanonicalFile()), - "The source and destination files both point to '%s'.", sourceFile.getCanonicalPath()); - - String oldConfig = FileUtils.readFileToString(sourceFile, StandardCharsets.UTF_8); - String newConfig = replaceTempDataDirPlaceholder(oldConfig, substitution); - FileUtils.writeStringToFile(destinationFile, newConfig, StandardCharsets.UTF_8); - } - - @VisibleForTesting - static String replaceTempDataDirPlaceholder(String config, String substitution) { - return config.replace(TEMP_DATA_DIR, substitution); + private void createTemporaryConfigFile() throws Exception { + Template template = TEMPLATE_CONFIG.getTemplate(templateName); + template.process( + variables.withDataDirectory(temporaryFolder.newFolder().getAbsolutePath()), + new FileWriter(temporaryConfigFile)); } String getTemporaryConfigFileLocation() { return temporaryConfigFile.getPath(); } + } diff --git a/timelock-server/src/testCommon/java/com/palantir/atlasdb/timelock/TestableTimelockCluster.java b/timelock-server/src/testCommon/java/com/palantir/atlasdb/timelock/TestableTimelockCluster.java index d0b0343e537..0aecce9d673 100644 --- a/timelock-server/src/testCommon/java/com/palantir/atlasdb/timelock/TestableTimelockCluster.java +++ b/timelock-server/src/testCommon/java/com/palantir/atlasdb/timelock/TestableTimelockCluster.java @@ -17,9 +17,7 @@ import static org.assertj.core.api.Assertions.assertThat; -import java.io.File; import java.time.Duration; -import java.util.Arrays; import java.util.Collection; import java.util.List; import java.util.Map; @@ -33,7 +31,6 @@ import java.util.stream.Collectors; import org.awaitility.Awaitility; -import org.immutables.value.Value; import org.junit.rules.RuleChain; import org.junit.rules.TemporaryFolder; import org.junit.rules.TestRule; @@ -47,6 +44,7 @@ import com.google.common.collect.Multimap; import com.google.common.collect.SetMultimap; import com.google.common.collect.Sets; +import com.google.common.collect.Streams; import com.google.common.hash.Hashing; import com.palantir.atlasdb.timelock.paxos.PaxosQuorumCheckingCoalescingFunction.PaxosContainer; import com.palantir.atlasdb.timelock.util.TestProxies; @@ -54,13 +52,11 @@ import com.palantir.paxos.InProgressResponseState; import com.palantir.paxos.PaxosQuorumChecker; -import io.dropwizard.testing.ResourceHelpers; - public class TestableTimelockCluster implements TestRule { private final TemporaryFolder temporaryFolder = new TemporaryFolder(); - private final String clusterName; + private final String name; private final List configs; private final Set servers; private final Multimap serverToOtherServers; @@ -69,40 +65,33 @@ public class TestableTimelockCluster implements TestRule { private final Map clientsByNamespace = Maps.newConcurrentMap(); - public TestableTimelockCluster(String baseUri, String... configFileTemplates) { - this(ClusterName.random(), baseUri, configFileTemplates); + public TestableTimelockCluster(String configFileTemplate, TemplateVariables... variables) { + this(name(), configFileTemplate, variables); + } + + public TestableTimelockCluster(String name, String configFileTemplate, TemplateVariables... variables) { + this(name, configFileTemplate, ImmutableList.copyOf(variables)); } - public TestableTimelockCluster(ClusterName clusterName, String baseUri, String... configFileTemplates) { - this.clusterName = clusterName.get(); - this.configs = Arrays.stream(configFileTemplates) - .map(this::getConfigHolder) + public TestableTimelockCluster(String name, String configFileTemplate, Iterable variables) { + this.name = name; + this.configs = Streams.stream(variables) + .map(variable -> getConfigHolder(configFileTemplate, variable)) .collect(Collectors.toList()); this.servers = configs.stream() .map(TestableTimelockCluster::getServerHolder) - .map(holder -> new TestableTimelockServer(baseUri, holder)) + .map(holder -> new TestableTimelockServer("https://localhost", holder)) .collect(Collectors.toSet()); this.serverToOtherServers = KeyedStream.of(servers) .map(server -> ImmutableSet.of(server)) .map(server -> Sets.difference(servers, server)) .flatMap(Collection::stream) .collectToSetMultimap(); - this.proxyFactory = new FailoverProxyFactory(new TestProxies(baseUri, ImmutableList.copyOf(servers))); + this.proxyFactory = new FailoverProxyFactory(new TestProxies("https://localhost", ImmutableList.copyOf(servers))); } - @Value.Immutable - public abstract static class ClusterName { - @Value.Parameter - public abstract String get(); - - @Override - public String toString() { - return get(); - } - - static ClusterName random() { - return ImmutableClusterName.of(Hashing.murmur3_32().hashLong(new Random().nextLong()).toString()); - } + private static String name() { + return Hashing.murmur3_32().hashLong(new Random().nextLong()).toString(); } void waitUntilLeaderIsElected(List namespaces) { @@ -115,7 +104,7 @@ private void waitUntilReadyToServeNamespaces(List namespaces) { .pollInterval(500, TimeUnit.MILLISECONDS) .until(() -> { try { - namespaces.forEach(name -> client(name).getFreshTimestamp()); + namespaces.forEach(namespace -> client(namespace).getFreshTimestamp()); return true; } catch (Throwable t) { return false; @@ -241,9 +230,8 @@ private static TimeLockServerHolder getServerHolder(TemporaryConfigurationHolder return new TimeLockServerHolder(configHolder::getTemporaryConfigFileLocation); } - private TemporaryConfigurationHolder getConfigHolder(String configFileName) { - File configTemplate = new File(ResourceHelpers.resourceFilePath(configFileName)); - return new TemporaryConfigurationHolder(temporaryFolder, configTemplate); + private TemporaryConfigurationHolder getConfigHolder(String templateName, TemplateVariables variables) { + return new TemporaryConfigurationHolder(temporaryFolder, templateName, variables); } @Override @@ -253,6 +241,6 @@ public Statement apply(Statement base, Description description) { @Override public String toString() { - return clusterName; + return name; } } diff --git a/timelock-server/src/testCommon/resources/paxosMultiServer0.yml b/timelock-server/src/testCommon/resources/paxosMultiServer.ftl similarity index 74% rename from timelock-server/src/testCommon/resources/paxosMultiServer0.yml rename to timelock-server/src/testCommon/resources/paxosMultiServer.ftl index 503e0e66dae..27e3c1db248 100644 --- a/timelock-server/src/testCommon/resources/paxosMultiServer0.yml +++ b/timelock-server/src/testCommon/resources/paxosMultiServer.ftl @@ -1,6 +1,6 @@ install: paxos: - data-directory: "" + data-directory: "${dataDirectory}" is-new-service: false cluster: cluster: @@ -11,32 +11,32 @@ install: keyStorePassword: "keystore" keyStoreType: "JKS" uris: - - "localhost:9080" - - "localhost:9081" - - "localhost:9082" - local-server: "localhost:9080" +<#list serverPorts as serverPort> + - "localhost:${serverPort?c}" + + local-server: "localhost:${localServerPort?c}" timestampBoundPersistence: runtime: paxos: leader-ping-response-wait-in-ms: 1000 timestamp-paxos: - use-batch-paxos: false + use-batch-paxos: ${clientPaxos.useBatchPaxos?c} logging: appenders: - type: console - logFormat: "server-0 %-5p [%d{ISO8601,UTC}] %c: %m%n%rEx" + logFormat: "server-${localServerPort?c} %-5p [%d{ISO8601,UTC}] %c: %m%n%rEx" server: requestLog: appenders: - type: console - logFormat: 'server-0 [%t{ISO8601,UTC}] %s %localPort %r %b "%i{User-Agent}" %D' + logFormat: 'server-${localServerPort?c} [%t{ISO8601,UTC}] %s %localPort %r %b "%i{User-Agent}" %D' applicationConnectors: - type: h2 - port: 9080 + port: ${localServerPort?c} keyStorePath: var/security/keyStore.jks keyStorePassword: keystore trustStorePath: var/security/trustStore.jks @@ -57,6 +57,4 @@ server: - TLS_RSA_WITH_AES_256_CBC_SHA - TLS_RSA_WITH_AES_128_CBC_SHA - TLS_EMPTY_RENEGOTIATION_INFO_SCSV - adminConnectors: - - type: http - port: 7090 + adminConnectors: [] diff --git a/timelock-server/src/testCommon/resources/paxosMultiServer1.yml b/timelock-server/src/testCommon/resources/paxosMultiServer1.yml deleted file mode 100644 index 1f35d8f21f5..00000000000 --- a/timelock-server/src/testCommon/resources/paxosMultiServer1.yml +++ /dev/null @@ -1,62 +0,0 @@ -install: - paxos: - data-directory: "" - is-new-service: false - cluster: - cluster: - security: - trustStorePath: "var/security/trustStore.jks" - trustStoreType: "JKS" - keyStorePath: "var/security/keyStore.jks" - keyStorePassword: "keystore" - keyStoreType: "JKS" - uris: - - "localhost:9080" - - "localhost:9081" - - "localhost:9082" - local-server: "localhost:9081" - timestampBoundPersistence: - -runtime: - paxos: - leader-ping-response-wait-in-ms: 1000 - timestamp-paxos: - use-batch-paxos: false - -logging: - appenders: - - type: console - logFormat: "server-1 %-5p [%d{ISO8601,UTC}] %c: %m%n%rEx" - -server: - requestLog: - appenders: - - type: console - logFormat: 'server-1 [%t{ISO8601,UTC}] %s %localPort %r %b "%i{User-Agent}" %D' - - applicationConnectors: - - type: h2 - port: 9081 - keyStorePath: var/security/keyStore.jks - keyStorePassword: keystore - trustStorePath: var/security/trustStore.jks - validateCerts: false - supportedCipherSuites: - - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 - - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 - - TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 - - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 - - TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 - - TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 - - TLS_RSA_WITH_AES_128_CBC_SHA256 - - TLS_RSA_WITH_AES_256_CBC_SHA256 - - TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA - - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA - - TLS_ECDH_RSA_WITH_AES_256_CBC_SHA - - TLS_ECDH_RSA_WITH_AES_128_CBC_SHA - - TLS_RSA_WITH_AES_256_CBC_SHA - - TLS_RSA_WITH_AES_128_CBC_SHA - - TLS_EMPTY_RENEGOTIATION_INFO_SCSV - adminConnectors: - - type: http - port: 7091 diff --git a/timelock-server/src/testCommon/resources/paxosMultiServer2.yml b/timelock-server/src/testCommon/resources/paxosMultiServer2.yml deleted file mode 100644 index 7b05eecb9c0..00000000000 --- a/timelock-server/src/testCommon/resources/paxosMultiServer2.yml +++ /dev/null @@ -1,62 +0,0 @@ -install: - paxos: - data-directory: "" - is-new-service: false - cluster: - cluster: - security: - trustStorePath: "var/security/trustStore.jks" - trustStoreType: "JKS" - keyStorePath: "var/security/keyStore.jks" - keyStorePassword: "keystore" - keyStoreType: "JKS" - uris: - - "localhost:9080" - - "localhost:9081" - - "localhost:9082" - local-server: "localhost:9082" - timestampBoundPersistence: - -runtime: - paxos: - leader-ping-response-wait-in-ms: 1000 - timestamp-paxos: - use-batch-paxos: false - -logging: - appenders: - - type: console - logFormat: "server-2 %-5p [%d{ISO8601,UTC}] %c: %m%n%rEx" - -server: - requestLog: - appenders: - - type: console - logFormat: 'server-2 [%t{ISO8601,UTC}] %s %localPort %r %b "%i{User-Agent}" %D' - - applicationConnectors: - - type: h2 - port: 9082 - keyStorePath: var/security/keyStore.jks - keyStorePassword: keystore - trustStorePath: var/security/trustStore.jks - validateCerts: false - supportedCipherSuites: - - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 - - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 - - TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 - - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 - - TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 - - TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 - - TLS_RSA_WITH_AES_128_CBC_SHA256 - - TLS_RSA_WITH_AES_256_CBC_SHA256 - - TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA - - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA - - TLS_ECDH_RSA_WITH_AES_256_CBC_SHA - - TLS_ECDH_RSA_WITH_AES_128_CBC_SHA - - TLS_RSA_WITH_AES_256_CBC_SHA - - TLS_RSA_WITH_AES_128_CBC_SHA - - TLS_EMPTY_RENEGOTIATION_INFO_SCSV - adminConnectors: - - type: http - port: 7082 diff --git a/timelock-server/src/testCommon/resources/paxosMultiServerBatch0.yml b/timelock-server/src/testCommon/resources/paxosMultiServerBatch0.yml deleted file mode 100644 index e707b016282..00000000000 --- a/timelock-server/src/testCommon/resources/paxosMultiServerBatch0.yml +++ /dev/null @@ -1,62 +0,0 @@ -install: - paxos: - data-directory: "" - is-new-service: false - cluster: - cluster: - security: - trustStorePath: "var/security/trustStore.jks" - trustStoreType: "JKS" - keyStorePath: "var/security/keyStore.jks" - keyStorePassword: "keystore" - keyStoreType: "JKS" - uris: - - "localhost:9083" - - "localhost:9084" - - "localhost:9085" - local-server: "localhost:9083" - timestampBoundPersistence: - -runtime: - paxos: - leader-ping-response-wait-in-ms: 1000 - timestamp-paxos: - use-batch-paxos: true - -logging: - appenders: - - type: console - logFormat: "server-0 %-5p [%d{ISO8601,UTC}] %c: %m%n%rEx" - -server: - requestLog: - appenders: - - type: console - logFormat: 'server-0 [%t{ISO8601,UTC}] %s %localPort %r %b "%i{User-Agent}" %D' - - applicationConnectors: - - type: h2 - port: 9083 - keyStorePath: var/security/keyStore.jks - keyStorePassword: keystore - trustStorePath: var/security/trustStore.jks - validateCerts: false - supportedCipherSuites: - - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 - - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 - - TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 - - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 - - TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 - - TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 - - TLS_RSA_WITH_AES_128_CBC_SHA256 - - TLS_RSA_WITH_AES_256_CBC_SHA256 - - TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA - - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA - - TLS_ECDH_RSA_WITH_AES_256_CBC_SHA - - TLS_ECDH_RSA_WITH_AES_128_CBC_SHA - - TLS_RSA_WITH_AES_256_CBC_SHA - - TLS_RSA_WITH_AES_128_CBC_SHA - - TLS_EMPTY_RENEGOTIATION_INFO_SCSV - adminConnectors: - - type: http - port: 7093 diff --git a/timelock-server/src/testCommon/resources/paxosMultiServerBatch1.yml b/timelock-server/src/testCommon/resources/paxosMultiServerBatch1.yml deleted file mode 100644 index e86b5622326..00000000000 --- a/timelock-server/src/testCommon/resources/paxosMultiServerBatch1.yml +++ /dev/null @@ -1,62 +0,0 @@ -install: - paxos: - data-directory: "" - is-new-service: false - cluster: - cluster: - security: - trustStorePath: "var/security/trustStore.jks" - trustStoreType: "JKS" - keyStorePath: "var/security/keyStore.jks" - keyStorePassword: "keystore" - keyStoreType: "JKS" - uris: - - "localhost:9083" - - "localhost:9084" - - "localhost:9085" - local-server: "localhost:9084" - timestampBoundPersistence: - -runtime: - paxos: - leader-ping-response-wait-in-ms: 1000 - timestamp-paxos: - use-batch-paxos: true - -logging: - appenders: - - type: console - logFormat: "server-1 %-5p [%d{ISO8601,UTC}] %c: %m%n%rEx" - -server: - requestLog: - appenders: - - type: console - logFormat: 'server-1 [%t{ISO8601,UTC}] %s %localPort %r %b "%i{User-Agent}" %D' - - applicationConnectors: - - type: h2 - port: 9084 - keyStorePath: var/security/keyStore.jks - keyStorePassword: keystore - trustStorePath: var/security/trustStore.jks - validateCerts: false - supportedCipherSuites: - - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 - - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 - - TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 - - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 - - TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 - - TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 - - TLS_RSA_WITH_AES_128_CBC_SHA256 - - TLS_RSA_WITH_AES_256_CBC_SHA256 - - TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA - - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA - - TLS_ECDH_RSA_WITH_AES_256_CBC_SHA - - TLS_ECDH_RSA_WITH_AES_128_CBC_SHA - - TLS_RSA_WITH_AES_256_CBC_SHA - - TLS_RSA_WITH_AES_128_CBC_SHA - - TLS_EMPTY_RENEGOTIATION_INFO_SCSV - adminConnectors: - - type: http - port: 7094 diff --git a/timelock-server/src/testCommon/resources/paxosMultiServerBatch2.yml b/timelock-server/src/testCommon/resources/paxosMultiServerBatch2.yml deleted file mode 100644 index 95eb80b6feb..00000000000 --- a/timelock-server/src/testCommon/resources/paxosMultiServerBatch2.yml +++ /dev/null @@ -1,62 +0,0 @@ -install: - paxos: - data-directory: "" - is-new-service: false - cluster: - cluster: - security: - trustStorePath: "var/security/trustStore.jks" - trustStoreType: "JKS" - keyStorePath: "var/security/keyStore.jks" - keyStorePassword: "keystore" - keyStoreType: "JKS" - uris: - - "localhost:9083" - - "localhost:9084" - - "localhost:9085" - local-server: "localhost:9085" - timestampBoundPersistence: - -runtime: - paxos: - leader-ping-response-wait-in-ms: 1000 - timestamp-paxos: - use-batch-paxos: true - -logging: - appenders: - - type: console - logFormat: "server-2 %-5p [%d{ISO8601,UTC}] %c: %m%n%rEx" - -server: - requestLog: - appenders: - - type: console - logFormat: 'server-2 [%t{ISO8601,UTC}] %s %localPort %r %b "%i{User-Agent}" %D' - - applicationConnectors: - - type: h2 - port: 9085 - keyStorePath: var/security/keyStore.jks - keyStorePassword: keystore - trustStorePath: var/security/trustStore.jks - validateCerts: false - supportedCipherSuites: - - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 - - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 - - TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 - - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 - - TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 - - TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 - - TLS_RSA_WITH_AES_128_CBC_SHA256 - - TLS_RSA_WITH_AES_256_CBC_SHA256 - - TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA - - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA - - TLS_ECDH_RSA_WITH_AES_256_CBC_SHA - - TLS_ECDH_RSA_WITH_AES_128_CBC_SHA - - TLS_RSA_WITH_AES_256_CBC_SHA - - TLS_RSA_WITH_AES_128_CBC_SHA - - TLS_EMPTY_RENEGOTIATION_INFO_SCSV - adminConnectors: - - type: http - port: 7095 diff --git a/versions.props b/versions.props index 138932e97d5..496a71961a3 100644 --- a/versions.props +++ b/versions.props @@ -84,6 +84,7 @@ org.ow2.asm:asm = 7.0 org.rocksdb:rocksdbjni = 6.4.6 org.slf4j:* = 1.7.25 org.yaml:snakeyaml = 1.23 +org.freemarker:freemarker = 2.3.29 com.google.errorprone:error_prone_refaster = 2.3.3 com.palantir.baseline:baseline-refaster-testing = 2.17.0