This commit is contained in:
Ryan McKinley 2024-06-14 23:10:59 +03:00
parent d8abf8d851
commit c1b786c718
4 changed files with 17 additions and 26 deletions

View File

@ -263,11 +263,6 @@ func (s *service) start(ctx context.Context) error {
return err return err
} }
err = eDB.Init()
if err != nil {
return err
}
storeServer, err := sqlstash.ProvideSQLEntityServer(eDB, s.tracing) storeServer, err := sqlstash.ProvideSQLEntityServer(eDB, s.tracing)
if err != nil { if err != nil {
return err return err

View File

@ -16,18 +16,8 @@ func MigrateEntityStore(engine *xorm.Engine, cfg *setting.Cfg, features featurem
mg := migrator.NewScopedMigrator(engine, cfg, "entity") mg := migrator.NewScopedMigrator(engine, cfg, "entity")
mg.AddCreateMigration() mg.AddCreateMigration()
initEntityTables(mg)
// Only in development for now!!! When we are ready, we can drop entity and use this initEntityTables(mg)
if cfg.Env == setting.Dev {
m2 := migrator.NewScopedMigrator(engine, cfg, "resource")
m2.AddCreateMigration()
initResourceTables(m2)
err := m2.Start(true, 0)
if err != nil {
return err
}
}
// since it's a new feature enable migration locking by default // since it's a new feature enable migration locking by default
return mg.Start(true, 0) return mg.Start(true, 0)

View File

@ -1,24 +1,30 @@
This includes three packages This includes four packages
== resource ## resource
this is a go module that can be imported into external projects this is a go module that can be imported into external projects
This includes the protobuf based client+server and all the logic required to convert requests into write events. This includes the protobuf based client+server and all the logic required to convert requests into write events.
Protobuf TODO? Protobuf TODO?
- can/should we use upstream k8s proto for query object? * can/should we use upstream k8s proto for query object?
- starting a project today... should we use proto3? * starting a project today... should we use proto3?
== apistore ## apistore
The apiserver storage.Interface that links the storage to kubernetes The apiserver storage.Interface that links the storage to kubernetes
== sqlstash Mostly a copy of te
SQL based implementation of the unified storage server
## entitybridge
Implementes a resource store using the existing entity service. This will let us evolve the
kubernetes interface.Store using existing system structures while we explore better options.
## sqlnext
VERY early stub exploring alternative sql structure... really just a stub right now

View File

@ -1,4 +1,4 @@
package migrations package sqlnext
import ( import (
"fmt" "fmt"
@ -6,7 +6,7 @@ import (
"github.com/grafana/grafana/pkg/services/sqlstore/migrator" "github.com/grafana/grafana/pkg/services/sqlstore/migrator"
) )
func initResourceTables(mg *migrator.Migrator) string { func InitResourceTables(mg *migrator.Migrator) string {
marker := "Initialize resource tables (v0)" // changing this key wipe+rewrite everything marker := "Initialize resource tables (v0)" // changing this key wipe+rewrite everything
mg.AddMigration(marker, &migrator.RawSQLMigration{}) mg.AddMigration(marker, &migrator.RawSQLMigration{})