Storage: Remove unified storage feature flag (#92192)

remove unified storage flag
pull/92240/head
Ryan McKinley 9 months ago committed by GitHub
parent 71f0dae39e
commit 2136fd9a92
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md
  2. 1
      packages/grafana-data/src/types/featureToggles.gen.ts
  3. 8
      pkg/services/apiserver/service.go
  4. 8
      pkg/services/featuremgmt/registry.go
  5. 1
      pkg/services/featuremgmt/toggles_gen.csv
  6. 4
      pkg/services/featuremgmt/toggles_gen.go
  7. 1
      pkg/services/featuremgmt/toggles_gen.json
  8. 1
      pkg/services/sqlstore/sqlstore.go
  9. 10
      pkg/storage/unified/sql/db/dbimpl/dbimpl.go
  10. 4
      pkg/storage/unified/sql/test/integration_test.go
  11. 4
      pkg/tests/apis/playlist/playlist_test.go

@ -121,7 +121,6 @@ Experimental features might be changed or removed without prior notice.
| `canvasPanelNesting` | Allow elements nesting | | `canvasPanelNesting` | Allow elements nesting |
| `disableSecretsCompatibility` | Disable duplicated secret storage in legacy tables | | `disableSecretsCompatibility` | Disable duplicated secret storage in legacy tables |
| `logRequestsInstrumentedAsUnknown` | Logs the path for requests that are instrumented as unknown | | `logRequestsInstrumentedAsUnknown` | Logs the path for requests that are instrumented as unknown |
| `unifiedStorage` | SQL-based k8s storage |
| `showDashboardValidationWarnings` | Show warnings when dashboards do not validate against the schema | | `showDashboardValidationWarnings` | Show warnings when dashboards do not validate against the schema |
| `mysqlAnsiQuotes` | Use double quotes to escape keyword in a MySQL query | | `mysqlAnsiQuotes` | Use double quotes to escape keyword in a MySQL query |
| `alertingBacktesting` | Rule backtesting API for alerting | | `alertingBacktesting` | Rule backtesting API for alerting |

@ -42,7 +42,6 @@ export interface FeatureToggles {
logRequestsInstrumentedAsUnknown?: boolean; logRequestsInstrumentedAsUnknown?: boolean;
topnav?: boolean; topnav?: boolean;
grpcServer?: boolean; grpcServer?: boolean;
unifiedStorage?: boolean;
cloudWatchCrossAccountQuerying?: boolean; cloudWatchCrossAccountQuerying?: boolean;
showDashboardValidationWarnings?: boolean; showDashboardValidationWarnings?: boolean;
mysqlAnsiQuotes?: boolean; mysqlAnsiQuotes?: boolean;

@ -285,10 +285,6 @@ func (s *service) start(ctx context.Context) error {
} }
case grafanaapiserveroptions.StorageTypeUnified: case grafanaapiserveroptions.StorageTypeUnified:
if !s.features.IsEnabledGlobally(featuremgmt.FlagUnifiedStorage) {
return fmt.Errorf("unified storage requires the unifiedStorage feature flag")
}
server, err := sql.ProvideResourceServer(s.db, s.cfg, s.features, s.tracing) server, err := sql.ProvideResourceServer(s.db, s.cfg, s.features, s.tracing)
if err != nil { if err != nil {
return err return err
@ -298,10 +294,6 @@ func (s *service) start(ctx context.Context) error {
o.RecommendedOptions.Etcd.StorageConfig) o.RecommendedOptions.Etcd.StorageConfig)
case grafanaapiserveroptions.StorageTypeUnifiedGrpc: case grafanaapiserveroptions.StorageTypeUnifiedGrpc:
if !s.features.IsEnabledGlobally(featuremgmt.FlagUnifiedStorage) {
return fmt.Errorf("unified storage requires the unifiedStorage feature flag")
}
opts := []grpc.DialOption{ opts := []grpc.DialOption{
grpc.WithStatsHandler(otelgrpc.NewClientHandler()), grpc.WithStatsHandler(otelgrpc.NewClientHandler()),
grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithTransportCredentials(insecure.NewCredentials()),

@ -194,14 +194,6 @@ var (
Owner: grafanaSearchAndStorageSquad, Owner: grafanaSearchAndStorageSquad,
HideFromAdminPage: true, HideFromAdminPage: true,
}, },
{
Name: "unifiedStorage",
Description: "SQL-based k8s storage",
Stage: FeatureStageExperimental,
RequiresDevMode: false,
RequiresRestart: true, // new SQL tables created
Owner: grafanaSearchAndStorageSquad,
},
{ {
Name: "cloudWatchCrossAccountQuerying", Name: "cloudWatchCrossAccountQuerying",
Description: "Enables cross-account querying in CloudWatch datasources", Description: "Enables cross-account querying in CloudWatch datasources",

@ -23,7 +23,6 @@ disableSecretsCompatibility,experimental,@grafana/hosted-grafana-team,false,true
logRequestsInstrumentedAsUnknown,experimental,@grafana/hosted-grafana-team,false,false,false logRequestsInstrumentedAsUnknown,experimental,@grafana/hosted-grafana-team,false,false,false
topnav,deprecated,@grafana/grafana-frontend-platform,false,false,false topnav,deprecated,@grafana/grafana-frontend-platform,false,false,false
grpcServer,preview,@grafana/search-and-storage,false,false,false grpcServer,preview,@grafana/search-and-storage,false,false,false
unifiedStorage,experimental,@grafana/search-and-storage,false,true,false
cloudWatchCrossAccountQuerying,GA,@grafana/aws-datasources,false,false,false cloudWatchCrossAccountQuerying,GA,@grafana/aws-datasources,false,false,false
showDashboardValidationWarnings,experimental,@grafana/dashboards-squad,false,false,false showDashboardValidationWarnings,experimental,@grafana/dashboards-squad,false,false,false
mysqlAnsiQuotes,experimental,@grafana/search-and-storage,false,false,false mysqlAnsiQuotes,experimental,@grafana/search-and-storage,false,false,false

1 Name Stage Owner requiresDevMode RequiresRestart FrontendOnly
23 logRequestsInstrumentedAsUnknown experimental @grafana/hosted-grafana-team false false false
24 topnav deprecated @grafana/grafana-frontend-platform false false false
25 grpcServer preview @grafana/search-and-storage false false false
unifiedStorage experimental @grafana/search-and-storage false true false
26 cloudWatchCrossAccountQuerying GA @grafana/aws-datasources false false false
27 showDashboardValidationWarnings experimental @grafana/dashboards-squad false false false
28 mysqlAnsiQuotes experimental @grafana/search-and-storage false false false

@ -103,10 +103,6 @@ const (
// Run the GRPC server // Run the GRPC server
FlagGrpcServer = "grpcServer" FlagGrpcServer = "grpcServer"
// FlagUnifiedStorage
// SQL-based k8s storage
FlagUnifiedStorage = "unifiedStorage"
// FlagCloudWatchCrossAccountQuerying // FlagCloudWatchCrossAccountQuerying
// Enables cross-account querying in CloudWatch datasources // Enables cross-account querying in CloudWatch datasources
FlagCloudWatchCrossAccountQuerying = "cloudWatchCrossAccountQuerying" FlagCloudWatchCrossAccountQuerying = "cloudWatchCrossAccountQuerying"

@ -2695,6 +2695,7 @@
"name": "unifiedStorage", "name": "unifiedStorage",
"resourceVersion": "1724096690370", "resourceVersion": "1724096690370",
"creationTimestamp": "2023-12-06T20:21:21Z", "creationTimestamp": "2023-12-06T20:21:21Z",
"deletionTimestamp": "2024-08-21T09:30:06Z",
"annotations": { "annotations": {
"grafana.app/updatedTimestamp": "2024-08-19 19:44:50.370023815 +0000 UTC" "grafana.app/updatedTimestamp": "2024-08-19 19:44:50.370023815 +0000 UTC"
} }

@ -481,7 +481,6 @@ func getCfgForTesting(opts ...InitTestDBOpt) *setting.Cfg {
func getFeaturesForTesting(opts ...InitTestDBOpt) featuremgmt.FeatureToggles { func getFeaturesForTesting(opts ...InitTestDBOpt) featuremgmt.FeatureToggles {
featureKeys := []any{ featureKeys := []any{
featuremgmt.FlagPanelTitleSearch, featuremgmt.FlagPanelTitleSearch,
featuremgmt.FlagUnifiedStorage,
} }
for _, opt := range opts { for _, opt := range opts {
if len(opt.FeatureFlags) > 0 { if len(opt.FeatureFlags) > 0 {

@ -61,12 +61,10 @@ func newResourceDBProvider(grafanaDB infraDB.DB, cfg *setting.Cfg, features feat
} }
p = &resourceDBProvider{ p = &resourceDBProvider{
cfg: cfg, cfg: cfg,
log: log.New("entity-db"), log: log.New("entity-db"),
logQueries: getter.Key("log_queries").MustBool(false), logQueries: getter.Key("log_queries").MustBool(false),
} migrateFunc: migrations.MigrateResourceStore,
if features.IsEnabledGlobally(featuremgmt.FlagUnifiedStorage) {
p.migrateFunc = migrations.MigrateResourceStore
} }
switch dbType := getter.Key("db_type").MustString(""); dbType { switch dbType := getter.Key("db_type").MustString(""); dbType {

@ -31,7 +31,7 @@ func newServer(t *testing.T) (sql.Backend, resource.ResourceServer) {
dbstore := infraDB.InitTestDB(t) dbstore := infraDB.InitTestDB(t)
cfg := setting.NewCfg() cfg := setting.NewCfg()
features := featuremgmt.WithFeatures(featuremgmt.FlagUnifiedStorage) features := featuremgmt.WithFeatures()
eDB, err := dbimpl.ProvideResourceDB(dbstore, cfg, features, nil) eDB, err := dbimpl.ProvideResourceDB(dbstore, cfg, features, nil)
require.NoError(t, err) require.NoError(t, err)
@ -331,7 +331,7 @@ func TestClientServer(t *testing.T) {
cfg.GRPCServerAddress = "localhost:0" cfg.GRPCServerAddress = "localhost:0"
cfg.GRPCServerNetwork = "tcp" cfg.GRPCServerNetwork = "tcp"
features := featuremgmt.WithFeatures(featuremgmt.FlagUnifiedStorage) features := featuremgmt.WithFeatures()
svc, err := sql.ProvideService(cfg, features, dbstore, nil) svc, err := sql.ProvideService(cfg, features, dbstore, nil)
require.NoError(t, err) require.NoError(t, err)

@ -149,7 +149,6 @@ func TestIntegrationPlaylist(t *testing.T) {
DisableAnonymous: true, DisableAnonymous: true,
APIServerStorageType: "unified", // use the entity api tables APIServerStorageType: "unified", // use the entity api tables
EnableFeatureToggles: []string{ EnableFeatureToggles: []string{
featuremgmt.FlagUnifiedStorage,
featuremgmt.FlagKubernetesPlaylists, // Required so that legacy calls are also written featuremgmt.FlagKubernetesPlaylists, // Required so that legacy calls are also written
}, },
DualWriterDesiredModes: map[string]grafanarest.DualWriterMode{ DualWriterDesiredModes: map[string]grafanarest.DualWriterMode{
@ -164,7 +163,6 @@ func TestIntegrationPlaylist(t *testing.T) {
DisableAnonymous: true, DisableAnonymous: true,
APIServerStorageType: "unified", // use the entity api tables APIServerStorageType: "unified", // use the entity api tables
EnableFeatureToggles: []string{ EnableFeatureToggles: []string{
featuremgmt.FlagUnifiedStorage,
featuremgmt.FlagKubernetesPlaylists, // Required so that legacy calls are also written featuremgmt.FlagKubernetesPlaylists, // Required so that legacy calls are also written
}, },
DualWriterDesiredModes: map[string]grafanarest.DualWriterMode{ DualWriterDesiredModes: map[string]grafanarest.DualWriterMode{
@ -179,7 +177,6 @@ func TestIntegrationPlaylist(t *testing.T) {
DisableAnonymous: true, DisableAnonymous: true,
APIServerStorageType: "unified", // use the entity api tables APIServerStorageType: "unified", // use the entity api tables
EnableFeatureToggles: []string{ EnableFeatureToggles: []string{
featuremgmt.FlagUnifiedStorage,
featuremgmt.FlagKubernetesPlaylists, // Required so that legacy calls are also written featuremgmt.FlagKubernetesPlaylists, // Required so that legacy calls are also written
}, },
DualWriterDesiredModes: map[string]grafanarest.DualWriterMode{ DualWriterDesiredModes: map[string]grafanarest.DualWriterMode{
@ -194,7 +191,6 @@ func TestIntegrationPlaylist(t *testing.T) {
DisableAnonymous: true, DisableAnonymous: true,
APIServerStorageType: "unified", // use the entity api tables APIServerStorageType: "unified", // use the entity api tables
EnableFeatureToggles: []string{ EnableFeatureToggles: []string{
featuremgmt.FlagUnifiedStorage,
featuremgmt.FlagKubernetesPlaylists, // Required so that legacy calls are also written featuremgmt.FlagKubernetesPlaylists, // Required so that legacy calls are also written
}, },
DualWriterDesiredModes: map[string]grafanarest.DualWriterMode{ DualWriterDesiredModes: map[string]grafanarest.DualWriterMode{

Loading…
Cancel
Save