Skip to content

chore(deps): bump OpenSearch to 3.7.0#24

Merged
marevol merged 5 commits into
mainfrom
chore/bump-opensearch-3.7.0
Jun 11, 2026
Merged

chore(deps): bump OpenSearch to 3.7.0#24
marevol merged 5 commits into
mainfrom
chore/bump-opensearch-3.7.0

Conversation

@marevol

@marevol marevol commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Upgrade the OpenSearch dependency from 3.6.0 to 3.7.0, following the OpenSearch 3.7.0 release, bump the project version accordingly, and implement proper parsing for the node stats added in 3.7.0.

Changes Made

  • Bumped opensearch.version in pom.xml from 3.6.0 to 3.7.0
  • Bumped the project version from 3.6.1-SNAPSHOT to 3.7.0-SNAPSHOT to track the OpenSearch version
  • Bumped log4j from 2.25.3 to 2.25.4
  • Updated the test container image version in OpenSearch3ClientTest from 3.5.0 to 3.7.0 (public.ecr.aws/opensearchproject/opensearch:3.7.0)
  • Updated the dependency examples in README.md (Maven/Gradle) to 3.7.0
  • Implemented parsing in HttpNodesStatsAction for the five NodeStats fields added in the OpenSearch 3.7.0 API (instead of passing null):
    • Parse the native_memory section (always present in 3.7.0 responses): total_estimated_bytestotalEstimatedNativeBytes, analytics_backendAnalyticsBackendNativeMemoryStats, and native_allocator (root + per-pool stats) → NativeAllocatorPoolStats
    • Support file cache detailed mode: when NodesStatsRequest.isFileCacheDetailed() (new in 3.7.0) is set, append detailed=true to the request URL and parse the resulting file_cache (fileCacheOnlyStats) and block_cache (BlockCacheStats) sections
    • When a section is absent (OpenSearch 1.x/2.x, Elasticsearch 7/8, or pre-3.7 servers), all values keep their previous defaults (null / -1L, the sentinel OpenSearch itself uses)
  • Fixed a pre-existing dispatch bug: fileCacheStats is emitted under the aggregate_file_cache key (since 3.6.0), not file_cache, so it was silently skipped before; it is now parsed correctly

Testing

  • Confirmed that org.opensearch:opensearch:3.7.0, log4j 2.25.4, and the OpenSearch 3.7.0 image (ECR Public) are all available
  • mvn clean test-compile passes against 3.7.0
  • Added 18 unit tests to HttpNodesStatsActionTest (79 total, no Docker required) covering the new parsers (native_memory, aggregate_file_cache, detailed file_cache, block_cache), default preservation when sections are absent, unknown-field robustness, and the detailed=true query parameter
  • Integration tests via Testcontainers against real containers: OpenSearch3ClientTest (73 tests) and OpenSearch2ClientTest (37 tests) — 110 tests, 0 failures, confirming both the new parsing on 3.7.0 and no regression on 2.x

Breaking Changes

  • None

Additional Notes

  • BlockCacheStats reconstruction is partial by design: the server's toXContent does not emit hitBytes, missBytes, eviction/removal counts, or the memory/disk usage split, so those record components are set to 0 (the combined used_in_bytes is assigned to memoryBytesUsed so re-serialization reproduces the same JSON value)
  • The "Maven 3.6.0 or higher" mentions in README refer to the build tool requirement, not OpenSearch, and are intentionally unchanged

marevol added 5 commits June 11, 2026 15:16
Implement proper JSON parsing in HttpNodesStatsAction for the five
NodeStats fields added in OpenSearch 3.7.0:

- Parse the "native_memory" section (always present in 3.7.0):
  total_estimated_bytes, analytics_backend
  (AnalyticsBackendNativeMemoryStats), and native_allocator
  (NativeAllocatorPoolStats with root and per-pool stats).
- Support file cache detailed mode: append detailed=true to the
  request URL when NodesStatsRequest.isFileCacheDetailed() is set,
  and parse the resulting "file_cache" (fileCacheOnlyStats) and
  "block_cache" (BlockCacheStats) sections.
- Fix a pre-existing dispatch bug: fileCacheStats is emitted under
  the "aggregate_file_cache" key (since 3.6.0), not "file_cache",
  so it was never parsed before.

When a section is absent (OpenSearch 1.x/2.x, Elasticsearch 7/8, or
pre-3.7 servers) all values keep their previous defaults (null/-1L).

Verified with OpenSearch3ClientTest and OpenSearch2ClientTest
(110 tests, 0 failures) against real containers.
Cover the parsing added for the five NodeStats fields new in 3.7.0:

- parseNativeAllocatorPoolStats, parseAnalyticsBackendNativeMemoryStats,
  and parseBlockCacheStats helpers (full parse, empty objects, and
  fields the server does not emit remaining 0)
- parseNodeStats dispatch: native_memory (full/minimal/absent/empty,
  unknown nested object skipped), aggregate_file_cache populating
  fileCacheStats (regression test for the dispatch fix), detailed
  file_cache populating fileCacheOnlyStats, and block_cache
- defaults preserved (null / -1L) when sections are absent, matching
  OpenSearch 1.x/2.x and Elasticsearch responses
- all new sections combined with existing ones in a single response
  to guard against parser-position bugs
- getCurlRequest appending detailed=true only when
  NodesStatsRequest.isFileCacheDetailed() is set

79 tests in HttpNodesStatsActionTest, no Docker required.
@marevol marevol merged commit acd8b51 into main Jun 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant