Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -147,30 +147,6 @@ if (buildParams.snapshotBuild == false) {

tasks.named("test").configure {
systemProperty 'es.insecure_network_trace_enabled', 'true'
filter {
excludeTestsMatching("*.TransportServiceHandshakeTests.testAcceptsMismatchedServerlessBuildHash")
}
excludes << '**/IndexSettingsOverrideTests.class'
}

// There are tests rely on system properties to be configured differently. They must run in a separate test job
// since the default does not work for them and configuring the system properties inside the test class/method
// is too late because fields based on the system properties are often initialized statically.
TaskProvider<Test> systemPropertiesOverrideTest = tasks.register("systemPropertiesOverrideTest", Test) {
include '**/IndexSettingsOverrideTests.class'
include '**/TransportServiceHandshakeTests.class'
filter {
includeTestsMatching("*.TransportServiceHandshakeTests.testAcceptsMismatchedServerlessBuildHash")
includeTestsMatching("*.IndexSettingsOverrideTests.*")
}
systemProperty 'es.stateless.allow.index.refresh_interval.override', 'true'
systemProperty 'es.serverless_transport', 'true'
classpath = sourceSets.test.runtimeClasspath
testClassesDirs = sourceSets.test.output.classesDirs
}

tasks.named("check").configure {
dependsOn(systemPropertiesOverrideTest)
}

tasks.named("thirdPartyAudit").configure {
Expand Down
27 changes: 10 additions & 17 deletions server/src/main/java/org/elasticsearch/index/IndexSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -303,11 +303,6 @@ public final class IndexSettings {

static class RefreshIntervalValidator implements Setting.Validator<TimeValue> {

static final String STATELESS_ALLOW_INDEX_REFRESH_INTERVAL_OVERRIDE = "es.stateless.allow.index.refresh_interval.override";
private static final boolean IS_OVERRIDE_ALLOWED = Boolean.parseBoolean(
System.getProperty(STATELESS_ALLOW_INDEX_REFRESH_INTERVAL_OVERRIDE, "false")
);

@Override
public void validate(TimeValue value) {}

Expand All @@ -323,18 +318,16 @@ public void validate(final TimeValue value, final Map<Setting<?>, Object> settin
&& value.compareTo(STATELESS_MIN_NON_FAST_REFRESH_INTERVAL) < 0
&& indexVersion.after(IndexVersions.V_8_10_0)) {

if (IS_OVERRIDE_ALLOWED == false) {
throw new IllegalArgumentException(
"index setting ["
+ IndexSettings.INDEX_REFRESH_INTERVAL_SETTING.getKey()
+ "="
+ value
+ "] should be either "
+ TimeValue.MINUS_ONE
+ " or equal to or greater than "
+ STATELESS_MIN_NON_FAST_REFRESH_INTERVAL
);
}
throw new IllegalArgumentException(
"index setting ["
+ IndexSettings.INDEX_REFRESH_INTERVAL_SETTING.getKey()
+ "="
+ value
+ "] should be either "
+ TimeValue.MINUS_ONE
+ " or equal to or greater than "
+ STATELESS_MIN_NON_FAST_REFRESH_INTERVAL
);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException;
import org.elasticsearch.common.util.concurrent.ThreadContext;
import org.elasticsearch.core.AbstractRefCounted;
import org.elasticsearch.core.Booleans;
import org.elasticsearch.core.IOUtils;
import org.elasticsearch.core.Nullable;
import org.elasticsearch.core.Predicates;
Expand Down Expand Up @@ -79,15 +78,6 @@ public class TransportService extends AbstractLifecycleComponent

private static final Logger logger = LogManager.getLogger(TransportService.class);

/**
* A feature flag enabling transport upgrades for serverless.
*/
static final String SERVERLESS_TRANSPORT_SYSTEM_PROPERTY = "es.serverless_transport";
private static final boolean SERVERLESS_TRANSPORT_FEATURE_FLAG = Booleans.parseBoolean(
System.getProperty(SERVERLESS_TRANSPORT_SYSTEM_PROPERTY),
false
);

public static final String DIRECT_RESPONSE_PROFILE = ".direct";
public static final String HANDSHAKE_ACTION_NAME = "internal:transport/handshake";

Expand Down Expand Up @@ -672,7 +662,7 @@ public HandshakeResponse(StreamInput in) throws IOException {
}

private void maybeThrowOnIncompatibleBuild(@Nullable DiscoveryNode node, @Nullable Exception e) {
if (SERVERLESS_TRANSPORT_FEATURE_FLAG == false && isIncompatibleBuild(version, buildHash)) {
if (isIncompatibleBuild(version, buildHash)) {
throwOnIncompatibleBuild(node, e);
}
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

package org.elasticsearch.transport;

import org.elasticsearch.Build;
import org.elasticsearch.ExceptionsHelper;
import org.elasticsearch.TransportVersion;
import org.elasticsearch.Version;
Expand Down Expand Up @@ -371,34 +370,6 @@ public void testRejectsMismatchedBuildHash() {
assertFalse(transportServiceA.nodeConnected(discoveryNode));
}

public void testAcceptsMismatchedServerlessBuildHash() {
assumeTrue("Current build needs to be a snapshot", Build.current().isSnapshot());
final DisruptingTransportInterceptor transportInterceptorA = new DisruptingTransportInterceptor();
final DisruptingTransportInterceptor transportInterceptorB = new DisruptingTransportInterceptor();
transportInterceptorA.setModifyBuildHash(true);
transportInterceptorB.setModifyBuildHash(true);
final Settings settings = Settings.builder()
.put("cluster.name", "a")
.put(IGNORE_DESERIALIZATION_ERRORS_SETTING.getKey(), true) // suppress assertions to test production error-handling
.build();
final TransportService transportServiceA = startServices(
"TS_A",
settings,
TransportVersion.current(),
VersionInformation.CURRENT,
transportInterceptorA
);
final TransportService transportServiceB = startServices(
"TS_B",
settings,
TransportVersion.current(),
VersionInformation.CURRENT,
transportInterceptorB
);
AbstractSimpleTransportTestCase.connectToNode(transportServiceA, transportServiceB.getLocalNode(), TestProfiles.LIGHT_PROFILE);
assertTrue(transportServiceA.nodeConnected(transportServiceB.getLocalNode()));
}

public void testAcceptsMismatchedBuildHashFromDifferentVersion() {
final DisruptingTransportInterceptor transportInterceptorA = new DisruptingTransportInterceptor();
final DisruptingTransportInterceptor transportInterceptorB = new DisruptingTransportInterceptor();
Expand Down