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

[bugfix] return NotFound error when delete fails in multiUpdate #1681

Conversation

vankichi
Copy link
Contributor

@vankichi vankichi commented May 31, 2022

Signed-off-by: vankichi [email protected]

Description:

The delete index function runs in the multiUpdate, but it does not return NotFound error when the index does not exist in pkg/agent/core/ngt layer.
It affects when vald agent standalone.
This PR changes the flag validation as true to return NotFound error.

In addition, I have fixed the readyForUpdate method.
When the error occurs in GetObject(), which readyForUpdate calls, readyForUpdate returns error.

Related Issue:

How Has This Been Tested?:

Environment:

  • Go Version: 1.18.2
  • Docker Version: 20.10.8
  • Kubernetes Version: 1.22.0
  • NGT Version: 1.14.5

Types of changes:

  • Bug fix [type/bug]
  • New feature [type/feature]
  • Add tests [type/test]
  • Security related changes [type/security]
  • Add documents [type/documentation]
  • Refactoring [type/refactoring]
  • Update dependencies [type/dependency]
  • Update benchmarks and performances [type/bench]
  • Update CI [type/ci]

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

Checklist:

  • I have read the CONTRIBUTING document.
  • I have checked open Pull Requests for the similar feature or fixes?
  • I have added tests and benchmarks to cover my changes.
  • I have ensured all new and existing tests passed.
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly.

@vdaas-ci
Copy link
Collaborator

[CHATOPS:HELP] ChatOps commands.

  • 🙆‍♀️ /approve - approve
  • 💌 /changelog - replace the PR body by changelog details
  • 🍱 /format - format codes and add licenses
  • /gen-test - generate test codes
  • 🏷️ /label - add labels
  • /rebase - rebase master
  • 🔚 2️⃣ 🔚 /label actions/e2e-deploy - run E2E deploy & integration test

@codecov
Copy link

codecov bot commented May 31, 2022

Codecov Report

Merging #1681 (2a01149) into master (46334b2) will decrease coverage by 0.03%.
The diff coverage is 33.33%.

@@            Coverage Diff             @@
##           master    #1681      +/-   ##
==========================================
- Coverage   31.20%   31.17%   -0.04%     
==========================================
  Files         372      372              
  Lines       32502    32503       +1     
==========================================
- Hits        10142    10132      -10     
- Misses      21982    21990       +8     
- Partials      378      381       +3     
Impacted Files Coverage Δ
pkg/agent/core/ngt/service/ngt.go 20.22% <33.33%> (-0.23%) ⬇️
...nt/core/ngt/service/vqueue/uninserted_index_map.go 75.95% <0.00%> (-2.74%) ⬇️
pkg/agent/core/ngt/service/option.go 89.57% <0.00%> (-1.85%) ⬇️
internal/worker/worker.go 83.59% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f3f0823...2a01149. Read the comment docs.

@vankichi vankichi force-pushed the bugfix/pkg/return-not-found-err-when-fail-delete-in-multi-update branch from d07b92c to e04f14a Compare June 1, 2022 06:25
@vankichi vankichi requested review from a team, hlts2, kpango and datelier and removed request for a team June 1, 2022 06:26
kpango
kpango previously approved these changes Jun 1, 2022
Copy link
Collaborator

@kpango kpango left a comment

Choose a reason for hiding this comment

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

LGTM

hlts2
hlts2 previously approved these changes Jun 1, 2022
Copy link
Collaborator

@hlts2 hlts2 left a comment

Choose a reason for hiding this comment

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

LGTM!

@vankichi vankichi dismissed stale reviews from hlts2 and kpango via 2a01149 June 1, 2022 07:35
@vankichi vankichi requested a review from kpango June 1, 2022 07:35
@vankichi vankichi requested a review from hlts2 June 1, 2022 07:35
Copy link
Collaborator

@hlts2 hlts2 left a comment

Choose a reason for hiding this comment

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

LGTM!!

@vankichi vankichi merged commit 815b44a into master Jun 1, 2022
@vankichi vankichi deleted the bugfix/pkg/return-not-found-err-when-fail-delete-in-multi-update branch June 1, 2022 09:20
@hlts2 hlts2 mentioned this pull request Jun 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants