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

Compatibility issue with /_mget: RHLC 2.x connected to OpenSearch Cluster 1.x #4812

Merged
merged 1 commit into from
Oct 21, 2022

Conversation

reta
Copy link
Collaborator

@reta reta commented Oct 17, 2022

Signed-off-by: Andriy Redko andriy.redko@aiven.io

Description

There is a compatibility issue with /_mget API: RHLC 2.x connected to OpenSearch Cluster 1.x, which basically renders the API unusable in certain cases, ending up with NullPointerException.

Exception in thread "main" java.io.IOException: Unable to parse response body for Response{requestLine=POST /_mget HTTP/1.1, host=http://localhost:9200, response=HTTP/1.1 200 OK}
	at org.opensearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1777)
	at org.opensearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1724)
	at org.opensearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:1692)
	at org.opensearch.client.RestHighLevelClient.mget(RestHighLevelClient.java:751)
	at io.aven.opensearch.client_runners.RestClientMultigetRunner.main(RestClientMultigetRunner.java:29)
Caused by: java.lang.NullPointerException
	at org.opensearch.index.get.GetResult.fromXContentEmbedded(GetResult.java:411)
	at org.opensearch.action.get.MultiGetResponse.parseItem(MultiGetResponse.java:216)
	at org.opensearch.action.get.MultiGetResponse.fromXContent(MultiGetResponse.java:189)
	at org.opensearch.client.RestHighLevelClient.parseEntity(RestHighLevelClient.java:2075)
	at org.opensearch.client.RestHighLevelClient.lambda$performRequestAndParseEntity$8(RestHighLevelClient.java:1692)
	at org.opensearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1775)
	... 4 more

Issues Resolved

Closes #4749

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)

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.

@reta reta requested a review from a team as a code owner October 17, 2022 16:25
@reta reta added v3.0.0 Issues and PRs related to version 3.0.0 backport 2.x Backport to 2.x branch backport 2.0 Backport to 2.0 branch backport 2.1 backport 2.2 Backport to 2.2 branch backport 2.3 Backports to 2.3 branch labels Oct 17, 2022
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@codecov-commenter
Copy link

codecov-commenter commented Oct 17, 2022

Codecov Report

Merging #4812 (1307e4b) into main (cdc7a2f) will decrease coverage by 0.03%.
The diff coverage is 50.00%.

@@             Coverage Diff              @@
##               main    #4812      +/-   ##
============================================
- Coverage     70.74%   70.71%   -0.04%     
- Complexity    57888    57898      +10     
============================================
  Files          4689     4689              
  Lines        277305   277298       -7     
  Branches      40370    40364       -6     
============================================
- Hits         196190   196091      -99     
- Misses        64794    64967     +173     
+ Partials      16321    16240      -81     
Impacted Files Coverage Δ
...reness/get/GetDecommissionStateRequestBuilder.java 0.00% <0.00%> (ø)
...eness/get/TransportGetDecommissionStateAction.java 23.07% <0.00%> (-1.93%) ⬇️
.../org/opensearch/client/support/AbstractClient.java 32.30% <ø> (-0.24%) ⬇️
.../admin/cluster/RestGetDecommissionStateAction.java 42.85% <25.00%> (-17.15%) ⬇️
...on/awareness/get/GetDecommissionStateResponse.java 42.85% <47.36%> (-1.92%) ⬇️
...va/org/opensearch/action/get/MultiGetResponse.java 70.32% <50.00%> (-0.46%) ⬇️
...ion/awareness/get/GetDecommissionStateRequest.java 82.35% <83.33%> (+82.35%) ⬆️
...adonly/AddIndexBlockClusterStateUpdateRequest.java 0.00% <0.00%> (-75.00%) ⬇️
...readonly/TransportVerifyShardIndexBlockAction.java 9.75% <0.00%> (-58.54%) ⬇️
...ava/org/opensearch/action/NoSuchNodeException.java 0.00% <0.00%> (-50.00%) ⬇️
... and 468 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

// In mixed clusters, the 1.x cluster could still return the '_type' in the response payload, it has to
// be handled gracefully
@Deprecated(forRemoval = true)
private static final ParseField TYPE = new ParseField("_type");
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@nknize no objections for this change from your side? thank you!

Copy link
Collaborator

Choose a reason for hiding this comment

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

no objections since it's a compatibility issue! Especially w/ the clear deprecation. Nice!

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

Copy link
Collaborator

@nknize nknize left a comment

Choose a reason for hiding this comment

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

Nice to have the additional testing! Thx!

// In mixed clusters, the 1.x cluster could still return the '_type' in the response payload, it has to
// be handled gracefully
@Deprecated(forRemoval = true)
private static final ParseField TYPE = new ParseField("_type");
Copy link
Collaborator

Choose a reason for hiding this comment

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

no objections since it's a compatibility issue! Especially w/ the clear deprecation. Nice!

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@dblock
Copy link
Member

dblock commented Oct 21, 2022

I believe this has been fixed in #4270, rebase?

…ster 1.x

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@reta reta merged commit d85f8cd into opensearch-project:main Oct 21, 2022
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

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

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.x 2.x
# Navigate to the new working tree
cd .worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-4812-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 d85f8cdcf90c2139beaaf953cd89bce86b9ce672
# Push it to GitHub
git push --set-upstream origin backport/backport-4812-to-2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.x

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

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.0 failed:

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

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.0 2.0
# Navigate to the new working tree
cd .worktrees/backport-2.0
# Create a new branch
git switch --create backport/backport-4812-to-2.0
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 d85f8cdcf90c2139beaaf953cd89bce86b9ce672
# Push it to GitHub
git push --set-upstream origin backport/backport-4812-to-2.0
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.0

Then, create a pull request where the base branch is 2.0 and the compare/head branch is backport/backport-4812-to-2.0.

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.1 failed:

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

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.1 2.1
# Navigate to the new working tree
cd .worktrees/backport-2.1
# Create a new branch
git switch --create backport/backport-4812-to-2.1
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 d85f8cdcf90c2139beaaf953cd89bce86b9ce672
# Push it to GitHub
git push --set-upstream origin backport/backport-4812-to-2.1
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.1

Then, create a pull request where the base branch is 2.1 and the compare/head branch is backport/backport-4812-to-2.1.

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.2 failed:

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

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.2 2.2
# Navigate to the new working tree
cd .worktrees/backport-2.2
# Create a new branch
git switch --create backport/backport-4812-to-2.2
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 d85f8cdcf90c2139beaaf953cd89bce86b9ce672
# Push it to GitHub
git push --set-upstream origin backport/backport-4812-to-2.2
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.2

Then, create a pull request where the base branch is 2.2 and the compare/head branch is backport/backport-4812-to-2.2.

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.3 failed:

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

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.3 2.3
# Navigate to the new working tree
cd .worktrees/backport-2.3
# Create a new branch
git switch --create backport/backport-4812-to-2.3
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 d85f8cdcf90c2139beaaf953cd89bce86b9ce672
# Push it to GitHub
git push --set-upstream origin backport/backport-4812-to-2.3
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.3

Then, create a pull request where the base branch is 2.3 and the compare/head branch is backport/backport-4812-to-2.3.

reta added a commit to reta/OpenSearch that referenced this pull request Oct 21, 2022
…ster 1.x (opensearch-project#4812)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
(cherry picked from commit d85f8cd)
reta added a commit to reta/OpenSearch that referenced this pull request Oct 21, 2022
…ster 1.x (opensearch-project#4812)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
(cherry picked from commit d85f8cd)
reta added a commit to reta/OpenSearch that referenced this pull request Oct 21, 2022
…ster 1.x (opensearch-project#4812)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
(cherry picked from commit d85f8cd)
reta added a commit to reta/OpenSearch that referenced this pull request Oct 21, 2022
…ster 1.x (opensearch-project#4812)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
(cherry picked from commit d85f8cd)
reta added a commit to reta/OpenSearch that referenced this pull request Oct 21, 2022
…ster 1.x (opensearch-project#4812)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
(cherry picked from commit d85f8cd)
reta added a commit to reta/OpenSearch that referenced this pull request Oct 21, 2022
…ster 1.x (opensearch-project#4812)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
(cherry picked from commit d85f8cd)
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
reta added a commit to reta/OpenSearch that referenced this pull request Oct 21, 2022
…ster 1.x (opensearch-project#4812)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
(cherry picked from commit d85f8cd)
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
reta added a commit to reta/OpenSearch that referenced this pull request Oct 21, 2022
…ster 1.x (opensearch-project#4812)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
(cherry picked from commit d85f8cd)
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
reta added a commit to reta/OpenSearch that referenced this pull request Oct 21, 2022
…ster 1.x (opensearch-project#4812)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
(cherry picked from commit d85f8cd)
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
reta added a commit to reta/OpenSearch that referenced this pull request Oct 21, 2022
…ster 1.x (opensearch-project#4812)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
(cherry picked from commit d85f8cd)
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
reta added a commit to reta/OpenSearch that referenced this pull request Oct 21, 2022
…ster 1.x (opensearch-project#4812)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
(cherry picked from commit d85f8cd)
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
dblock pushed a commit that referenced this pull request Oct 24, 2022
…ster 1.x (#4812) (#4878)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
(cherry picked from commit d85f8cd)
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
dblock pushed a commit that referenced this pull request Oct 24, 2022
…ster 1.x (#4812) (#4876)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
(cherry picked from commit d85f8cd)
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
dblock pushed a commit that referenced this pull request Oct 24, 2022
…ster 1.x (#4812) (#4875)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
(cherry picked from commit d85f8cd)
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
dblock pushed a commit that referenced this pull request Oct 24, 2022
…ster 1.x (#4812) (#4879)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
(cherry picked from commit d85f8cd)
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
dblock pushed a commit that referenced this pull request Oct 24, 2022
…ster 1.x (#4812) (#4877)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
(cherry picked from commit d85f8cd)
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
snuyanzin pushed a commit to snuyanzin/OpenSearch that referenced this pull request Oct 28, 2022
…ster 1.x (opensearch-project#4812)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
ashking94 pushed a commit to ashking94/OpenSearch that referenced this pull request Nov 7, 2022
…ster 1.x (opensearch-project#4812)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
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 2.0 Backport to 2.0 branch backport 2.1 backport 2.2 Backport to 2.2 branch backport 2.3 Backports to 2.3 branch v3.0.0 Issues and PRs related to version 3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Compatibility issue with /_mget: RHLC 2.x connected to OpenSearch Cluster 1.x
5 participants