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: verify through the cache first, then delete #1135

Merged
merged 1 commit into from
Jul 7, 2022

Conversation

tao12345666333
Copy link
Member

@tao12345666333 tao12345666333 commented Jul 6, 2022

Signed-off-by: Jintao Zhang zhangjintao9020@gmail.com

Type of change:

  • Bugfix
  • New feature provided
  • Improve performance
  • Backport patches

What this PR does / why we need it:

For resources that will be referenced such as Upstream or PluginConfig,
when deleting, we need to check whether it is being referenced through
the cache first.
The delete operation will only be performed if the cache confirms that
it is not referenced.

fixes: #1122

Pre-submission checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

For resources that will be referenced such as Upstream or PluginConfig,
when deleting, we need to check whether it is being referenced through
the cache first.
The delete operation will only be performed if the cache confirms that
it is not referenced.

ref: apache#1122

Signed-off-by: Jintao Zhang <zhangjintao9020@gmail.com>
@codecov-commenter
Copy link

Codecov Report

Merging #1135 (037a08e) into master (e25abdb) will not change coverage.
The diff coverage is 50.00%.

❗ Current head 037a08e differs from pull request most recent head f3a0bb1. Consider uploading reports for the commit f3a0bb1 to get more accurate results

@@           Coverage Diff           @@
##           master    #1135   +/-   ##
=======================================
  Coverage   30.38%   30.38%           
=======================================
  Files          81       81           
  Lines        9409     9409           
=======================================
  Hits         2859     2859           
  Misses       6235     6235           
  Partials      315      315           
Impacted Files Coverage Δ
pkg/apisix/pluginconfig.go 37.33% <40.00%> (ø)
pkg/apisix/upstream.go 39.73% <57.14%> (ø)

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 e25abdb...f3a0bb1. Read the comment docs.

@lingsamuel lingsamuel merged commit 93c10e6 into apache:master Jul 7, 2022
@tao12345666333 tao12345666333 deleted the fix-del-upstream branch July 7, 2022 07:53
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.

bug: The order of deleting ApisixRoute http and tcp types is wrong
4 participants