From 32da63a20fcabdf60871a8fcb3699db456b712d8 Mon Sep 17 00:00:00 2001 From: Rafael Bortolon Paulovic Date: Mon, 17 Nov 2025 20:47:37 +0100 Subject: [PATCH] chore: remove US history pruner feature toggle (#114014) --- packages/grafana-data/src/types/featureToggles.gen.ts | 5 ----- pkg/services/featuremgmt/registry.go | 9 --------- pkg/services/featuremgmt/toggles_gen.csv | 1 - pkg/services/featuremgmt/toggles_gen.go | 4 ---- pkg/services/featuremgmt/toggles_gen.json | 3 ++- pkg/storage/unified/sql/backend.go | 11 ----------- pkg/storage/unified/sql/server.go | 3 --- 7 files changed, 2 insertions(+), 34 deletions(-) diff --git a/packages/grafana-data/src/types/featureToggles.gen.ts b/packages/grafana-data/src/types/featureToggles.gen.ts index 4b5bba51f31..65858e37221 100644 --- a/packages/grafana-data/src/types/featureToggles.gen.ts +++ b/packages/grafana-data/src/types/featureToggles.gen.ts @@ -889,11 +889,6 @@ export interface FeatureToggles { */ alertingImportYAMLUI?: boolean; /** - * Enables the unified storage history pruner - * @default true - */ - unifiedStorageHistoryPruner?: boolean; - /** * Enables the logs builder mode for the Azure Monitor data source * @default false */ diff --git a/pkg/services/featuremgmt/registry.go b/pkg/services/featuremgmt/registry.go index 7cb093d2665..86c5c400381 100644 --- a/pkg/services/featuremgmt/registry.go +++ b/pkg/services/featuremgmt/registry.go @@ -1542,15 +1542,6 @@ var ( Owner: grafanaAlertingSquad, Expression: "true", }, - { - Name: "unifiedStorageHistoryPruner", - Description: "Enables the unified storage history pruner", - Stage: FeatureStageGeneralAvailability, - Owner: grafanaSearchAndStorageSquad, - HideFromAdminPage: true, - HideFromDocs: true, - Expression: "true", // will be removed soon - }, { Name: "azureMonitorLogsBuilderEditor", Description: "Enables the logs builder mode for the Azure Monitor data source", diff --git a/pkg/services/featuremgmt/toggles_gen.csv b/pkg/services/featuremgmt/toggles_gen.csv index f1035d0342d..cb48c884e7d 100644 --- a/pkg/services/featuremgmt/toggles_gen.csv +++ b/pkg/services/featuremgmt/toggles_gen.csv @@ -200,7 +200,6 @@ alertRuleRestore,preview,@grafana/alerting-squad,false,false,false infinityRunQueriesInParallel,privatePreview,@grafana/oss-big-tent,false,false,false alertingMigrationUI,GA,@grafana/alerting-squad,false,false,true alertingImportYAMLUI,GA,@grafana/alerting-squad,false,false,true -unifiedStorageHistoryPruner,GA,@grafana/search-and-storage,false,false,false azureMonitorLogsBuilderEditor,preview,@grafana/partner-datasources,false,false,false localeFormatPreference,preview,@grafana/grafana-frontend-platform,false,false,false unifiedStorageGrpcConnectionPool,experimental,@grafana/search-and-storage,false,false,false diff --git a/pkg/services/featuremgmt/toggles_gen.go b/pkg/services/featuremgmt/toggles_gen.go index 00ce3b83a20..d96539b7a03 100644 --- a/pkg/services/featuremgmt/toggles_gen.go +++ b/pkg/services/featuremgmt/toggles_gen.go @@ -810,10 +810,6 @@ const ( // Enables a UI feature for importing rules from a Prometheus file to Grafana-managed rules FlagAlertingImportYAMLUI = "alertingImportYAMLUI" - // FlagUnifiedStorageHistoryPruner - // Enables the unified storage history pruner - FlagUnifiedStorageHistoryPruner = "unifiedStorageHistoryPruner" - // FlagAzureMonitorLogsBuilderEditor // Enables the logs builder mode for the Azure Monitor data source FlagAzureMonitorLogsBuilderEditor = "azureMonitorLogsBuilderEditor" diff --git a/pkg/services/featuremgmt/toggles_gen.json b/pkg/services/featuremgmt/toggles_gen.json index 91b71aa37ea..a5bc3b342a1 100644 --- a/pkg/services/featuremgmt/toggles_gen.json +++ b/pkg/services/featuremgmt/toggles_gen.json @@ -4214,7 +4214,8 @@ "metadata": { "name": "unifiedStorageHistoryPruner", "resourceVersion": "1753448760331", - "creationTimestamp": "2025-03-17T10:36:38Z" + "creationTimestamp": "2025-03-17T10:36:38Z", + "deletionTimestamp": "2025-11-17T12:35:33Z" }, "spec": { "description": "Enables the unified storage history pruner", diff --git a/pkg/storage/unified/sql/backend.go b/pkg/storage/unified/sql/backend.go index ac7e12a51d0..181782eb606 100644 --- a/pkg/storage/unified/sql/backend.go +++ b/pkg/storage/unified/sql/backend.go @@ -62,10 +62,6 @@ type BackendOptions struct { IsHA bool storageMetrics *resource.StorageMetrics - // If true, the backend will prune history on write events. - // Will be removed once fully rolled out. - withPruner bool - // testing SimulatedNetworkLatency time.Duration // slows down the create transactions by a fixed amount @@ -101,7 +97,6 @@ func NewBackend(opts BackendOptions) (Backend, error) { storageMetrics: opts.storageMetrics, bulkLock: &bulkLock{running: make(map[string]bool)}, simulatedNetworkLatency: opts.SimulatedNetworkLatency, - withPruner: opts.withPruner, lastImportTimeMaxAge: opts.LastImportTimeMaxAge, }, nil } @@ -141,7 +136,6 @@ type backend struct { simulatedNetworkLatency time.Duration historyPruner resource.Pruner - withPruner bool lastImportTimeMaxAge time.Duration lastImportTimeDeletionTime atomic.Time @@ -198,11 +192,6 @@ func (b *backend) initLocked(ctx context.Context) error { } func (b *backend) initPruner(ctx context.Context) error { - if !b.withPruner { - b.log.Debug("using noop history pruner") - b.historyPruner = &resource.NoopPruner{} - return nil - } b.log.Debug("using debounced history pruner") // Initialize history pruner. pruner, err := debouncer.NewGroup(debouncer.DebouncerOpts[resource.PruningKey]{ diff --git a/pkg/storage/unified/sql/server.go b/pkg/storage/unified/sql/server.go index 60fa9b8467a..1c2b02d8637 100644 --- a/pkg/storage/unified/sql/server.go +++ b/pkg/storage/unified/sql/server.go @@ -98,15 +98,12 @@ func NewResourceServer(opts ServerOptions) (resource.ResourceServer, error) { isHA := isHighAvailabilityEnabled(opts.Cfg.SectionWithEnvOverrides("database"), opts.Cfg.SectionWithEnvOverrides("resource_api")) - //nolint:staticcheck // not yet migrated to OpenFeature - withPruner := opts.Features.IsEnabledGlobally(featuremgmt.FlagUnifiedStorageHistoryPruner) backend, err := NewBackend(BackendOptions{ DBProvider: eDB, Tracer: opts.Tracer, Reg: opts.Reg, IsHA: isHA, - withPruner: withPruner, storageMetrics: opts.StorageMetrics, LastImportTimeMaxAge: opts.SearchOptions.MaxIndexAge, // No need to keep last_import_times older than max index age. })