Skip to content

Commit f13dbff

Browse files
authored
Merge branch 'main' into update-api-PR
Signed-off-by: Ruirui Zhang <mariazrr@amazon.com>
2 parents bf69765 + 54af34e commit f13dbff

37 files changed

Lines changed: 1144 additions & 681 deletions

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1515
- Fix race condition while parsing derived fields from search definition ([14445](https://github.com/opensearch-project/OpenSearch/pull/14445))
1616
- Add `strict_allow_templates` dynamic mapping option ([#14555](https://github.com/opensearch-project/OpenSearch/pull/14555))
1717
- Add allowlist setting for ingest-common and search-pipeline-common processors ([#14439](https://github.com/opensearch-project/OpenSearch/issues/14439))
18+
- [Workload Management] add queryGroupId header propagator across requests and nodes ([#14614](https://github.com/opensearch-project/OpenSearch/pull/14614))
1819
- Create SystemIndexRegistry with helper method matchesSystemIndex ([#14415](https://github.com/opensearch-project/OpenSearch/pull/14415))
1920
- Print reason why parent task was cancelled ([#14604](https://github.com/opensearch-project/OpenSearch/issues/14604))
21+
- Add matchesPluginSystemIndexPattern to SystemIndexRegistry ([#14750](https://github.com/opensearch-project/OpenSearch/pull/14750))
22+
- Add Plugin interface for loading application based configuration templates (([#14659](https://github.com/opensearch-project/OpenSearch/issues/14659)))
2023

2124
### Dependencies
2225
- Bump `org.gradle.test-retry` from 1.5.8 to 1.5.9 ([#13442](https://github.com/opensearch-project/OpenSearch/pull/13442))
@@ -51,6 +54,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5154
### Deprecated
5255

5356
### Removed
57+
- Remove query categorization changes ([#14759](https://github.com/opensearch-project/OpenSearch/pull/14759))
5458

5559
### Fixed
5660
- Fix bug in SBP cancellation logic ([#13259](https://github.com/opensearch-project/OpenSearch/pull/13474))

server/src/internalClusterTest/java/org/opensearch/remotemigration/MigrationBaseTestCase.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
import org.opensearch.action.admin.cluster.health.ClusterHealthResponse;
1414
import org.opensearch.action.admin.cluster.repositories.get.GetRepositoriesRequest;
1515
import org.opensearch.action.admin.cluster.repositories.get.GetRepositoriesResponse;
16+
import org.opensearch.action.admin.indices.get.GetIndexRequest;
17+
import org.opensearch.action.admin.indices.get.GetIndexResponse;
1618
import org.opensearch.action.bulk.BulkRequest;
1719
import org.opensearch.action.bulk.BulkResponse;
1820
import org.opensearch.action.delete.DeleteResponse;
@@ -21,12 +23,17 @@
2123
import org.opensearch.client.Requests;
2224
import org.opensearch.cluster.ClusterState;
2325
import org.opensearch.cluster.health.ClusterHealthStatus;
26+
import org.opensearch.cluster.metadata.IndexMetadata;
2427
import org.opensearch.cluster.metadata.RepositoryMetadata;
2528
import org.opensearch.cluster.routing.RoutingNode;
2629
import org.opensearch.common.Priority;
2730
import org.opensearch.common.UUIDs;
2831
import org.opensearch.common.settings.Settings;
2932
import org.opensearch.common.unit.TimeValue;
33+
import org.opensearch.core.index.Index;
34+
import org.opensearch.index.IndexService;
35+
import org.opensearch.index.shard.IndexShard;
36+
import org.opensearch.indices.IndicesService;
3037
import org.opensearch.repositories.fs.ReloadableFsRepository;
3138
import org.opensearch.test.OpenSearchIntegTestCase;
3239
import org.junit.Before;
@@ -261,4 +268,13 @@ public ClusterHealthStatus waitForRelocation(TimeValue t) {
261268
}
262269
return actionGet.getStatus();
263270
}
271+
272+
protected IndexShard getIndexShard(String dataNode, String indexName) throws ExecutionException, InterruptedException {
273+
String clusterManagerName = internalCluster().getClusterManagerName();
274+
IndicesService indicesService = internalCluster().getInstance(IndicesService.class, dataNode);
275+
GetIndexResponse getIndexResponse = client(clusterManagerName).admin().indices().getIndex(new GetIndexRequest()).get();
276+
String uuid = getIndexResponse.getSettings().get(indexName).get(IndexMetadata.SETTING_INDEX_UUID);
277+
IndexService indexService = indicesService.indexService(new Index(indexName, uuid));
278+
return indexService.getShard(0);
279+
}
264280
}

server/src/internalClusterTest/java/org/opensearch/remotemigration/RemoteStoreMigrationTestCase.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import org.opensearch.common.unit.TimeValue;
1818
import org.opensearch.common.util.FeatureFlags;
1919
import org.opensearch.index.query.QueryBuilders;
20+
import org.opensearch.index.shard.IndexShard;
2021
import org.opensearch.repositories.blobstore.BlobStoreRepository;
2122
import org.opensearch.snapshots.SnapshotInfo;
2223
import org.opensearch.test.OpenSearchIntegTestCase;
@@ -216,4 +217,12 @@ public void testEndToEndRemoteMigration() throws Exception {
216217
asyncIndexingService.getIndexedDocs()
217218
);
218219
}
220+
221+
public void testRemoteSettingPropagatedToIndexShardAfterMigration() throws Exception {
222+
testEndToEndRemoteMigration();
223+
IndexShard indexShard = getIndexShard(primaryNodeName("test"), "test");
224+
assertTrue(indexShard.indexSettings().isRemoteStoreEnabled());
225+
assertEquals(MigrationBaseTestCase.REPOSITORY_NAME, indexShard.indexSettings().getRemoteStoreRepository());
226+
assertEquals(MigrationBaseTestCase.REPOSITORY_2_NAME, indexShard.indexSettings().getRemoteStoreTranslogRepository());
227+
}
219228
}

server/src/main/java/org/opensearch/action/search/SearchQueryAggregationCategorizer.java

Lines changed: 0 additions & 55 deletions
This file was deleted.

server/src/main/java/org/opensearch/action/search/SearchQueryCategorizer.java

Lines changed: 0 additions & 85 deletions
This file was deleted.

server/src/main/java/org/opensearch/action/search/SearchQueryCategorizingVisitor.java

Lines changed: 0 additions & 39 deletions
This file was deleted.

server/src/main/java/org/opensearch/action/search/SearchQueryCounters.java

Lines changed: 0 additions & 70 deletions
This file was deleted.

server/src/main/java/org/opensearch/action/search/TransportSearchAction.java

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,6 @@ public class TransportSearchAction extends HandledTransportAction<SearchRequest,
143143
Property.NodeScope
144144
);
145145

146-
public static final Setting<Boolean> SEARCH_QUERY_METRICS_ENABLED_SETTING = Setting.boolSetting(
147-
"search.query.metrics.enabled",
148-
false,
149-
Setting.Property.NodeScope,
150-
Setting.Property.Dynamic
151-
);
152-
153146
// cluster level setting for timeout based search cancellation. If search request level parameter is present then that will take
154147
// precedence over the cluster setting value
155148
public static final String SEARCH_CANCEL_AFTER_TIME_INTERVAL_SETTING_KEY = "search.cancel_after_time_interval";
@@ -182,11 +175,8 @@ public class TransportSearchAction extends HandledTransportAction<SearchRequest,
182175
private final SearchRequestOperationsCompositeListenerFactory searchRequestOperationsCompositeListenerFactory;
183176
private final Tracer tracer;
184177

185-
private volatile boolean searchQueryMetricsEnabled;
186-
187178
private final MetricsRegistry metricsRegistry;
188179

189-
private SearchQueryCategorizer searchQueryCategorizer;
190180
private TaskResourceTrackingService taskResourceTrackingService;
191181

192182
@Inject
@@ -222,21 +212,11 @@ public TransportSearchAction(
222212
this.namedWriteableRegistry = namedWriteableRegistry;
223213
this.searchPipelineService = searchPipelineService;
224214
this.metricsRegistry = metricsRegistry;
225-
this.searchQueryMetricsEnabled = clusterService.getClusterSettings().get(SEARCH_QUERY_METRICS_ENABLED_SETTING);
226215
this.searchRequestOperationsCompositeListenerFactory = searchRequestOperationsCompositeListenerFactory;
227-
clusterService.getClusterSettings()
228-
.addSettingsUpdateConsumer(SEARCH_QUERY_METRICS_ENABLED_SETTING, this::setSearchQueryMetricsEnabled);
229216
this.tracer = tracer;
230217
this.taskResourceTrackingService = taskResourceTrackingService;
231218
}
232219

233-
private void setSearchQueryMetricsEnabled(boolean searchQueryMetricsEnabled) {
234-
this.searchQueryMetricsEnabled = searchQueryMetricsEnabled;
235-
if ((this.searchQueryMetricsEnabled == true) && this.searchQueryCategorizer == null) {
236-
this.searchQueryCategorizer = new SearchQueryCategorizer(metricsRegistry);
237-
}
238-
}
239-
240220
private Map<String, AliasFilter> buildPerIndexAliasFilter(
241221
SearchRequest request,
242222
ClusterState clusterState,
@@ -473,13 +453,6 @@ private void executeRequest(
473453
}
474454

475455
ActionListener<SearchRequest> requestTransformListener = ActionListener.wrap(sr -> {
476-
if (searchQueryMetricsEnabled) {
477-
try {
478-
searchQueryCategorizer.categorize(sr.source());
479-
} catch (Exception e) {
480-
logger.error("Error while trying to categorize the query.", e);
481-
}
482-
}
483456

484457
ActionListener<SearchSourceBuilder> rewriteListener = buildRewriteListener(
485458
sr,

0 commit comments

Comments
 (0)