-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Feat/targets to new dao #3622
Closed
Closed
Feat/targets to new dao #3622
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kikito
added
the
good first issue
Issues that beginners/volunteers can easily help with.
label
Jul 16, 2018
kikito
added
pr/do not merge
and removed
good first issue
Issues that beginners/volunteers can easily help with.
labels
Jul 16, 2018
hishamhm
force-pushed
the
feat/targets-to-new-dao
branch
from
July 23, 2018 12:18
c17ef5f
to
6d50498
Compare
thibaultcha
added
pr/wip
A work in progress PR opened to receive feedback
and removed
pr/do not merge
labels
Jul 25, 2018
kikito
force-pushed
the
feat/targets-to-new-dao
branch
10 times, most recently
from
July 30, 2018 17:24
6424504
to
1837249
Compare
kikito
added
pr/please review
and removed
pr/wip
A work in progress PR opened to receive feedback
labels
Jul 30, 2018
kikito
force-pushed
the
feat/targets-to-new-dao
branch
from
July 30, 2018 17:52
1837249
to
9955356
Compare
kikito
force-pushed
the
feat/targets-to-new-dao
branch
from
July 31, 2018 16:41
9955356
to
1072bd5
Compare
This was referenced Jul 31, 2018
Closed
kikito
force-pushed
the
feat/targets-to-new-dao
branch
4 times, most recently
from
August 1, 2018 14:40
0f7289a
to
6076cdd
Compare
@kikito please remove from this PR the commits that were already merged via other PRs (I'm not doing it myself to avoid getting your local branch out of sync) |
kikito
force-pushed
the
feat/targets-to-new-dao
branch
from
August 2, 2018 15:42
6076cdd
to
3af189f
Compare
kikito
force-pushed
the
feat/targets-to-new-dao
branch
from
August 2, 2018 15:43
3af189f
to
bf56aae
Compare
@hishamhm done - I have left the timestamps-as-float commit because it is needed for the tests to pass. |
sumimakito
added a commit
that referenced
this pull request
Aug 23, 2022
This PR fixes the issue that DAO delete hooks were triggered when no rows were affected (rows affected by the DELETE query are unchecked). The issue currently affects Kong Enterprise and Kong Manager. When concurrent delete requests are initiated on the same entity, the counter in the workspace meta will potentially be decremented multiple times and become a negative number. FT-3072
sumimakito
added a commit
that referenced
this pull request
Aug 24, 2022
This PR fixes the issue that DAO delete hooks were triggered when no rows were affected (rows affected by the DELETE query are unchecked). The issue currently affects Kong Enterprise and Kong Manager. When concurrent delete requests are initiated on the same entity, the counter in the workspace meta will potentially be decremented multiple times and become a negative number. FT-3072
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The new admin API is fairly similar to the previously existing one, but there are some breaking changes:
GET /upstreams
orGET /upstreams/{upstream}/targets
) don't accept query-attributes for filtering any moretotal
attribute is gonePUT
actions now are applied to entities instead of to collections. (PUT /upstreams/foo
instead ofPUT /upstreams
500
error instead of a400
.PUT
actions return a200
on creation instead of201
.created_at
) are floating point numbers now (in all entities - not just upstreams and services).New features:
next
on paginated admin API results.db.targets:for_upstream(u)
, the list only includes active targets, and is reverse-sorted bycreated_at+id
. This is the method used in/upstreams/{upstream}/targets
db.targets:for_upstreams_raw(u)
which returns all targets, including those withweight=0
, associated with the upstream. That's what used in/upstreams/{upstream}/targets/all
db.targets:for_upstream_with_health(u)
is the same list asdb.targets:for_upstream(u)
but also includes health information (so it is slower to call). It is used in/upstreams/{upstream}/health
.db.targets:for_upstream_sorted(u)
which returns the targets sorted bycreated_at+id
. It is used internally in a couple places for things like cleaning up and building the cache.db.targets:delete
method creates a new target withweight = 0
. The only way to really delete a target from the database is by inserting targets (this will eventually trigger aclean_history
call).db.targets:post_health
is the one-place for changing health status of a target. It deals with balancer changes and sending events to the cluster. It is used inPOST /upstreams/{upstream}/targets/{target}/healthy|unhealthy
.Prerequisites:
hash_on_header
is not equal tohash_fallback_header
target.target
attribute is an endpoint key but it is not unique. Had to remove that restriction from the system.