Skip to content

Version bump to OpenSearch 3.7 (Jackson 2 → 3 parser API + _source excludes serialization)#5361

Merged
RyanL1997 merged 8 commits intoopensearch-project:mainfrom
ahkcs:fix-jackson-3-json-parser-compat
Apr 20, 2026
Merged

Version bump to OpenSearch 3.7 (Jackson 2 → 3 parser API + _source excludes serialization)#5361
RyanL1997 merged 8 commits intoopensearch-project:mainfrom
ahkcs:fix-jackson-3-json-parser-compat

Conversation

@ahkcs
Copy link
Copy Markdown
Collaborator

@ahkcs ahkcs commented Apr 16, 2026

Description

Unblocks the OpenSearch 3.7.0-SNAPSHOT bump (#5296) end-to-end. Two coordinated API drifts in 3.7 needed fixes across this plugin:

  1. Jackson 2 → 3 migration. OpenSearch 3.7 migrated its internal Jackson dependency from Jackson 2 (com.fasterxml.jackson.*) to Jackson 3 (tools.jackson.*). Both Jacksons coexist on the classpath (different packages), but the public JsonXContentParser and YamlXContentParser constructors leak the Jackson type in their signatures, so every call site that built these parsers by handing in a Jackson 2 JsonParser/YAMLParser fails to compile against 3.7. Jackson 3 also rephrased its duplicate-field error from Duplicate field 'name' to Duplicate Object property \"name\".

  2. FetchSourceContext serialization. 3.7 no longer emits \"excludes\":[] when the list is empty, so every golden-file fixture, doctest, and assertion that captured the older serialization drifted.

Fix

  • Parser construction. Swap new JsonXContentParser(..., new JsonFactory().createParser(...)) for JsonXContent.jsonXContent.createParser(registry, handler, String) (and YamlXContent.yamlXContent.createParser for YAML). The factory's signature takes a plain String, hiding Jackson's type so the underlying 2→3 migration is invisible to callers.
  • Jackson 3 wording. Update the duplicate-field assertion in CreateAsyncQueryRequestConverterTest to match the new phrasing.
  • Empty excludes sweep. Drop ,\"excludes\":[] (and its pretty/YAML-folded variants) from golden fixtures (expectedOutput/**, legacy explain fixtures, yamlRestTest), top-hits assertions in MetricAggregationBuilderTest, doctest markdown/rst, and dev/user docs.
  • Default version bump. Set opensearch.version default to 3.7.0-SNAPSHOT so CI exercises the fix end-to-end; [AUTO] Increment version to 3.7.0-SNAPSHOT #5296 can be closed in favor of this PR.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

OpenSearch 3.7.0 migrated JsonXContentParser's constructor to accept
tools.jackson.core.JsonParser (Jackson 3) instead of
com.fasterxml.jackson.core.JsonParser (Jackson 2), breaking compilation
since JsonNode.traverse() still returns the Jackson 2 parser.

Switch to the public JsonXContent.createParser(registry, handler, String)
API, which has a stable signature across both Jackson versions.

Signed-off-by: Kai Huang <ahkcs@amazon.com>
Signed-off-by: Kai Huang <ahkcs@amazon.com>
@ahkcs ahkcs added skip-diff-analyzer Maintainer to skip code-diff-analyzer check, after reviewing issues in AI analysis. skip-diff-reviewer Maintainer to skip code-diff-reviewer check, after reviewing issues in AI analysis. maintenance Improves code quality, but not the product labels Apr 16, 2026
OpenSearch 3.7.0's JsonXContentParser constructor requires Jackson 3's
tools.jackson.core.JsonParser, but call sites were passing Jackson 2's
com.fasterxml.jackson.core.JsonParser (via JsonFactory.createParser).

Switch all such call sites to JsonXContent.jsonXContent.createParser
(and YamlXContent.yamlXContent.createParser in HintFactory), which take
a plain String and hide Jackson's type in their signatures, so the
underlying migration is invisible to callers.

Signed-off-by: Kai Huang <ahkcs@amazon.com>
@ahkcs ahkcs changed the title Fix Jackson 3 compatibility in OpenSearchJsonContent Migrate JsonXContentParser callers for OpenSearch 3.7 Jackson 3 bump Apr 16, 2026
ahkcs added 2 commits April 16, 2026 14:49
In OpenSearch 3.7, FetchSourceContext no longer serializes an empty
"excludes":[] array. Strip it from the expected explain output in the
PPL endpoint and optimization docs to match the new format.

Signed-off-by: Kai Huang <ahkcs@amazon.com>
Jackson 3 reports duplicate JSON fields as "Duplicate Object property
\"name\"" instead of Jackson 2's "Duplicate field 'name'". Adjust the
async-query converter test to match the new phrasing surfaced via
OpenSearch 3.7's xcontent layer.

Signed-off-by: Kai Huang <ahkcs@amazon.com>
@opensearch-project opensearch-project deleted a comment from github-actions Bot Apr 16, 2026
@opensearch-project opensearch-project deleted a comment from github-actions Bot Apr 16, 2026
@opensearch-project opensearch-project deleted a comment from github-actions Bot Apr 16, 2026
OpenSearch 3.7's FetchSourceContext no longer emits "excludes":[] when
empty. Update the two top_hits assertions in MetricAggregationBuilderTest
to match the new serialization.

Signed-off-by: Kai Huang <ahkcs@amazon.com>
@ahkcs ahkcs added the v3.7.0 Issues targeting release v3.7.0 label Apr 16, 2026
OpenSearch 3.7's FetchSourceContext no longer emits "excludes":[] when
the list is empty. Sweep remaining fixtures (expectedOutput/**, legacy
explain fixtures, yamlRestTest) and user docs to drop the stale field
so textual comparisons match the new server output.

YAML fixtures using `|` literal block style (most calcite/*) apply
cleanly; a few legacy ppl/*.yaml fixtures that use folded double-quoted
strings may need fold-offset regeneration once those ITs surface.

Signed-off-by: Kai Huang <ahkcs@amazon.com>
@ahkcs ahkcs changed the title Migrate JsonXContentParser callers for OpenSearch 3.7 Jackson 3 bump Migrate to OpenSearch 3.7 (Jackson 2 → 3 parser API + _source excludes serialization) Apr 16, 2026
@ahkcs ahkcs changed the title Migrate to OpenSearch 3.7 (Jackson 2 → 3 parser API + _source excludes serialization) Version bump to OpenSearch 3.7 (Jackson 2 → 3 parser API + _source excludes serialization) Apr 16, 2026
Swiddis
Swiddis previously approved these changes Apr 16, 2026
Copy link
Copy Markdown
Collaborator

@Swiddis Swiddis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

diff too small, plz also add an autoformatting change or something

The earlier sweep stripped `,"excludes":[]` textually but left the
surrounding YAML double-quoted string folds at their old column
positions. Once the embedded JSON shrinks, the server's emitter folds
at different offsets, so the checked-in fixtures diverged from actual
output. Regenerate the 47 affected legacy-path fixtures under
expectedOutput/ppl/{,big5/} from a live 3.7-SNAPSHOT cluster so fold
offsets match byte-for-byte.

Signed-off-by: Kai Huang <ahkcs@amazon.com>
@RyanL1997 RyanL1997 merged commit d7a30c0 into opensearch-project:main Apr 20, 2026
58 of 61 checks passed
@sandeshkr419
Copy link
Copy Markdown
Member

@ahkcs Thanks for working on this - I was blocked on this. :)

@ahkcs ahkcs deleted the fix-jackson-3-json-parser-compat branch April 20, 2026 22:40
ahkcs added a commit to ahkcs/sql that referenced this pull request Apr 29, 2026
…cludes serialization) (opensearch-project#5361)

Signed-off-by: Kai Huang <ahkcs@amazon.com>
ahkcs added a commit to ahkcs/sql that referenced this pull request Apr 30, 2026
…cludes serialization) (opensearch-project#5361)

Signed-off-by: Kai Huang <ahkcs@amazon.com>
ahkcs added a commit that referenced this pull request Apr 30, 2026
* Version bump to OpenSearch 3.7 (Jackson 2 → 3 parser API + _source excludes serialization) (#5361)

Signed-off-by: Kai Huang <ahkcs@amazon.com>

* Update vendored analytics JARs from 3.6 to 3.7

Replace libs/ JARs with 3.7.0-SNAPSHOT versions built from the
OpenSearch sandbox. Update build files to reference 3.7 file names.
Keep files() references instead of Maven coordinates so CI can
resolve dependencies without publishToMavenLocal.

Signed-off-by: Ahmed Khatib <ahkcs@amazon.com>
Signed-off-by: Kai Huang <ahkcs@amazon.com>

* Async QueryPlanExecutor + drop stub and stub-only ITs

The analytics-framework 3.7 QueryPlanExecutor interface is async
(void execute(plan, ctx, ActionListener<Stream>)). Update
AnalyticsExecutionEngine to dispatch via the listener instead of the
old synchronous return-value form, and rework the unit test mocks
likewise.

Drop StubQueryPlanExecutor and its callers (TransportPPLQueryAction,
SQLPlugin, RestUnifiedQueryActionTest); the SQL plugin now expects
the real analytics-engine executor to be supplied via Guice
cross-plugin injection (a small AnalyticsExecutorHolder bridges the
binding to the SQLPlugin REST handler that runs before Node injection).

Drop AnalyticsPPLIT and AnalyticsExplainIT (and their
expectedOutput/analytics fixtures): these tested stub canned data
which no longer exists.

Signed-off-by: Kai Huang <ahkcs@amazon.com>

---------

Signed-off-by: Kai Huang <ahkcs@amazon.com>
Signed-off-by: Ahmed Khatib <ahkcs@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Improves code quality, but not the product skip-diff-analyzer Maintainer to skip code-diff-analyzer check, after reviewing issues in AI analysis. skip-diff-reviewer Maintainer to skip code-diff-reviewer check, after reviewing issues in AI analysis. v3.7.0 Issues targeting release v3.7.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants