Delete project and system hook logs in batches
When a user attempts to destroy a Web hook, the database will attempt to delete all the associated Web hook logs. However, as we have seen in https://gitlab.com/gitlab-org/gitlab/-/issues/21940, the table may be too bloated or the number of rows too large that this deletion can time out due to a 15-second statement timeout. We rectify this situation by deleting these logs in batches of 1000 outside of a transaction. That should be acceptable since old logs get pruned periodically anyway, and when a Web hook is destroyed it's more important that the destruction makes progress and eventually removes the hook. Relates to https://gitlab.com/gitlab-org/gitlab/-/issues/21940
Showing
Please register or sign in to comment