Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add opensearch version info while deserialization #16494

Merged
merged 2 commits into from
Jan 27, 2025

Conversation

soosinha
Copy link
Member

@soosinha soosinha commented Oct 27, 2024

Description

Custom Metadata is serialized writeTo and deserialized using the readFrom method or a constructor with stream input.
For example - ComposableIndexTemplate is serialized using ComposableIndexTemplate.writeTo and deserialized using the stream input constructor.
Consider a case where a new attribute is added in a version. For example context is added in ComposableIndexTemplate from 2.16 onwards. When it serialized from cluster manager of 2.15 version, the context field will not be present. But when the 2.16 cluster manager deserializes the object, it expects context field to be present and breaks.
The fix is to set the opensearch version in the stream input so that the deserialization will not look for new fields.

Related Issues

NA

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

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.

Copy link
Contributor

❌ Gradle check result for f98da36: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

✅ Gradle check result for 7a49332: SUCCESS

Copy link

codecov bot commented Oct 27, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 72.32%. Comparing base (931c1aa) to head (619b4e6).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
...ch/gateway/remote/RemoteGlobalMetadataManager.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #16494      +/-   ##
============================================
+ Coverage     72.30%   72.32%   +0.01%     
+ Complexity    65482    65463      -19     
============================================
  Files          5309     5309              
  Lines        304324   304350      +26     
  Branches      44132    44141       +9     
============================================
+ Hits         220056   220113      +57     
+ Misses        66259    66136     -123     
- Partials      18009    18101      +92     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

❌ Gradle check result for e448dd3: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

✅ Gradle check result for 64c813f: SUCCESS

@soosinha
Copy link
Member Author

How does it work for 2.16 given it is already released and the version might not have been added at the time of serialisation.

It would be broken for 2.16 and 2.17 as well.

@soosinha
Copy link
Member Author

I have used Version.CURRENT because the serialization is always done using the current version. So we have to deserialize using the current version as well in the unit tests.
I am thinking if we can write a BWC integ test where we can verify deserialization from older version.

@shwetathareja
Copy link
Member

shwetathareja commented Oct 28, 2024

I am thinking if we can write a BWC integ test where we can verify deserialization from older version.

there was BWC tested added in mixed mode upgrade test for context aware template fielf. We should check what was missed there. @mgodwan @soosinha

@shwetathareja
Copy link
Member

@soosinha lets add mixed version mode test if it doesn't exist.

Copy link
Contributor

✅ Gradle check result for 4bd03a7: SUCCESS

@soosinha
Copy link
Member Author

Created an issue to track mixed version tests: #16497

@opensearch-trigger-bot
Copy link
Contributor

This PR is stalled because it has been open for 30 days with no activity.

@opensearch-trigger-bot opensearch-trigger-bot bot added stalled Issues that have stalled and removed stalled Issues that have stalled labels Nov 27, 2024
@opensearch-trigger-bot
Copy link
Contributor

This PR is stalled because it has been open for 30 days with no activity.

@opensearch-trigger-bot opensearch-trigger-bot bot added stalled Issues that have stalled and removed stalled Issues that have stalled labels Dec 31, 2024
Copy link
Contributor

❕ Gradle check result for a1c7f26: UNSTABLE

  • TEST FAILURES:
      1 org.opensearch.http.SearchRestCancellationIT.testAutomaticCancellationMultiSearchDuringQueryPhase

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

CHANGELOG.md Outdated Show resolved Hide resolved
Signed-off-by: Sooraj Sinha <[email protected]>
Copy link
Contributor

✅ Gradle check result for 619b4e6: SUCCESS

@shwetathareja shwetathareja merged commit 3032bef into opensearch-project:main Jan 27, 2025
30 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch/backport-2.x
# Create a new branch
git switch --create backport/backport-16494-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 3032bef54d502836789ea438f464ae0b1ba978b2
# Push it to GitHub
git push --set-upstream origin backport/backport-16494-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-16494-to-2.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch backport-failed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants