From 8798069568770e3ea006f26cbe220c649939203e Mon Sep 17 00:00:00 2001 From: Sooraj Sinha Date: Mon, 7 Oct 2024 18:52:34 +0530 Subject: [PATCH] Always send coordination metadata in diff Signed-off-by: Sooraj Sinha --- .../org/opensearch/gateway/remote/ClusterStateDiffManifest.java | 2 +- .../gateway/remote/model/ClusterStateDiffManifestTests.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/org/opensearch/gateway/remote/ClusterStateDiffManifest.java b/server/src/main/java/org/opensearch/gateway/remote/ClusterStateDiffManifest.java index a97b3e1bc6c4b..0309080c971e0 100644 --- a/server/src/main/java/org/opensearch/gateway/remote/ClusterStateDiffManifest.java +++ b/server/src/main/java/org/opensearch/gateway/remote/ClusterStateDiffManifest.java @@ -89,7 +89,7 @@ public ClusterStateDiffManifest( ) { fromStateUUID = previousState.stateUUID(); toStateUUID = state.stateUUID(); - coordinationMetadataUpdated = !Metadata.isCoordinationMetadataEqual(state.metadata(), previousState.metadata()); + coordinationMetadataUpdated = true; settingsMetadataUpdated = !Metadata.isSettingsMetadataEqual(state.metadata(), previousState.metadata()); transientSettingsMetadataUpdated = !Metadata.isTransientSettingsMetadataEqual(state.metadata(), previousState.metadata()); templatesMetadataUpdated = !Metadata.isTemplatesMetadataEqual(state.metadata(), previousState.metadata()); diff --git a/server/src/test/java/org/opensearch/gateway/remote/model/ClusterStateDiffManifestTests.java b/server/src/test/java/org/opensearch/gateway/remote/model/ClusterStateDiffManifestTests.java index e716822939a58..27d5f0167b14d 100644 --- a/server/src/test/java/org/opensearch/gateway/remote/model/ClusterStateDiffManifestTests.java +++ b/server/src/test/java/org/opensearch/gateway/remote/model/ClusterStateDiffManifestTests.java @@ -298,7 +298,7 @@ private ClusterStateDiffManifest updateAndVerifyState( assertEquals(customsToRemove, manifest.getCustomMetadataDeleted()); assertEquals(new ArrayList<>(clusterStateCustomsToAdd.keySet()), manifest.getClusterStateCustomUpdated()); assertEquals(clusterStateCustomsToRemove, manifest.getClusterStateCustomDeleted()); - assertEquals(updateCoordinationState, manifest.isCoordinationMetadataUpdated()); + assertTrue(manifest.isCoordinationMetadataUpdated()); assertEquals(updatePersistentSettings, manifest.isSettingsMetadataUpdated()); assertEquals(updateTemplates, manifest.isTemplatesMetadataUpdated()); assertEquals(updateTransientSettings, manifest.isTransientSettingsMetadataUpdated());