Fix counter cache invalidation
What does this MR do?
This MR implements a counter cache invalidation for such cases:
- Issue reopening
- Issue closing
- MR reopening
- MR closing
- MR merging
Apart of that, we have set
expire_in for that cache so it will not last forever. It will help to workaround the issue https://gitlab.com/gitlab-org/gitlab-ce/issues/32415 which is not fixed yet. And it will also help to mitigate the impact of future bugs like this. Moreover, making cache non-infinite is a good practice.
Are there points in the code the reviewer needs to double check?
Why was this MR needed?
Does this MR meet the acceptance criteria?
- Changelog entry added, if necessary
- Documentation created/updated
- API support added
- Added for this feature/bug
- All builds are passing
- Conform by the merge request performance guides
- Conform by the style guides
Branch has no merge conflicts with
master(if it does - rebase it please)
- Squashed related commits together