Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TSDB] Release time-series functionality #90116

Merged
merged 4 commits into from
Sep 19, 2022
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
5 changes: 5 additions & 0 deletions docs/changelog/90116.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 90116
summary: "Release time-series (TSDB) functionality"
area: "TSDB"
type: feature
issues: []
12 changes: 0 additions & 12 deletions modules/data-streams/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import org.elasticsearch.gradle.Version
import org.elasticsearch.gradle.internal.info.BuildParams

apply plugin: 'elasticsearch.test-with-dependencies'
Expand Down Expand Up @@ -27,15 +26,13 @@ testClusters.configureEach {
setting 'xpack.security.enabled', 'true'
keystore 'bootstrap.password', 'x-pack-test-password'
user username: "x_pack_rest_user", password: "x-pack-test-password"
requiresFeature 'es.index_mode_feature_flag_registered', Version.fromString("8.0.0")
}

testClusters.matching { it.name == "javaRestTest" }.configureEach {
testDistribution = 'DEFAULT'
setting 'xpack.security.enabled', 'false'
// disable ILM history, since it disturbs tests using _all
setting 'indices.lifecycle.history_index_enabled', 'false'
requiresFeature 'es.index_mode_feature_flag_registered', Version.fromString("8.0.0")
}

if (BuildParams.inFipsJvm){
Expand All @@ -44,12 +41,3 @@ if (BuildParams.inFipsJvm){
tasks.named("javaRestTest").configure{enabled = false }
tasks.named("yamlRestTest").configure{enabled = false }
}

if (BuildParams.isSnapshotBuild() == false) {
tasks.named("internalClusterTest").configure {
systemProperty 'es.index_mode_feature_flag_registered', 'true'
}
tasks.named("test").configure {
systemProperty 'es.index_mode_feature_flag_registered', 'true'
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
import org.elasticsearch.env.Environment;
import org.elasticsearch.env.NodeEnvironment;
import org.elasticsearch.index.IndexSettingProvider;
import org.elasticsearch.index.IndexSettings;
import org.elasticsearch.plugins.ActionPlugin;
import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.repositories.RepositoriesService;
Expand Down Expand Up @@ -101,10 +100,6 @@ static void additionalLookAheadTimeValidation(TimeValue lookAhead, TimeValue tim

@Override
public List<Setting<?>> getSettings() {
if (IndexSettings.isTimeSeriesModeEnabled() == false) {
return List.of();
}

return List.of(TIME_SERIES_POLL_INTERVAL, LOOK_AHEAD_TIME);
}

Expand All @@ -124,10 +119,6 @@ public Collection<Object> createComponents(
Tracer tracer,
AllocationDeciders allocationDeciders
) {
if (IndexSettings.isTimeSeriesModeEnabled() == false) {
return List.of();
}

var service = new UpdateTimeSeriesRangeService(environment.settings(), threadPool, clusterService);
this.service.set(service);
return List.of(service);
Expand Down Expand Up @@ -155,12 +146,10 @@ public List<RestHandler> getRestHandlers(
IndexNameExpressionResolver indexNameExpressionResolver,
Supplier<DiscoveryNodes> nodesInCluster
) {
if (IndexSettings.isTimeSeriesModeEnabled()) {
indexScopedSettings.addSettingsUpdateConsumer(LOOK_AHEAD_TIME, value -> {
TimeValue timeSeriesPollInterval = service.get().pollInterval;
additionalLookAheadTimeValidation(value, timeSeriesPollInterval);
});
}
indexScopedSettings.addSettingsUpdateConsumer(LOOK_AHEAD_TIME, value -> {
TimeValue timeSeriesPollInterval = service.get().pollInterval;
additionalLookAheadTimeValidation(value, timeSeriesPollInterval);
});

var createDsAction = new RestCreateDataStreamAction();
var deleteDsAction = new RestDeleteDataStreamAction();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1995,9 +1995,7 @@ public IndexMetadata build() {

final boolean isSearchableSnapshot = SearchableSnapshotsSettings.isSearchableSnapshotStore(settings);
final String indexMode = settings.get(IndexSettings.MODE.getKey());
final boolean isTsdb = IndexSettings.isTimeSeriesModeEnabled()
&& indexMode != null
&& IndexMode.TIME_SERIES.getName().equals(indexMode.toLowerCase(Locale.ROOT));
final boolean isTsdb = indexMode != null && IndexMode.TIME_SERIES.getName().equals(indexMode.toLowerCase(Locale.ROOT));
return new IndexMetadata(
new Index(index, uuid),
version,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import org.elasticsearch.indices.ShardLimitValidator;

import java.util.Collections;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

Expand All @@ -47,7 +46,7 @@
*/
public final class IndexScopedSettings extends AbstractScopedSettings {

private static final Set<Setting<?>> ALWAYS_ENABLED_BUILT_IN_INDEX_SETTINGS = Set.of(
public static final Set<Setting<?>> BUILT_IN_INDEX_SETTINGS = Set.of(
MaxRetryAllocationDecider.SETTING_ALLOCATION_MAX_RETRY,
MergeSchedulerConfig.AUTO_THROTTLE_SETTING,
MergeSchedulerConfig.MAX_MERGE_COUNT_SETTING,
Expand Down Expand Up @@ -175,22 +174,14 @@ public final class IndexScopedSettings extends AbstractScopedSettings {
}
}
}, Property.IndexScope), // this allows similarity settings to be passed
Setting.groupSetting("index.analysis.", Property.IndexScope)
); // this allows analysis settings to be passed
Setting.groupSetting("index.analysis.", Property.IndexScope), // this allows analysis settings to be passed

public static final Set<Setting<?>> BUILT_IN_INDEX_SETTINGS = builtInIndexSettings();

private static Set<Setting<?>> builtInIndexSettings() {
if (false == IndexSettings.isTimeSeriesModeEnabled()) {
return ALWAYS_ENABLED_BUILT_IN_INDEX_SETTINGS;
}
Set<Setting<?>> result = new HashSet<>(ALWAYS_ENABLED_BUILT_IN_INDEX_SETTINGS);
result.add(IndexSettings.MODE);
result.add(IndexMetadata.INDEX_ROUTING_PATH);
result.add(IndexSettings.TIME_SERIES_START_TIME);
result.add(IndexSettings.TIME_SERIES_END_TIME);
return Set.copyOf(result);
}
// TSDB index settings
IndexSettings.MODE,
IndexMetadata.INDEX_ROUTING_PATH,
IndexSettings.TIME_SERIES_START_TIME,
IndexSettings.TIME_SERIES_END_TIME
);

public static final IndexScopedSettings DEFAULT_SCOPED_SETTINGS = new IndexScopedSettings(Settings.EMPTY, BUILT_IN_INDEX_SETTINGS);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ public IndexSettings(final IndexMetadata indexMetadata, final Settings nodeSetti
nodeName = Node.NODE_NAME_SETTING.get(settings);
this.indexMetadata = indexMetadata;
numberOfShards = settings.getAsInt(IndexMetadata.SETTING_NUMBER_OF_SHARDS, null);
mode = isTimeSeriesModeEnabled() ? scopedSettings.get(MODE) : IndexMode.STANDARD;
mode = scopedSettings.get(MODE);
this.timestampBounds = mode.getTimestampBound(indexMetadata);
if (timestampBounds != null) {
scopedSettings.addSettingsUpdateConsumer(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import org.elasticsearch.client.internal.node.NodeClient;
import org.elasticsearch.common.Strings;
import org.elasticsearch.core.RestApiVersion;
import org.elasticsearch.index.IndexSettings;
import org.elasticsearch.index.VersionType;
import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestRequest;
Expand Down Expand Up @@ -79,7 +78,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC
getRequest.versionType(VersionType.fromString(request.param("version_type"), getRequest.versionType()));

getRequest.fetchSourceContext(FetchSourceContext.parseFromRestRequest(request));
if (IndexSettings.isTimeSeriesModeEnabled() && request.paramAsBoolean("force_synthetic_source", false)) {
if (request.paramAsBoolean("force_synthetic_source", false)) {
getRequest.setForceSyntheticSource(true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.core.RestApiVersion;
import org.elasticsearch.index.IndexSettings;
import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.rest.action.RestToXContentListener;
Expand Down Expand Up @@ -61,7 +60,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC
multiGetRequest.refresh(request.paramAsBoolean("refresh", multiGetRequest.refresh()));
multiGetRequest.preference(request.param("preference"));
multiGetRequest.realtime(request.paramAsBoolean("realtime", multiGetRequest.realtime()));
if (IndexSettings.isTimeSeriesModeEnabled() && request.paramAsBoolean("force_synthetic_source", false)) {
if (request.paramAsBoolean("force_synthetic_source", false)) {
multiGetRequest.setForceSyntheticSource(true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.core.Booleans;
import org.elasticsearch.core.RestApiVersion;
import org.elasticsearch.index.IndexSettings;
import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestRequest;
Expand Down Expand Up @@ -209,7 +208,7 @@ public static void parseSearchRequest(
request.paramAsBoolean("ccs_minimize_roundtrips", searchRequest.isCcsMinimizeRoundtrips())
);
}
if (IndexSettings.isTimeSeriesModeEnabled() && request.paramAsBoolean("force_synthetic_source", false)) {
if (request.paramAsBoolean("force_synthetic_source", false)) {
searchRequest.setForceSyntheticSource(true);
}

Expand Down
Loading