-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Conversation
…tiple versions Signed-off-by: Gao Binlong <[email protected]>
Signed-off-by: Gao Binlong <[email protected]>
.../src/main/java/org/opensearch/action/admin/indices/mapping/get/GetFieldMappingsResponse.java
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
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. |
❌ 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? |
...test/java/org/opensearch/action/admin/indices/mapping/get/GetFieldMappingsResponseTests.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Gao Binlong <[email protected]>
Thanks a lot @gaobinlong ! |
❌ 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? |
❌ 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? |
❌ 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? |
…tiple versions (#13624) * Fix get field mapping API returns 404 error in mixed cluster with multiple versions Signed-off-by: Gao Binlong <[email protected]> * modify changelog Signed-off-by: Gao Binlong <[email protected]> * Add comment and remove unit test Signed-off-by: Gao Binlong <[email protected]> --------- Signed-off-by: Gao Binlong <[email protected]> (cherry picked from commit f28e673) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…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 <[email protected]> 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>
…tiple versions (opensearch-project#13624) * Fix get field mapping API returns 404 error in mixed cluster with multiple versions Signed-off-by: Gao Binlong <[email protected]> * modify changelog Signed-off-by: Gao Binlong <[email protected]> * Add comment and remove unit test Signed-off-by: Gao Binlong <[email protected]> --------- Signed-off-by: Gao Binlong <[email protected]>
…tiple versions (opensearch-project#13624) * Fix get field mapping API returns 404 error in mixed cluster with multiple versions Signed-off-by: Gao Binlong <[email protected]> * modify changelog Signed-off-by: Gao Binlong <[email protected]> * Add comment and remove unit test Signed-off-by: Gao Binlong <[email protected]> --------- Signed-off-by: Gao Binlong <[email protected]>
…tiple versions (opensearch-project#13624) * Fix get field mapping API returns 404 error in mixed cluster with multiple versions Signed-off-by: Gao Binlong <[email protected]> * modify changelog Signed-off-by: Gao Binlong <[email protected]> * Add comment and remove unit test Signed-off-by: Gao Binlong <[email protected]> --------- Signed-off-by: Gao Binlong <[email protected]>
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 take0
into account, so an exceptionExpected 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
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.