Skip to content

Commit

Permalink
Storage: Remove unified storage feature flag (grafana#92192)
Browse files Browse the repository at this point in the history
remove unified storage flag
  • Loading branch information
ryantxu authored Aug 21, 2024
1 parent 71f0dae commit 2136fd9
Show file tree
Hide file tree
Showing 11 changed files with 7 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ Experimental features might be changed or removed without prior notice.
| `canvasPanelNesting` | Allow elements nesting |
| `disableSecretsCompatibility` | Disable duplicated secret storage in legacy tables |
| `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 |
| `mysqlAnsiQuotes` | Use double quotes to escape keyword in a MySQL query |
| `alertingBacktesting` | Rule backtesting API for alerting |
Expand Down
1 change: 0 additions & 1 deletion packages/grafana-data/src/types/featureToggles.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export interface FeatureToggles {
logRequestsInstrumentedAsUnknown?: boolean;
topnav?: boolean;
grpcServer?: boolean;
unifiedStorage?: boolean;
cloudWatchCrossAccountQuerying?: boolean;
showDashboardValidationWarnings?: boolean;
mysqlAnsiQuotes?: boolean;
Expand Down
8 changes: 0 additions & 8 deletions pkg/services/apiserver/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,6 @@ func (s *service) start(ctx context.Context) error {
}

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)
if err != nil {
return err
Expand All @@ -298,10 +294,6 @@ func (s *service) start(ctx context.Context) error {
o.RecommendedOptions.Etcd.StorageConfig)

case grafanaapiserveroptions.StorageTypeUnifiedGrpc:
if !s.features.IsEnabledGlobally(featuremgmt.FlagUnifiedStorage) {
return fmt.Errorf("unified storage requires the unifiedStorage feature flag")
}

opts := []grpc.DialOption{
grpc.WithStatsHandler(otelgrpc.NewClientHandler()),
grpc.WithTransportCredentials(insecure.NewCredentials()),
Expand Down
8 changes: 0 additions & 8 deletions pkg/services/featuremgmt/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,6 @@ var (
Owner: grafanaSearchAndStorageSquad,
HideFromAdminPage: true,
},
{
Name: "unifiedStorage",
Description: "SQL-based k8s storage",
Stage: FeatureStageExperimental,
RequiresDevMode: false,
RequiresRestart: true, // new SQL tables created
Owner: grafanaSearchAndStorageSquad,
},
{
Name: "cloudWatchCrossAccountQuerying",
Description: "Enables cross-account querying in CloudWatch datasources",
Expand Down
1 change: 0 additions & 1 deletion pkg/services/featuremgmt/toggles_gen.csv
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ disableSecretsCompatibility,experimental,@grafana/hosted-grafana-team,false,true
logRequestsInstrumentedAsUnknown,experimental,@grafana/hosted-grafana-team,false,false,false
topnav,deprecated,@grafana/grafana-frontend-platform,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
showDashboardValidationWarnings,experimental,@grafana/dashboards-squad,false,false,false
mysqlAnsiQuotes,experimental,@grafana/search-and-storage,false,false,false
Expand Down
4 changes: 0 additions & 4 deletions pkg/services/featuremgmt/toggles_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,6 @@ const (
// Run the GRPC server
FlagGrpcServer = "grpcServer"

// FlagUnifiedStorage
// SQL-based k8s storage
FlagUnifiedStorage = "unifiedStorage"

// FlagCloudWatchCrossAccountQuerying
// Enables cross-account querying in CloudWatch datasources
FlagCloudWatchCrossAccountQuerying = "cloudWatchCrossAccountQuerying"
Expand Down
1 change: 1 addition & 0 deletions pkg/services/featuremgmt/toggles_gen.json
Original file line number Diff line number Diff line change
Expand Up @@ -2695,6 +2695,7 @@
"name": "unifiedStorage",
"resourceVersion": "1724096690370",
"creationTimestamp": "2023-12-06T20:21:21Z",
"deletionTimestamp": "2024-08-21T09:30:06Z",
"annotations": {
"grafana.app/updatedTimestamp": "2024-08-19 19:44:50.370023815 +0000 UTC"
}
Expand Down
1 change: 0 additions & 1 deletion pkg/services/sqlstore/sqlstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,6 @@ func getCfgForTesting(opts ...InitTestDBOpt) *setting.Cfg {
func getFeaturesForTesting(opts ...InitTestDBOpt) featuremgmt.FeatureToggles {
featureKeys := []any{
featuremgmt.FlagPanelTitleSearch,
featuremgmt.FlagUnifiedStorage,
}
for _, opt := range opts {
if len(opt.FeatureFlags) > 0 {
Expand Down
10 changes: 4 additions & 6 deletions pkg/storage/unified/sql/db/dbimpl/dbimpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,10 @@ func newResourceDBProvider(grafanaDB infraDB.DB, cfg *setting.Cfg, features feat
}

p = &resourceDBProvider{
cfg: cfg,
log: log.New("entity-db"),
logQueries: getter.Key("log_queries").MustBool(false),
}
if features.IsEnabledGlobally(featuremgmt.FlagUnifiedStorage) {
p.migrateFunc = migrations.MigrateResourceStore
cfg: cfg,
log: log.New("entity-db"),
logQueries: getter.Key("log_queries").MustBool(false),
migrateFunc: migrations.MigrateResourceStore,
}

switch dbType := getter.Key("db_type").MustString(""); dbType {
Expand Down
4 changes: 2 additions & 2 deletions pkg/storage/unified/sql/test/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func newServer(t *testing.T) (sql.Backend, resource.ResourceServer) {

dbstore := infraDB.InitTestDB(t)
cfg := setting.NewCfg()
features := featuremgmt.WithFeatures(featuremgmt.FlagUnifiedStorage)
features := featuremgmt.WithFeatures()

eDB, err := dbimpl.ProvideResourceDB(dbstore, cfg, features, nil)
require.NoError(t, err)
Expand Down Expand Up @@ -331,7 +331,7 @@ func TestClientServer(t *testing.T) {
cfg.GRPCServerAddress = "localhost:0"
cfg.GRPCServerNetwork = "tcp"

features := featuremgmt.WithFeatures(featuremgmt.FlagUnifiedStorage)
features := featuremgmt.WithFeatures()

svc, err := sql.ProvideService(cfg, features, dbstore, nil)
require.NoError(t, err)
Expand Down
4 changes: 0 additions & 4 deletions pkg/tests/apis/playlist/playlist_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ func TestIntegrationPlaylist(t *testing.T) {
DisableAnonymous: true,
APIServerStorageType: "unified", // use the entity api tables
EnableFeatureToggles: []string{
featuremgmt.FlagUnifiedStorage,
featuremgmt.FlagKubernetesPlaylists, // Required so that legacy calls are also written
},
DualWriterDesiredModes: map[string]grafanarest.DualWriterMode{
Expand All @@ -164,7 +163,6 @@ func TestIntegrationPlaylist(t *testing.T) {
DisableAnonymous: true,
APIServerStorageType: "unified", // use the entity api tables
EnableFeatureToggles: []string{
featuremgmt.FlagUnifiedStorage,
featuremgmt.FlagKubernetesPlaylists, // Required so that legacy calls are also written
},
DualWriterDesiredModes: map[string]grafanarest.DualWriterMode{
Expand All @@ -179,7 +177,6 @@ func TestIntegrationPlaylist(t *testing.T) {
DisableAnonymous: true,
APIServerStorageType: "unified", // use the entity api tables
EnableFeatureToggles: []string{
featuremgmt.FlagUnifiedStorage,
featuremgmt.FlagKubernetesPlaylists, // Required so that legacy calls are also written
},
DualWriterDesiredModes: map[string]grafanarest.DualWriterMode{
Expand All @@ -194,7 +191,6 @@ func TestIntegrationPlaylist(t *testing.T) {
DisableAnonymous: true,
APIServerStorageType: "unified", // use the entity api tables
EnableFeatureToggles: []string{
featuremgmt.FlagUnifiedStorage,
featuremgmt.FlagKubernetesPlaylists, // Required so that legacy calls are also written
},
DualWriterDesiredModes: map[string]grafanarest.DualWriterMode{
Expand Down

0 comments on commit 2136fd9

Please sign in to comment.