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

Disable index refresh for system indices #915

Conversation

martin-gaievski
Copy link
Member

Description

Standard method refreshAllIndices refreshes all indices including system. This produces error warnings when running integration tests for indices like '.opensearch-knn-models'. In this change we're filtering indices and do refresh only if its name doesn't start with system prefix.

Suite: Test class org.opensearch.knn.index.FaissIT
  2> may 25, 2023 8:29:50 PM org.opensearch.client.RestClient logResponse
  2> AVERTISSEMENT: request [POST http://localhost:9200/_refresh?expand_wildcards=open%2Chidden] returned 2 warnings: [299 OpenSearch-2.8.0-4bd47e16e300cd6147d24e329ac05014fd61cb80 "this request accesses system indices: [.opendistro_security], but in a future major version, direct access to system indices will be prevented by default"],[299 OpenSearch-2.8.0-4bd47e16e300cd6147d24e329ac05014fd61cb80 "this request accesses system indices: [.opensearch-knn-models], but in a future major version, direct access to system indices will be prevented by default"]
  2> REPRODUCE WITH: ./gradlew ':integTest' --tests "org.opensearch.knn.index.FaissIT.testEndToEnd_fromMethod" -Dtests.seed=BFA60D37E99638AE -Dtests.security.manager=false -Dtests.locale=fr-LU -Dtests.timezone=Europe/Kirov -Druntime.java=17
  2> org.opensearch.client.WarningFailureException: method [POST], host [http://localhost:9200], URI [/_refresh?expand_wildcards=open%2Chidden], status line [HTTP/1.1 200 OK]
    Warnings: [this request accesses system indices: [.opendistro_security], but in a future major version, direct access to system indices will be prevented by default, this request accesses system indices: [.opensearch-knn-models], but in a future major version, direct access to system indices will be prevented by default]
    {"_shards":{"total":6,"successful":4,"failed":0}}
        at __randomizedtesting.SeedInfo.seed([BFA60D37E99638AE:5576685C932D3555]:0)
        at app//org.opensearch.client.RestClient.convertResponse(RestClient.java:371)
        at app//org.opensearch.client.RestClient.performRequest(RestClient.java:345)
        at app//org.opensearch.client.RestClient.performRequest(RestClient.java:320)
        at app//org.opensearch.test.rest.OpenSearchRestTestCase.refreshAllIndices(OpenSearchRestTestCase.java:728)
        at app//org.opensearch.knn.index.FaissIT.testEndToEnd_fromMethod(FaissIT.java:109)
  2> NOTE: leaving temporary files on disk at: /tmp/tmpjewtggaq/k-NN/build/testrun/integTes

Issues Resolved

#914

Check List

  • All tests pass
  • Commits are signed as per the DCO using --signoff

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.

@martin-gaievski martin-gaievski changed the title Do refresh only for non system indices Disable index refresh for system indices May 25, 2023
@martin-gaievski martin-gaievski force-pushed the fix-system-index-refresh-in-integ-tests branch from b2debe1 to 73cda11 Compare May 25, 2023 21:59
@martin-gaievski martin-gaievski added the Infrastructure Changes to infrastructure, testing, CI/CD, pipelines, etc. label May 25, 2023
@martin-gaievski martin-gaievski marked this pull request as ready for review May 25, 2023 22:15
@codecov
Copy link

codecov bot commented May 25, 2023

Codecov Report

Merging #915 (b2debe1) into main (1b7baf6) will decrease coverage by 0.25%.
The diff coverage is n/a.

❗ Current head b2debe1 differs from pull request most recent head 73cda11. Consider uploading reports for the commit 73cda11 to get more accurate results

@@             Coverage Diff              @@
##               main     #915      +/-   ##
============================================
- Coverage     85.35%   85.10%   -0.25%     
+ Complexity     1089     1084       -5     
============================================
  Files           152      152              
  Lines          4404     4404              
  Branches        389      389              
============================================
- Hits           3759     3748      -11     
- Misses          470      479       +9     
- Partials        175      177       +2     

see 2 files with indirect coverage changes

@martin-gaievski martin-gaievski merged commit a5214a3 into opensearch-project:main May 25, 2023
@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-915-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 a5214a3dfe86d5790fe204385bc92af147f98434
# Push it to GitHub
git push --set-upstream origin backport/backport-915-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-915-to-2.x.

martin-gaievski added a commit to martin-gaievski/k-NN that referenced this pull request May 25, 2023
Signed-off-by: Martin Gaievski <[email protected]>
(cherry picked from commit a5214a3)
martin-gaievski added a commit to martin-gaievski/k-NN that referenced this pull request May 25, 2023
Signed-off-by: Martin Gaievski <[email protected]>
(cherry picked from commit a5214a3)
martin-gaievski added a commit that referenced this pull request May 25, 2023
Signed-off-by: Martin Gaievski <[email protected]>
(cherry picked from commit a5214a3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Infrastructure Changes to infrastructure, testing, CI/CD, pipelines, etc. v2.8.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants