Resolve "500 error when deleting group web hook due to statement timeout"
What does this MR do?
For #29215 (closed)
We already have foreign key with cascading deletes on web_hook_logs
, so we can make use of this instead of dependent: :destroy
to remove web_hook_logs
records upon deleting a webhook.
This is currently leading to 500 errors as mentioned in #29215 (closed), because of large number of web_hook_logs
records present for a webhook.
By moving away from dependent: :destroy
we could solve this problem.
Testing:
I tested this out on my local by creating around ~300000 web_hook_log
records via the console for a web_hook
and then trying to delete it via the UI.
With dependent: :destroy
enabled, the DESTROY
request timed out (as mentioned in the issue)
After removing dependent: :destroy
, the request completed successfully and the associated web_hook_logs
records were also deleted.
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation created/updated or follow-up review issue created -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team