diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-08 13:33:01 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-08 13:33:01 +0300 |
commit | 6edb7e9bb152d919c215f35bd6cb7d52fd3d99be (patch) | |
tree | f12ef4b7953932f9b2b9c28313277bf636115bc8 /lib/gitlab/database | |
parent | 305ea394efd2d5afe16234406dede486d9ca37af (diff) |
Add latest changes from gitlab-org/gitlab@14-4-stable-ee
Diffstat (limited to 'lib/gitlab/database')
-rw-r--r-- | lib/gitlab/database/load_balancing/load_balancer.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/gitlab/database/load_balancing/load_balancer.rb b/lib/gitlab/database/load_balancing/load_balancer.rb index cc9ca325337..2be7f0baa60 100644 --- a/lib/gitlab/database/load_balancing/load_balancer.rb +++ b/lib/gitlab/database/load_balancing/load_balancer.rb @@ -52,7 +52,10 @@ module Gitlab connection = host.connection return yield connection rescue StandardError => error - if serialization_failure?(error) + if primary_only? + # If we only have primary configured, retrying is pointless + raise error + elsif serialization_failure?(error) # This error can occur when a query conflicts. See # https://www.postgresql.org/docs/current/static/hot-standby.html#HOT-STANDBY-CONFLICT # for more information. |