Adjust refresh_storage_size! method
What does this MR do and why?
This MR resolves Potential race condition between ProjectStatistics #refresh!, #refresh_storage_size!, #update_counters_with_lease
As suggested in https://gitlab.com/gitlab-org/gitlab/-/issues/376420#note_1285669088 we can change to use after_commit
There are some extra changes here, due to update!
firing the callback again, we better use update_collumns
-> Discussion https://gitlab.com/gitlab-org/gitlab/-/issues/376420#note_1500472143
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.