@@ -22,6 +22,7 @@ import (
2222 "github.com/cockroachdb/cockroach/pkg/kv"
2323 "github.com/cockroachdb/cockroach/pkg/kv/kvclient/rangefeed"
2424 "github.com/cockroachdb/cockroach/pkg/kv/kvpb"
25+ "github.com/cockroachdb/cockroach/pkg/multitenant"
2526 "github.com/cockroachdb/cockroach/pkg/roachpb"
2627 "github.com/cockroachdb/cockroach/pkg/server/settingswatcher"
2728 "github.com/cockroachdb/cockroach/pkg/settings"
@@ -1584,6 +1585,7 @@ func (m *Manager) findDescriptorState(id descpb.ID, create bool) *descriptorStat
15841585// rangefeeds. This function must be passed a non-nil gossip if
15851586// RangefeedLeases is not active.
15861587func (m * Manager ) StartRefreshLeasesTask (ctx context.Context , s * stop.Stopper , db * kv.DB ) {
1588+ ctx = multitenant .WithTenantCostControlExemption (ctx )
15871589 m .mu .Lock ()
15881590 defer m .mu .Unlock ()
15891591 defer close (m .waitForInit )
@@ -1852,6 +1854,7 @@ func (m *Manager) checkRangeFeedStatus(ctx context.Context) (forceRefresh bool)
18521854// range feed progress / recovery, and supporting legacy expiry
18531855// based leases.
18541856func (m * Manager ) RunBackgroundLeasingTask (ctx context.Context ) {
1857+ ctx = multitenant .WithTenantCostControlExemption (ctx )
18551858 // The refresh loop is used to clean up leases that have expired (because of
18561859 // a new version), and track range feed availability. This will run based on
18571860 // the lease duration, but will still periodically run if the duration is zero.
@@ -2098,6 +2101,8 @@ func (m *Manager) DeleteOrphanedLeases(
20982101 // Run as async worker to prevent blocking the main server Start method.
20992102 // Exit after releasing all the orphaned leases.
21002103 newCtx := m .ambientCtx .AnnotateCtx (context .Background ())
2104+ newCtx = multitenant .WithTenantCostControlExemption (newCtx )
2105+
21012106 // AddTags and not WithTags, so that we combine the tags with those
21022107 // filled by AnnotateCtx.
21032108 newCtx = logtags .AddTags (newCtx , logtags .FromContext (ctx ))
0 commit comments