From 58ca1f1146ad807a0777d71f5bd4764a8e6d79c7 Mon Sep 17 00:00:00 2001 From: Bharathwaj G Date: Wed, 7 Sep 2022 16:02:39 +0530 Subject: [PATCH 1/2] [Backport 2.x] Changed master nomenclature to cluster_manager Signed-off-by: Bharathwaj G --- .../management/AsynchronousSearchManagementService.java | 4 ++-- .../AsynchronousSearchManagementServiceTests.java | 8 ++++---- .../opensearch/search/asynchronous/utils/TestUtils.java | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/opensearch/search/asynchronous/management/AsynchronousSearchManagementService.java b/src/main/java/org/opensearch/search/asynchronous/management/AsynchronousSearchManagementService.java index 6565e615..7c354066 100644 --- a/src/main/java/org/opensearch/search/asynchronous/management/AsynchronousSearchManagementService.java +++ b/src/main/java/org/opensearch/search/asynchronous/management/AsynchronousSearchManagementService.java @@ -128,14 +128,14 @@ private void performPersistedResponseCleanUpAction(AsynchronousSearchCleanUpRequ @Override public void clusterChanged(ClusterChangedEvent event) { - if (event.localNodeMaster() && persistedResponseCleanUpRunnable.get() == null) { + if (event.localNodeClusterManager() && persistedResponseCleanUpRunnable.get() == null) { logger.trace("elected as cluster_manager, triggering response cleanup tasks"); triggerCleanUp(event.state(), "became cluster_manager"); final PersistedResponseCleanUpAndRescheduleRunnable newRunnable = new PersistedResponseCleanUpAndRescheduleRunnable(); persistedResponseCleanUpRunnable.set(newRunnable); threadPool.scheduleUnlessShuttingDown(persistedResponseCleanUpInterval, RESPONSE_CLEANUP_SCHEDULING_EXECUTOR, newRunnable); - } else if (event.localNodeMaster() == false) { + } else if (event.localNodeClusterManager() == false) { persistedResponseCleanUpRunnable.set(null); return; } diff --git a/src/test/java/org/opensearch/search/asynchronous/management/AsynchronousSearchManagementServiceTests.java b/src/test/java/org/opensearch/search/asynchronous/management/AsynchronousSearchManagementServiceTests.java index 9ef64ad1..e0084993 100644 --- a/src/test/java/org/opensearch/search/asynchronous/management/AsynchronousSearchManagementServiceTests.java +++ b/src/test/java/org/opensearch/search/asynchronous/management/AsynchronousSearchManagementServiceTests.java @@ -219,17 +219,17 @@ private static DiscoveryNodes createDiscoveryNodes(final int numNodes, final boo if (i == 0) { //local node id builder.localNodeId(nodeId); - roles.add(DiscoveryNodeRole.MASTER_ROLE); + roles.add(DiscoveryNodeRole.CLUSTER_MANAGER_ROLE); } else if (i == 1) { // the alternate cluster_manager node - roles.add(DiscoveryNodeRole.MASTER_ROLE); + roles.add(DiscoveryNodeRole.CLUSTER_MANAGER_ROLE); } else if (i == 2) { // we need at least one data node roles.add(DiscoveryNodeRole.DATA_ROLE); } else { // remaining nodes can be anything (except for cluster_manager) if (randomBoolean()) { - roles.add(DiscoveryNodeRole.MASTER_ROLE); + roles.add(DiscoveryNodeRole.CLUSTER_MANAGER_ROLE); } if (randomBoolean()) { roles.add(DiscoveryNodeRole.DATA_ROLE); @@ -238,7 +238,7 @@ private static DiscoveryNodes createDiscoveryNodes(final int numNodes, final boo final DiscoveryNode node = newNode(nodeId, roles); builder.add(node); if (i == clusterManagerNodeIndex) { - builder.masterNodeId(nodeId); + builder.clusterManagerNodeId(nodeId); } } return builder.build(); diff --git a/src/test/java/org/opensearch/search/asynchronous/utils/TestUtils.java b/src/test/java/org/opensearch/search/asynchronous/utils/TestUtils.java index f7eef7a3..ad76c683 100644 --- a/src/test/java/org/opensearch/search/asynchronous/utils/TestUtils.java +++ b/src/test/java/org/opensearch/search/asynchronous/utils/TestUtils.java @@ -37,12 +37,12 @@ public static ClusterService createClusterService(Settings settings, ThreadPool .nodes(DiscoveryNodes.builder() .add(localNode) .localNodeId(localNode.getId()) - .masterNodeId(localNode.getId())) + .clusterManagerNodeId(localNode.getId())) .blocks(ClusterBlocks.EMPTY_CLUSTER_BLOCK).build(); clusterService.getClusterApplierService().setInitialState(initialClusterState); - clusterService.getMasterService().setClusterStatePublisher( + clusterService.getClusterManagerService().setClusterStatePublisher( createClusterStatePublisher(clusterService.getClusterApplierService())); - clusterService.getMasterService().setClusterStateSupplier(clusterService.getClusterApplierService()::state); + clusterService.getClusterManagerService().setClusterStateSupplier(clusterService.getClusterApplierService()::state); clusterService.start(); return clusterService; } From f22c41e2aaf7b0248dbe710cd24d8f9cdbeab02d Mon Sep 17 00:00:00 2001 From: Bharathwaj G Date: Tue, 13 Sep 2022 21:17:31 +0530 Subject: [PATCH 2/2] adding release notes for 2.3.0 Signed-off-by: Bharathwaj G --- ...opensearch-asynchronous-search.release-notes-2.3.0.0.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 release-notes/opensearch-asynchronous-search.release-notes-2.3.0.0.md diff --git a/release-notes/opensearch-asynchronous-search.release-notes-2.3.0.0.md b/release-notes/opensearch-asynchronous-search.release-notes-2.3.0.0.md new file mode 100644 index 00000000..0872d440 --- /dev/null +++ b/release-notes/opensearch-asynchronous-search.release-notes-2.3.0.0.md @@ -0,0 +1,7 @@ +## Version 2.3.0.0 2022-09-13 + +Compatible with OpenSearch 2.3.0 + +### Maintenance +* bump version to 2.3.0 ([#174](https://github.com/opensearch-project/asynchronous-search/pull/174)) +* Replace terminology 'master' with 'cluster manager' ([#175](https://github.com/opensearch-project/asynchronous-search/pull/175))