diff --git a/CHANGELOG.md b/CHANGELOG.md index b09cd6d302506..5ec037f48ff3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -102,7 +102,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - [Workload Management] Fixing Create/Update QueryGroup TransportActions to execute from non-cluster manager nodes ([16422](https://github.com/opensearch-project/OpenSearch/pull/16422)) - Fix flaky test in `testApproximateRangeWithSizeOverDefault` by adjusting totalHits assertion logic ([#16434](https://github.com/opensearch-project/OpenSearch/pull/16434#pullrequestreview-2386999409)) - Revert changes to upload remote state manifest using minimum codec version([#16403](https://github.com/opensearch-project/OpenSearch/pull/16403)) -- Use OpenSearch version to deserializat remote custom metadata([#16494](https://github.com/opensearch-project/OpenSearch/pull/16494)) +- Use OpenSearch version to deserialize remote custom metadata([#16494](https://github.com/opensearch-project/OpenSearch/pull/16494)) ### Security diff --git a/server/src/test/java/org/opensearch/gateway/remote/RemoteGlobalMetadataManagerTests.java b/server/src/test/java/org/opensearch/gateway/remote/RemoteGlobalMetadataManagerTests.java index 9c63c56985b0b..591fbf31a3021 100644 --- a/server/src/test/java/org/opensearch/gateway/remote/RemoteGlobalMetadataManagerTests.java +++ b/server/src/test/java/org/opensearch/gateway/remote/RemoteGlobalMetadataManagerTests.java @@ -481,6 +481,12 @@ public void testGetAsyncWriteRunnable_TemplatesMetadata() throws Exception { } public void testGetAsyncReadRunnable_CustomMetadata() throws Exception { + for (Version version : List.of(Version.CURRENT, Version.V_2_15_0, Version.V_2_13_0)) { + verifyCustomMetadataReadForVersion(version); + } + } + + private void verifyCustomMetadataReadForVersion(Version version) throws Exception { Metadata.Custom customMetadata = getCustomMetadata(); String fileName = randomAlphaOfLength(10); RemoteCustomMetadata customMetadataForDownload = new RemoteCustomMetadata( @@ -489,7 +495,7 @@ public void testGetAsyncReadRunnable_CustomMetadata() throws Exception { CLUSTER_UUID, compressor, namedWriteableRegistry, - Version.CURRENT + version ); when(blobStoreTransferService.downloadBlob(anyIterable(), anyString())).thenReturn( customMetadataForDownload.customBlobStoreFormat.serialize(customMetadata, fileName, compressor).streamInput() @@ -697,4 +703,5 @@ public void testGetUpdatedCustoms() { assertThat(customsDiff.getUpserts(), is(expectedUpserts)); assertThat(customsDiff.getDeletes(), is(List.of(CustomMetadata1.TYPE))); } + }