Discussion#resolve! runs a single UPDATE query per note but should run a single UPDATE query for all notes instead
This code was added in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5022 but got merged in despite there being problems with the code. To prevent the discussion from getting buried and this code not getting fixed I created this issue.
The method in question currently runs a single UPDATE query for every note it process. Given enough notes and enough concurrent calls to this method and we'll end up with a database that's on fire. Most of this has been explained in the discussion starting with comment https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5022#note_14075364.
This method should be updated in such a way that it only uses a single query for updating all notes.