Investigate if we are leaking LoadBalancing::Session
There are some workers where we didn't enable data_consistency
to utilize Sidekiq LoadBalancing, but it seems that they are still executing queries on the replica, as showed by db_replica_count
metric:
It is possible that we are leaking somewhere LoadBalancing::Session
@ayufan also noticed that:
https://gitlab.com/gitlab-org/gitlab/-/blame/master/ee/lib/analytics/group_activity_calculator.rb#L20. I don’t think that this is fine to change a global context outside of this call.
ALT link:
Edited by Kamil Trzciński