Skip to content

Commit bc68a12

Browse files
vinaykpudrayshrey
authored andcommitted
Renaming the node role search to warm (opensearch-project#17573)
* Renaming search node role to warm Signed-off-by: Vinay Krishna Pudyodu <[email protected]> * Added Changelog Signed-off-by: Vinay Krishna Pudyodu <[email protected]> * fixed failing tests Signed-off-by: Vinay Krishna Pudyodu <[email protected]> * fixed PR comments Signed-off-by: Vinay Krishna Pudyodu <[email protected]> --------- Signed-off-by: Vinay Krishna Pudyodu <[email protected]>
1 parent 9db4ad6 commit bc68a12

File tree

28 files changed

+306
-306
lines changed

28 files changed

+306
-306
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55

66
## [Unreleased 2.x]
77
### Added
8-
8+
- Renaming the node role search to warm ([#17573](https://github.com/opensearch-project/OpenSearch/pull/17573))
99
### Dependencies
1010
- Bump `netty` from 4.1.118.Final to 4.1.121.Final ([#18192](https://github.com/opensearch-project/OpenSearch/pull/18192))
1111

server/src/internalClusterTest/java/org/opensearch/action/admin/cluster/stats/ClusterStatsIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,7 @@ private Map<String, Integer> getExpectedCounts(
896896
expectedCounts.put(DiscoveryNodeRole.CLUSTER_MANAGER_ROLE.roleName(), clusterManagerRoleCount);
897897
expectedCounts.put(DiscoveryNodeRole.INGEST_ROLE.roleName(), ingestRoleCount);
898898
expectedCounts.put(DiscoveryNodeRole.REMOTE_CLUSTER_CLIENT_ROLE.roleName(), remoteClusterClientRoleCount);
899-
expectedCounts.put(DiscoveryNodeRole.SEARCH_ROLE.roleName(), searchRoleCount);
899+
expectedCounts.put(DiscoveryNodeRole.WARM_ROLE.roleName(), searchRoleCount);
900900
expectedCounts.put(ClusterStatsNodes.Counts.COORDINATING_ONLY, coordinatingOnlyCount);
901901
return expectedCounts;
902902
}

server/src/internalClusterTest/java/org/opensearch/cluster/ClusterInfoServiceIT.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ public void testClusterInfoServiceCollectsInformation() {
195195

196196
final Map<String, FileCacheStats> nodeFileCacheStats = info.nodeFileCacheStats;
197197
assertNotNull(nodeFileCacheStats);
198-
assertThat("file cache is empty on non search nodes", nodeFileCacheStats.size(), Matchers.equalTo(0));
198+
assertThat("file cache is empty on non warm nodes", nodeFileCacheStats.size(), Matchers.equalTo(0));
199199

200200
ClusterService clusterService = internalTestCluster.getInstance(ClusterService.class, internalTestCluster.getClusterManagerName());
201201
ClusterState state = clusterService.state();
@@ -216,7 +216,7 @@ public void testClusterInfoServiceCollectsInformation() {
216216

217217
public void testClusterInfoServiceCollectsFileCacheInformation() {
218218
internalCluster().startNodes(1);
219-
internalCluster().ensureAtLeastNumSearchAndDataNodes(2);
219+
internalCluster().ensureAtLeastNumWarmAndDataNodes(2);
220220

221221
InternalTestCluster internalTestCluster = internalCluster();
222222
// Get the cluster info service on the cluster-manager node
@@ -229,7 +229,7 @@ public void testClusterInfoServiceCollectsFileCacheInformation() {
229229
assertNotNull("info should not be null", info);
230230
final Map<String, FileCacheStats> nodeFileCacheStats = info.nodeFileCacheStats;
231231
assertNotNull(nodeFileCacheStats);
232-
assertThat("file cache is enabled on both search nodes", nodeFileCacheStats.size(), Matchers.equalTo(2));
232+
assertThat("file cache is enabled on both warm nodes", nodeFileCacheStats.size(), Matchers.equalTo(2));
233233

234234
for (FileCacheStats fileCacheStats : nodeFileCacheStats.values()) {
235235
assertThat("file cache is non empty", fileCacheStats.getTotal().getBytes(), greaterThan(0L));

server/src/internalClusterTest/java/org/opensearch/indices/replication/WarmIndexSegmentReplicationIT.java

Lines changed: 61 additions & 61 deletions
Large diffs are not rendered by default.

server/src/internalClusterTest/java/org/opensearch/remotestore/WritableWarmIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public void testWritableWarmFeatureFlagDisabled() {
8484

8585
InternalTestCluster internalTestCluster = internalCluster();
8686
internalTestCluster.startClusterManagerOnlyNode(clusterSettings);
87-
internalTestCluster.startDataAndSearchNodes(1);
87+
internalTestCluster.startDataAndWarmNodes(1);
8888

8989
Settings indexSettings = Settings.builder()
9090
.put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1)
@@ -109,7 +109,7 @@ public void testWritableWarmFeatureFlagDisabled() {
109109
public void testWritableWarmBasic() throws Exception {
110110
InternalTestCluster internalTestCluster = internalCluster();
111111
internalTestCluster.startClusterManagerOnlyNode();
112-
internalTestCluster.startDataAndSearchNodes(1);
112+
internalTestCluster.startDataAndWarmNodes(1);
113113
Settings settings = Settings.builder()
114114
.put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1)
115115
.put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0)

server/src/internalClusterTest/java/org/opensearch/snapshots/SearchableSnapshotIT.java

Lines changed: 50 additions & 50 deletions
Large diffs are not rendered by default.

server/src/main/java/org/opensearch/bootstrap/BootstrapChecks.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -758,15 +758,15 @@ public BootstrapCheckResult check(BootstrapContext context) {
758758
}
759759

760760
/**
761-
* Bootstrap check that if a search node contains multiple data paths
761+
* Bootstrap check that if a warm node contains multiple data paths
762762
*/
763763
static class MultipleDataPathCheck implements BootstrapCheck {
764764

765765
@Override
766766
public BootstrapCheckResult check(BootstrapContext context) {
767-
if (NodeRoleSettings.NODE_ROLES_SETTING.get(context.settings()).contains(DiscoveryNodeRole.SEARCH_ROLE)
767+
if (NodeRoleSettings.NODE_ROLES_SETTING.get(context.settings()).contains(DiscoveryNodeRole.WARM_ROLE)
768768
&& Environment.PATH_DATA_SETTING.get(context.settings()).size() > 1) {
769-
return BootstrapCheckResult.failure("Multiple data paths are not allowed for search nodes");
769+
return BootstrapCheckResult.failure("Multiple data paths are not allowed for warm nodes");
770770
}
771771
return BootstrapCheckResult.success();
772772
}

server/src/main/java/org/opensearch/cluster/InternalClusterInfoService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ public void onResponse(NodesStatsResponse nodesStatsResponse) {
274274
nodeFileCacheStats = Collections.unmodifiableMap(
275275
nodesStatsResponse.getNodes()
276276
.stream()
277-
.filter(nodeStats -> nodeStats.getNode().isSearchNode())
277+
.filter(nodeStats -> nodeStats.getNode().isWarmNode())
278278
.collect(Collectors.toMap(nodeStats -> nodeStats.getNode().getId(), NodeStats::getFileCacheStats))
279279
);
280280
}

server/src/main/java/org/opensearch/cluster/node/DiscoveryNode.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,12 @@ public static boolean isRemoteClusterClient(final Settings settings) {
130130
return hasRole(settings, DiscoveryNodeRole.REMOTE_CLUSTER_CLIENT_ROLE);
131131
}
132132

133-
public static boolean isSearchNode(Settings settings) {
134-
return hasRole(settings, DiscoveryNodeRole.SEARCH_ROLE);
133+
public static boolean isWarmNode(Settings settings) {
134+
return hasRole(settings, DiscoveryNodeRole.WARM_ROLE);
135135
}
136136

137-
public static boolean isDedicatedSearchNode(Settings settings) {
138-
return getRolesFromSettings(settings).stream().allMatch(DiscoveryNodeRole.SEARCH_ROLE::equals);
137+
public static boolean isDedicatedWarmNode(Settings settings) {
138+
return getRolesFromSettings(settings).stream().allMatch(DiscoveryNodeRole.WARM_ROLE::equals);
139139
}
140140

141141
private final String nodeName;
@@ -541,12 +541,12 @@ public boolean isRemoteClusterClient() {
541541
}
542542

543543
/**
544-
* Returns whether the node is dedicated to provide search capability.
544+
* Returns whether the node is dedicated to hold warm indices.
545545
*
546-
* @return true if the node contains search role, false otherwise
546+
* @return true if the node contains warm role, false otherwise
547547
*/
548-
public boolean isSearchNode() {
549-
return roles.contains(DiscoveryNodeRole.SEARCH_ROLE);
548+
public boolean isWarmNode() {
549+
return roles.contains(DiscoveryNodeRole.WARM_ROLE);
550550
}
551551

552552
/**

server/src/main/java/org/opensearch/cluster/node/DiscoveryNodeRole.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -298,13 +298,13 @@ public Setting<Boolean> legacySetting() {
298298
};
299299

300300
/**
301-
* Represents the role for a search node, which is dedicated to provide search capability.
301+
* Represents the role for a warm node, which is dedicated to hold warm indices.
302302
*/
303-
public static final DiscoveryNodeRole SEARCH_ROLE = new DiscoveryNodeRole("search", "s", true) {
303+
public static final DiscoveryNodeRole WARM_ROLE = new DiscoveryNodeRole("warm", "w", true) {
304304

305305
@Override
306306
public Setting<Boolean> legacySetting() {
307-
// search role is added in 2.4 so doesn't need to configure legacy setting
307+
// warm role is added in 2.4 so doesn't need to configure legacy setting
308308
return null;
309309
}
310310

@@ -314,7 +314,7 @@ public Setting<Boolean> legacySetting() {
314314
* The built-in node roles.
315315
*/
316316
public static SortedSet<DiscoveryNodeRole> BUILT_IN_ROLES = Collections.unmodifiableSortedSet(
317-
new TreeSet<>(Arrays.asList(DATA_ROLE, INGEST_ROLE, CLUSTER_MANAGER_ROLE, REMOTE_CLUSTER_CLIENT_ROLE, SEARCH_ROLE))
317+
new TreeSet<>(Arrays.asList(DATA_ROLE, INGEST_ROLE, CLUSTER_MANAGER_ROLE, REMOTE_CLUSTER_CLIENT_ROLE, WARM_ROLE))
318318
);
319319

320320
/**

0 commit comments

Comments
 (0)