-
Stan Hu authored
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/42435 attempted to fix the problem, but it did not work because EE databaase load balancing is not enabled in Sidekiq. Since it is disabled, the load balancer code would never post the write location to Redis, so the code for checking whether to stick to the primary was not able to be used. Since Sidekiq always uses the primary we can just use the main ActiveRecord connection to get the same information. We only post the write location if load balancing is configured. Relates to https://gitlab.com/gitlab-org/gitlab/-/issues/247857
9046a766