Remove exclusive lock when updating statistics
What does this MR do and why?
- Related to https://gitlab.com/gitlab-org/gitlab/-/issues/482785+
- Related to Update comment to indicate why exclusive lease ... (#441530 - closed)
- Related to Fix exclusive lease usage in transaction for ap... (#441524 - closed)
When updating statistics in the database we wrapped the operation with detect_race_on_record
which used an exclusive lease on the model record to detect concurrent updates. We are not taking any actions around concurrent updates hence we should remove this exclusive lock since it caused FlushCounterIncrementsWorker
to be greatly affected by Redis load.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.