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

Fix get field mapping API returns 404 error in mixed cluster with multiple versions #13624

Merged
merged 3 commits into from
May 10, 2024

Conversation

gaobinlong
Copy link
Collaborator

@gaobinlong gaobinlong commented May 10, 2024

Description

Fix the bug of get field mapping API returns 404 error intermittently in a mix cluster with multiple versions(1.x and 2.x), the bug is cause by the deserialization method of GetFieldMappingsResponse in 2.x that doesn't handle the stream from 1.x node correctly, if the requested field doesn't exist in the index, then this line in 1.x node writes 0 to the out stream, but in 2.x branch and main branch, we don't take 0 into account, so an exception Expected single type but received [0] is thrown, finally the get field mapping api request returns 404 error.

After this PR is backported to 2.x branch, this flaky test will be resolved.

Related Issues

#13622
#2440

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Failing checks are inspected and point to the corresponding known issue(s) (See: Troubleshooting Failing Builds)
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)
  • Public documentation issue/PR created

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.

…tiple versions

Signed-off-by: Gao Binlong <gbinlong@amazon.com>
Signed-off-by: Gao Binlong <gbinlong@amazon.com>
Copy link
Contributor

✅ Gradle check result for 404d1c1: SUCCESS

Copy link

codecov bot commented May 10, 2024

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 71.64%. Comparing base (b15cb0c) to head (2464237).
Report is 273 commits behind head on main.

Files Patch % Lines
.../indices/mapping/get/GetFieldMappingsResponse.java 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #13624      +/-   ##
============================================
+ Coverage     71.42%   71.64%   +0.22%     
- Complexity    59978    61117    +1139     
============================================
  Files          4985     5052      +67     
  Lines        282275   287146    +4871     
  Branches      40946    41608     +662     
============================================
+ Hits         201603   205730    +4127     
- Misses        63999    64382     +383     
- Partials      16673    17034     +361     

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

Copy link
Contributor

❌ Gradle check result for e3351c5: 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?

Signed-off-by: Gao Binlong <gbinlong@amazon.com>
@reta reta added the backport 2.x Backport to 2.x branch label May 10, 2024
@reta
Copy link
Collaborator

reta commented May 10, 2024

Thanks a lot @gaobinlong !

Copy link
Contributor

❌ Gradle check result for 2464237: 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?

@reta
Copy link
Collaborator

reta commented May 10, 2024

❌ Gradle check result for 2464237: FAILURE

#12197
#13600

Copy link
Contributor

❌ Gradle check result for 2464237: 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?

@reta
Copy link
Collaborator

reta commented May 10, 2024

❌ Gradle check result for 2464237: FAILURE

#13476

Copy link
Contributor

❌ Gradle check result for 2464237: 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?

@reta
Copy link
Collaborator

reta commented May 10, 2024

❌ Gradle check result for 2464237: FAILURE

java.lang.Exception: Suite timeout exceeded (>= 1200000 msec).
	at __randomizedtesting.SeedInfo.seed([4E67A13E835E2CB8]:0)

Copy link
Contributor

✅ Gradle check result for 2464237: SUCCESS

@reta reta merged commit f28e673 into opensearch-project:main May 10, 2024
34 of 39 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request May 10, 2024
…tiple versions (#13624)

* Fix get field mapping API returns 404 error in mixed cluster with multiple versions

Signed-off-by: Gao Binlong <gbinlong@amazon.com>

* modify changelog

Signed-off-by: Gao Binlong <gbinlong@amazon.com>

* Add comment and remove unit test

Signed-off-by: Gao Binlong <gbinlong@amazon.com>

---------

Signed-off-by: Gao Binlong <gbinlong@amazon.com>
(cherry picked from commit f28e673)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
VachaShah pushed a commit that referenced this pull request May 10, 2024
…tiple versions (#13624) (#13625)

* Fix get field mapping API returns 404 error in mixed cluster with multiple versions



* modify changelog



* Add comment and remove unit test



---------


(cherry picked from commit f28e673)

Signed-off-by: Gao Binlong <gbinlong@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
finnegancarroll pushed a commit to finnegancarroll/OpenSearch that referenced this pull request May 10, 2024
…tiple versions (opensearch-project#13624)

* Fix get field mapping API returns 404 error in mixed cluster with multiple versions

Signed-off-by: Gao Binlong <gbinlong@amazon.com>

* modify changelog

Signed-off-by: Gao Binlong <gbinlong@amazon.com>

* Add comment and remove unit test

Signed-off-by: Gao Binlong <gbinlong@amazon.com>

---------

Signed-off-by: Gao Binlong <gbinlong@amazon.com>
deshsidd pushed a commit to deshsidd/OpenSearch that referenced this pull request May 17, 2024
…tiple versions (opensearch-project#13624)

* Fix get field mapping API returns 404 error in mixed cluster with multiple versions

Signed-off-by: Gao Binlong <gbinlong@amazon.com>

* modify changelog

Signed-off-by: Gao Binlong <gbinlong@amazon.com>

* Add comment and remove unit test

Signed-off-by: Gao Binlong <gbinlong@amazon.com>

---------

Signed-off-by: Gao Binlong <gbinlong@amazon.com>
parv0201 pushed a commit to parv0201/OpenSearch that referenced this pull request Jun 10, 2024
…tiple versions (opensearch-project#13624)

* Fix get field mapping API returns 404 error in mixed cluster with multiple versions

Signed-off-by: Gao Binlong <gbinlong@amazon.com>

* modify changelog

Signed-off-by: Gao Binlong <gbinlong@amazon.com>

* Add comment and remove unit test

Signed-off-by: Gao Binlong <gbinlong@amazon.com>

---------

Signed-off-by: Gao Binlong <gbinlong@amazon.com>
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants