[387601] GitHub import: prevent reviewer index violation
What does this MR do and why?
It's a fix for ActiveRecord::RecordNotUnique: PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_merge_request_.... The problem is that during parallel import of review results for particular PullRequest there could be few reviews from single reviewer. We import such reviews in parallel what could affect passing return if review_re_requested?(user_id)
condition in a one of jobs and raise exception mentioned above.
How to set up and validate locally
Unfortunately there is no chance to reproduce such situations but after merging this in prod/staging logs this particular error should get disappeared.
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.