kong
kong copied to clipboard
fix(db) skip delete hooks if no rows were affected
Summary
This PR fixes the issue that DAO delete hooks were triggered when no rows were affected.
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
I think this test can be written as a DAO unit test. We shouldn't have to use Test-Nginx and introduce a new test mode for it. PM'ed @SumiMakito offline to help get this merged into 3.0 before code freeze.
@dndx Thanks! I have applied these suggestions.