Revert read replica POC (#93551)
* Revert "chore: add replDB to team service (#91799)" This reverts commitc6ae2d7999. * Revert "experiment: use read replica for Get and Find Dashboards (#91706)" This reverts commit54177ca619. * Revert "QuotaService: refactor to use ReplDB for Get queries (#91333)" This reverts commit299c142f6a. * Revert "refactor replCfg to look more like plugins/plugin config (#91142)" This reverts commitac0b4bb34d. * Revert "chore (replstore): fix registration with multiple sql drivers, again (#90990)" This reverts commitdaedb358dd. * Revert "Chore (sqlstore): add validation and testing for repl config (#90683)" This reverts commitaf19f039b6. * Revert "ReplStore: Add support for round robin load balancing between multiple read replicas (#90530)" This reverts commit27b52b1507. * Revert "DashboardStore: Use ReplDB and get dashboard quotas from the ReadReplica (#90235)" This reverts commit8a6107cd35. * Revert "accesscontrol service read replica (#89963)" This reverts commit77a4869fca. * Revert "Fix: add mapping for the new mysqlRepl driver (#89551)" This reverts commitab5a079bcc. * Revert "fix: sql instrumentation dual registration error (#89508)" This reverts commitd988f5c3b0. * Revert "Experimental Feature Toggle: databaseReadReplica (#89232)" This reverts commit50244ed4a1.
This commit is contained in:
@@ -71,7 +71,7 @@ func initializeConflictResolver(cmd *utils.ContextCommandLine, f Formatter, ctx
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("%v: %w", "failed to load configuration", err)
|
||||
}
|
||||
s, replstore, err := getSqlStore(cfg, tracer, features)
|
||||
s, err := getSqlStore(cfg, tracer, features)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("%v: %w", "failed to get to sql", err)
|
||||
}
|
||||
@@ -79,14 +79,14 @@ func initializeConflictResolver(cmd *utils.ContextCommandLine, f Formatter, ctx
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("%v: %w", "failed to get users with conflicting logins", err)
|
||||
}
|
||||
quotaService := quotaimpl.ProvideService(replstore, cfg)
|
||||
quotaService := quotaimpl.ProvideService(s, cfg)
|
||||
userService, err := userimpl.ProvideService(s, nil, cfg, nil, nil, tracer, quotaService, supportbundlestest.NewFakeBundleService())
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("%v: %w", "failed to get user service", err)
|
||||
}
|
||||
routing := routing.ProvideRegister()
|
||||
|
||||
acService, err := acimpl.ProvideService(cfg, replstore, routing, nil, nil, nil, features, tracer, zanzana.NewNoopClient(), permreg.ProvidePermissionRegistry())
|
||||
acService, err := acimpl.ProvideService(cfg, s, routing, nil, nil, nil, features, tracer, zanzana.NewNoopClient(), permreg.ProvidePermissionRegistry())
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("%v: %w", "failed to get access control", err)
|
||||
}
|
||||
@@ -95,15 +95,9 @@ func initializeConflictResolver(cmd *utils.ContextCommandLine, f Formatter, ctx
|
||||
return &resolver, nil
|
||||
}
|
||||
|
||||
func getSqlStore(cfg *setting.Cfg, tracer tracing.Tracer, features featuremgmt.FeatureToggles) (*sqlstore.SQLStore, *sqlstore.ReplStore, error) {
|
||||
func getSqlStore(cfg *setting.Cfg, tracer tracing.Tracer, features featuremgmt.FeatureToggles) (*sqlstore.SQLStore, error) {
|
||||
bus := bus.ProvideBus(tracer)
|
||||
ss, err := sqlstore.ProvideService(cfg, features, &migrations.OSSMigrations{}, bus, tracer)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
replStore, err := sqlstore.ProvideServiceWithReadReplica(ss, cfg, features, &migrations.OSSMigrations{}, bus, tracer)
|
||||
return ss, replStore, err
|
||||
return sqlstore.ProvideService(cfg, features, &migrations.OSSMigrations{}, bus, tracer)
|
||||
}
|
||||
|
||||
func runListConflictUsers() func(context *cli.Context) error {
|
||||
|
||||
@@ -636,7 +636,7 @@ func TestIntegrationMergeUser(t *testing.T) {
|
||||
}
|
||||
t.Run("should be able to merge user", func(t *testing.T) {
|
||||
// Restore after destructive operation
|
||||
sqlStore := db.InitTestReplDB(t)
|
||||
sqlStore := db.InitTestDB(t)
|
||||
teamSvc, err := teamimpl.ProvideService(sqlStore, setting.NewCfg(), tracing.InitializeTracerForTest())
|
||||
require.NoError(t, err)
|
||||
team1, err := teamSvc.CreateTeam(context.Background(), "team1 name", "", 1)
|
||||
@@ -714,10 +714,10 @@ func TestIntegrationMergeUser(t *testing.T) {
|
||||
}
|
||||
|
||||
// get users
|
||||
conflictUsers, err := GetUsersWithConflictingEmailsOrLogins(&cli.Context{Context: context.Background()}, sqlStore.SQLStore)
|
||||
conflictUsers, err := GetUsersWithConflictingEmailsOrLogins(&cli.Context{Context: context.Background()}, sqlStore)
|
||||
require.NoError(t, err)
|
||||
r := ConflictResolver{
|
||||
Store: sqlStore.SQLStore,
|
||||
Store: sqlStore,
|
||||
userService: usertest.NewUserServiceFake(),
|
||||
ac: actest.FakeService{},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user