Add cop to discourage use of `:always` data consistency
What does this MR do and why?
This MR updates the SidekiqLoadBalancing/WorkerDataConsistency
cop to remind and discourage the use of data_consistency :always
unless the worker requires it. The scalability group is advocating for :sticky
data consistency as the default moving forward. It is possible that workers are added with :always
consistency without much giving it much consideration since it is the default behaviour in the load balancing middleware.
The MR is generated with a with https://docs.gitlab.com/ee/development/rake_tasks.html#generate-initial-rubocop-todo-list. There are two ways to proceed:rubocop --auto-correct --disable-uncorrectable
statement which marks all existing use of :always
with a rubocop:todo
- If the worker indeed requires primary db connection (e.g. write heavy), remove the file from the todo and add a disable
- If the worker can be optimised, perform a migrate to
:delayed
or:sticky
via the use of a feature flag and remove it from the todo file.
See gitlab-com/gl-infra/scalability#1811 (comment 1333136504)
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.