OpenSearch icon indicating copy to clipboard operation
OpenSearch copied to clipboard

Fix bulk upsert ignores the default_pipeline and final_pipeline when the auto-created index matches the index template

Open gaobinlong opened this issue 1 year ago • 8 comments

Description

When executing update action with upsert in bulk API, if the specified index doesn't exist and the index matches an existing index template, we don't resolve the default pipeline and final pipeline in the template correctly, that's because the index field is null in the indexRequest, so the code block which resolves pipelines from the template under this branch will never execute in this case.

This PR fixes the bug and add some test cases for it.

Related Issues

https://github.com/opensearch-project/OpenSearch/issues/12888

Check List

  • [x] New functionality includes testing.
    • [x] All tests pass
  • [x] New functionality has been documented.
    • [x] New functionality has javadoc added
  • [x] Failing checks are inspected and point to the corresponding known issue(s) (See: Troubleshooting Failing Builds)
  • [x] Commits are signed per the DCO using --signoff
  • [x] Commit changes are listed out in CHANGELOG.md file (See: Changelog)
  • [x] 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.

gaobinlong avatar Mar 25 '24 12:03 gaobinlong

Compatibility status:

Checks if related components are compatible with change 879908e

Incompatible components

Skipped components

Compatible components

Compatible components: [https://github.com/opensearch-project/custom-codecs.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/flow-framework.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/performance-analyzer.git]

github-actions[bot] avatar Mar 25 '24 13:03 github-actions[bot]

:white_check_mark: Gradle check result for e263910be5cb3afe1f460d450fda50867f5dac0e: SUCCESS

github-actions[bot] avatar Mar 25 '24 13:03 github-actions[bot]

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 71.82%. Comparing base (ba9bdac) to head (5f9e304). Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main   #12891   +/-   ##
=========================================
  Coverage     71.81%   71.82%           
- Complexity    62254    62272   +18     
=========================================
  Files          5127     5127           
  Lines        292714   292714           
  Branches      42343    42343           
=========================================
+ Hits         210222   210242   +20     
+ Misses        65165    65084   -81     
- Partials      17327    17388   +61     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Mar 25 '24 13:03 codecov[bot]

:x: Gradle check result for f74b0b8191c12106aae04a2807861aa8ae092f7c: 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?

github-actions[bot] avatar Mar 25 '24 13:03 github-actions[bot]

:white_check_mark: Gradle check result for 50ac227ec71b0a69e46b38c8ca2836aae4af535f: SUCCESS

github-actions[bot] avatar Mar 25 '24 15:03 github-actions[bot]

Hi @reta, could you help to review this PR, thank you!

gaobinlong avatar Apr 08 '24 10:04 gaobinlong

:white_check_mark: Gradle check result for 879908ec0590b592a416731671fe9de639b82826: SUCCESS

github-actions[bot] avatar Apr 08 '24 11:04 github-actions[bot]

:x: Gradle check result for b3e0394a6e766ef1682e0da21e156ea2c0d5e944: 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?

github-actions[bot] avatar May 09 '24 10:05 github-actions[bot]

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

:x: Gradle check result for d85bca72345080ba3da89237a56cf5d743d92a0e: 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?

github-actions[bot] avatar Jul 16 '24 10:07 github-actions[bot]

:x: Gradle check result for dd79c54539dc50d68dd945a9daa6a8c7847e8583: 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?

github-actions[bot] avatar Jul 16 '24 10:07 github-actions[bot]

:x: Gradle check result for f64114d097e558c4f5d1812b96a3ae72496bcd32: 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?

github-actions[bot] avatar Jul 16 '24 11:07 github-actions[bot]

:white_check_mark: Gradle check result for 5f9e3047e6ab1d96d432c57461616a1a3ea16701: SUCCESS

github-actions[bot] avatar Jul 16 '24 13:07 github-actions[bot]

@andrross @msfroh mind please checking this small change? (in case we are missing something) thank you.

reta avatar Jul 16 '24 14:07 reta