Commit 296f7f65 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Remove feature flag used to enable subtransactions counter

Changelog: performance
parent 99a392f1
---
name: active_record_subtransactions_counter
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/66477
rollout_issue_url:
milestone: '14.1'
type: ops
group: group::pipeline execution
default_enabled: false
...@@ -207,10 +207,10 @@ module Gitlab ...@@ -207,10 +207,10 @@ module Gitlab
extend ActiveSupport::Concern extend ActiveSupport::Concern
class_methods do class_methods do
# A monkeypatch over ActiveRecord::Base.transaction. # A patch over ActiveRecord::Base.transaction that provides
# It provides observability into transactional methods. # observability into transactional methods.
def transaction(**options, &block) def transaction(**options, &block)
if options[:requires_new] && gitlab_track_subtransactions? if options[:requires_new] && connection.transaction_open?
::Gitlab::Database::Metrics.subtransactions_increment(self.name) ::Gitlab::Database::Metrics.subtransactions_increment(self.name)
end end
...@@ -218,11 +218,6 @@ module Gitlab ...@@ -218,11 +218,6 @@ module Gitlab
super(**options, &block) super(**options, &block)
end end
end end
def gitlab_track_subtransactions?
::Feature.enabled?(:active_record_subtransactions_counter, type: :ops, default_enabled: :yaml) &&
connection.transaction_open?
end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment