Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

feat: impl pitr mysql plan check (#7596)

p0ny3c33a2d769d0
diff --git a/backend/api/v1/rollout_service_plan_check.go b/backend/api/v1/rollout_service_plan_check.go
index c4cb22a11b..c5cfe76873 100644
--- a/backend/api/v1/rollout_service_plan_check.go
+++ b/backend/api/v1/rollout_service_plan_check.go
@@ -77,6 +77,7 @@ func getPlanCheckRunsForSpec(ctx context.Context, s *store.Store, plan *store.Pl
Type: store.PlanCheckDatabaseConnect,
Config: &storepb.PlanCheckRunConfig{
SheetId: 0,
+ InstanceId: int32(instance.UID),
DatabaseId: int32(database.UID),
},
})
@@ -89,6 +90,7 @@ func getPlanCheckRunsForSpec(ctx context.Context, s *store.Store, plan *store.Pl
Type: store.PlanCheckDatabaseStatementType,
Config: &storepb.PlanCheckRunConfig{
SheetId: int32(sheetUID),
+ InstanceId: int32(instance.UID),
DatabaseId: int32(database.UID),
ChangeDatabaseType: convertToChangeDatabaseType(config.ChangeDatabaseConfig.Type),
},
@@ -103,6 +105,7 @@ func getPlanCheckRunsForSpec(ctx context.Context, s *store.Store, plan *store.Pl
Type: store.PlanCheckDatabaseStatementAdvise,
Config: &storepb.PlanCheckRunConfig{
SheetId: int32(sheetUID),
+ InstanceId: int32(instance.UID),
DatabaseId: int32(database.UID),
ChangeDatabaseType: convertToChangeDatabaseType(config.ChangeDatabaseConfig.Type),
},
@@ -117,13 +120,87 @@ func getPlanCheckRunsForSpec(ctx context.Context, s *store.Store, plan *store.Pl
Type: store.PlanCheckDatabaseGhostSync,
Config: &storepb.PlanCheckRunConfig{
SheetId: int32(sheetUID),
+ InstanceId: int32(instance.UID),
DatabaseId: int32(database.UID),
ChangeDatabaseType: convertToChangeDatabaseType(config.ChangeDatabaseConfig.Type),
},
})
}
case *storepb.PlanConfig_Spec_RestoreDatabaseConfig:
- // TODO(p0ny): implement
+ // mysql PITR check
+ if _, ok := config.RestoreDatabaseConfig.Source.(*storepb.PlanConfig_RestoreDatabaseConfig_PointInTime); ok {
+ if config.RestoreDatabaseConfig.CreateDatabaseConfig != nil {
+ // Restore to a new database
+ // check target instance
+ targetInstanceID, err := common.GetInstanceID(config.RestoreDatabaseConfig.CreateDatabaseConfig.Target)
+ if err != nil {
+ return nil, errors.Wrapf(err, "failed to get instance id from %q", config.RestoreDatabaseConfig.CreateDatabaseConfig.Target)
+ }
+ targetInstance, err := s.GetInstanceV2(ctx, &store.FindInstanceMessage{ResourceID: &targetInstanceID})
+ if err != nil {
+ return nil, errors.Wrapf(err, "failed to find the instance with ID %q", targetInstanceID)
+ }
+ if targetInstance == nil {
+ return nil, errors.Errorf("instance %q not found", targetInstanceID)
+ }
+
+ planCheckRuns = append(planCheckRuns, &store.PlanCheckRunMessage{
+ CreatorUID: api.SystemBotID,
+ UpdaterUID: api.SystemBotID,
+ PlanUID: plan.UID,
+ Status: store.PlanCheckRunStatusRunning,
+ Type: store.PlanCheckDatabasePITRMySQL,
+ Config: &storepb.PlanCheckRunConfig{
+ InstanceId: int32(targetInstance.UID),
+ PitrConfig: &storepb.PlanCheckRunConfig_PitrConfig{
+ TargetInstanceId: int32(targetInstance.UID),
+ TargetDatabaseName: config.RestoreDatabaseConfig.CreateDatabaseConfig.Database,
+ },
+ },
+ })
+ } else {
+ // in-place restore
+ // check instance
+ target := config.RestoreDatabaseConfig.Target
+ instanceID, databaseName, err := common.GetInstanceDatabaseID(target)
+ if err != nil {
+ return nil, errors.Wrapf(err, "failed to get instance database id from target %q", target)
+ }
+
+ instance, err := s.GetInstanceV2(ctx, &store.FindInstanceMessage{
+ ResourceID: &instanceID,
+ })
+ if err != nil {
+ return nil, errors.Wrapf(err, "failed to get instance %q", instanceID)
+ }
+ if instance == nil {
+ return nil, errors.Errorf("instance %q not found", instanceID)
+ }
+ database, err := s.GetDatabaseV2(ctx, &store.FindDatabaseMessage{
+ InstanceID: &instanceID,
+ DatabaseName: &databaseName,
+ IgnoreCaseSensitive: store.IgnoreDatabaseAndTableCaseSensitive(instance),
+ })
+ if err != nil {
+ return nil, errors.Wrapf(err, "failed to get database %q", databaseName)
+ }
+ if database == nil {
+ return nil, errors.Errorf("database %q not found", databaseName)
+ }
+
+ planCheckRuns = append(planCheckRuns, &store.PlanCheckRunMessage{
+ CreatorUID: api.SystemBotID,
+ UpdaterUID: api.SystemBotID,
+ PlanUID: plan.UID,
+ Status: store.PlanCheckRunStatusRunning,
+ Type: store.PlanCheckDatabasePITRMySQL,
+ Config: &storepb.PlanCheckRunConfig{
+ InstanceId: int32(instance.UID),
+ DatabaseId: int32(database.UID),
+ },
+ })
+ }
+ }
}
return planCheckRuns, nil
}
diff --git a/backend/runner/plancheck/pitr_mysql_executor.go b/backend/runner/plancheck/pitr_mysql_executor.go
new file mode 100644
index 0000000000..3998e895c9
--- /dev/null
+++ b/backend/runner/plancheck/pitr_mysql_executor.go
@@ -0,0 +1,109 @@
+package plancheck
+
+import (
+ "context"
+
+ "github.com/pkg/errors"
+
+ "github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/component/dbfactory"
+ "github.com/bytebase/bytebase/backend/plugin/db/mysql"
+ "github.com/bytebase/bytebase/backend/store"
+ storepb "github.com/bytebase/bytebase/proto/generated-go/store"
+)
+
+// NewPITRMySQLExecutor creates a task check migration schema executor.
+func NewPITRMySQLExecutor(store *store.Store, dbFactory *dbfactory.DBFactory) Executor {
+ return &PITRMySQLExecutor{
+ store: store,
+ dbFactory: dbFactory,
+ }
+}
+
+// PITRMySQLExecutor is the task check migration schema executor.
+type PITRMySQLExecutor struct {
+ store *store.Store
+ dbFactory *dbfactory.DBFactory
+}
+
+// Run will run the task check migration schema executor once.
+func (e *PITRMySQLExecutor) Run(ctx context.Context, planCheckRun *store.PlanCheckRunMessage) ([]*storepb.PlanCheckRunResult_Result, error) {
+ instance, databaseName, err := func() (*store.InstanceMessage, string, error) {
+ if planCheckRun.Config.GetPitrConfig().GetTargetInstanceId() != 0 {
+ instanceUID := int(planCheckRun.Config.GetPitrConfig().GetTargetInstanceId())
+ databaseName := planCheckRun.Config.GetPitrConfig().GetTargetDatabaseName()
+
+ instance, err := e.store.GetInstanceV2(ctx, &store.FindInstanceMessage{UID: &instanceUID})
+ if err != nil {
+ return nil, "", errors.Wrapf(err, "failed to get instance %v", instanceUID)
+ }
+ if instance == nil {
+ return nil, "", errors.Errorf("instance not found %v", instanceUID)
+ }
+ return instance, databaseName, nil
+ }
+
+ databaseID := int(planCheckRun.Config.DatabaseId)
+ database, err := e.store.GetDatabaseV2(ctx, &store.FindDatabaseMessage{UID: &databaseID})
+ if err != nil {
+ return nil, "", errors.Wrapf(err, "failed to get database ID %v", databaseID)
+ }
+ if database == nil {
+ return nil, "", errors.Errorf("database not found %v", databaseID)
+ }
+ instance, err := e.store.GetInstanceV2(ctx, &store.FindInstanceMessage{ResourceID: &database.InstanceID})
+ if err != nil {
+ return nil, "", errors.Wrapf(err, "failed to get instance %v", database.InstanceID)
+ }
+ if instance == nil {
+ return nil, "", errors.Errorf("instance not found %v", database.InstanceID)
+ }
+
+ return instance, database.DatabaseName, nil
+ }()
+ if err != nil {
+ return nil, err
+ }
+
+ driver, err := e.dbFactory.GetAdminDatabaseDriver(ctx, instance, nil /* database */)
+ if err != nil {
+ return nil, err
+ }
+ defer driver.Close(ctx)
+ mysqlDriver, ok := driver.(*mysql.Driver)
+ if !ok {
+ return nil, errors.Errorf("Failed to cast driver to mysql.Driver")
+ }
+
+ if err := mysqlDriver.CheckServerVersionForPITR(ctx); err != nil {
+ return convertErrorToResult(err), nil
+ }
+
+ if err := mysqlDriver.CheckEngineInnoDB(ctx, databaseName); err != nil {
+ return convertErrorToResult(err), nil
+ }
+
+ if err := mysqlDriver.CheckBinlogRowFormat(ctx); err != nil {
+ return convertErrorToResult(err), nil
+ }
+
+ return []*storepb.PlanCheckRunResult_Result{
+ {
+ Status: storepb.PlanCheckRunResult_Result_SUCCESS,
+ Code: common.Ok.Int64(),
+ Title: "OK",
+ Content: "Ready to do PITR",
+ },
+ }, nil
+}
+
+func convertErrorToResult(err error) []*storepb.PlanCheckRunResult_Result {
+ return []*storepb.PlanCheckRunResult_Result{
+ {
+ Status: storepb.PlanCheckRunResult_Result_ERROR,
+ Code: common.Internal.Int64(),
+ Title: "Error",
+ Content: err.Error(),
+ },
+ }
+}
diff --git a/backend/runner/plancheck/scheduler.go b/backend/runner/plancheck/scheduler.go
index b85060466b..2433f2c055 100644
--- a/backend/runner/plancheck/scheduler.go
+++ b/backend/runner/plancheck/scheduler.go
@@ -103,28 +103,14 @@ func (s *Scheduler) runPlanCheckRun(ctx context.Context, planCheckRun *store.Pla
return
}
- databaseUID := int(planCheckRun.Config.DatabaseId)
- db, err := s.store.GetDatabaseV2(ctx, &store.FindDatabaseMessage{UID: &databaseUID})
- if err != nil {
- log.Error("failed to get db for plan check run")
- s.markPlanCheckRunFailed(ctx, planCheckRun, errors.Wrapf(err, "failed to get database for plan check run").Error())
- return
- }
- instance, err := s.store.GetInstanceV2(ctx, &store.FindInstanceMessage{
- ResourceID: &db.InstanceID,
- })
- if err != nil {
- log.Error("failed to get instance for plan check run")
- s.markPlanCheckRunFailed(ctx, planCheckRun, errors.Wrapf(err, "failed to get instance for plan check run").Error())
- return
- }
+ instanceUID := int(planCheckRun.Config.InstanceId)
s.stateCfg.Lock()
- if s.stateCfg.InstanceOutstandingConnections[instance.UID] >= state.InstanceMaximumConnectionNumber {
+ if s.stateCfg.InstanceOutstandingConnections[instanceUID] >= state.InstanceMaximumConnectionNumber {
s.stateCfg.Unlock()
return
}
- s.stateCfg.InstanceOutstandingConnections[instance.UID]++
+ s.stateCfg.InstanceOutstandingConnections[instanceUID]++
s.stateCfg.Unlock()
s.stateCfg.RunningPlanChecks.Store(planCheckRun.UID, true)
@@ -132,7 +118,7 @@ func (s *Scheduler) runPlanCheckRun(ctx context.Context, planCheckRun *store.Pla
defer func() {
s.stateCfg.RunningPlanChecks.Delete(planCheckRun.UID)
s.stateCfg.Lock()
- s.stateCfg.InstanceOutstandingConnections[instance.UID]--
+ s.stateCfg.InstanceOutstandingConnections[instanceUID]--
s.stateCfg.Unlock()
}()
results, err := executor.Run(ctx, planCheckRun)
diff --git a/backend/server/server.go b/backend/server/server.go
index e6baeff6a9..1c2ed45cba 100644
--- a/backend/server/server.go
+++ b/backend/server/server.go
@@ -516,6 +516,8 @@ func NewServer(ctx context.Context, profile config.Profile) (*Server, error) {
s.PlanCheckScheduler.Register(store.PlanCheckDatabaseStatementAdvise, statementAdviseExecutor)
ghostSyncExecutor := plancheck.NewGhostSyncExecutor(storeInstance, s.secret)
s.PlanCheckScheduler.Register(store.PlanCheckDatabaseGhostSync, ghostSyncExecutor)
+ pitrMySQLExecutor := plancheck.NewPITRMySQLExecutor(storeInstance, s.dbFactory)
+ s.PlanCheckScheduler.Register(store.PlanCheckDatabasePITRMySQL, pitrMySQLExecutor)
}
// Anomaly scanner
diff --git a/frontend/src/types/proto/store/plan_check_run.ts b/frontend/src/types/proto/store/plan_check_run.ts
index 81e91257fc..751acb2d90 100644
--- a/frontend/src/types/proto/store/plan_check_run.ts
+++ b/frontend/src/types/proto/store/plan_check_run.ts
@@ -6,8 +6,10 @@ export const protobufPackage = "bytebase.store";
export interface PlanCheckRunConfig {
sheetId: number;
+ instanceId: number;
databaseId: number;
changeDatabaseType: PlanCheckRunConfig_ChangeDatabaseType;
+ pitrConfig?: PlanCheckRunConfig_PitrConfig | undefined;
}
export enum PlanCheckRunConfig_ChangeDatabaseType {
@@ -55,6 +57,11 @@ export function planCheckRunConfig_ChangeDatabaseTypeToJSON(object: PlanCheckRun
}
}
+export interface PlanCheckRunConfig_PitrConfig {
+ targetInstanceId: number;
+ targetDatabaseName: string;
+}
+
export interface PlanCheckRunResult {
results: PlanCheckRunResult_Result[];
error: string;
@@ -128,7 +135,7 @@ export interface PlanCheckRunResult_Result_SqlReviewReport {
}
function createBasePlanCheckRunConfig(): PlanCheckRunConfig {
- return { sheetId: 0, databaseId: 0, changeDatabaseType: 0 };
+ return { sheetId: 0, instanceId: 0, databaseId: 0, changeDatabaseType: 0, pitrConfig: undefined };
}
export const PlanCheckRunConfig = {
@@ -136,11 +143,17 @@ export const PlanCheckRunConfig = {
if (message.sheetId !== 0) {
writer.uint32(8).int32(message.sheetId);
}
+ if (message.instanceId !== 0) {
+ writer.uint32(16).int32(message.instanceId);
+ }
if (message.databaseId !== 0) {
- writer.uint32(16).int32(message.databaseId);
+ writer.uint32(24).int32(message.databaseId);
}
if (message.changeDatabaseType !== 0) {
- writer.uint32(24).int32(message.changeDatabaseType);
+ writer.uint32(32).int32(message.changeDatabaseType);
+ }
+ if (message.pitrConfig !== undefined) {
+ PlanCheckRunConfig_PitrConfig.encode(message.pitrConfig, writer.uint32(42).fork()).ldelim();
}
return writer;
},
@@ -164,15 +177,29 @@ export const PlanCheckRunConfig = {
break;
}
- message.databaseId = reader.int32();
+ message.instanceId = reader.int32();
continue;
case 3:
if (tag !== 24) {
break;
}
+ message.databaseId = reader.int32();
+ continue;
+ case 4:
+ if (tag !== 32) {
+ break;
+ }
+
message.changeDatabaseType = reader.int32() as any;
continue;
+ case 5:
+ if (tag !== 42) {
+ break;
+ }
+
+ message.pitrConfig = PlanCheckRunConfig_PitrConfig.decode(reader, reader.uint32());
+ continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
@@ -185,19 +212,24 @@ export const PlanCheckRunConfig = {
fromJSON(object: any): PlanCheckRunConfig {
return {
sheetId: isSet(object.sheetId) ? Number(object.sheetId) : 0,
+ instanceId: isSet(object.instanceId) ? Number(object.instanceId) : 0,
databaseId: isSet(object.databaseId) ? Number(object.databaseId) : 0,
changeDatabaseType: isSet(object.changeDatabaseType)
? planCheckRunConfig_ChangeDatabaseTypeFromJSON(object.changeDatabaseType)
: 0,
+ pitrConfig: isSet(object.pitrConfig) ? PlanCheckRunConfig_PitrConfig.fromJSON(object.pitrConfig) : undefined,
};
},
toJSON(message: PlanCheckRunConfig): unknown {
const obj: any = {};
message.sheetId !== undefined && (obj.sheetId = Math.round(message.sheetId));
+ message.instanceId !== undefined && (obj.instanceId = Math.round(message.instanceId));
message.databaseId !== undefined && (obj.databaseId = Math.round(message.databaseId));
message.changeDatabaseType !== undefined &&
(obj.changeDatabaseType = planCheckRunConfig_ChangeDatabaseTypeToJSON(message.changeDatabaseType));
+ message.pitrConfig !== undefined &&
+ (obj.pitrConfig = message.pitrConfig ? PlanCheckRunConfig_PitrConfig.toJSON(message.pitrConfig) : undefined);
return obj;
},
@@ -208,8 +240,83 @@ export const PlanCheckRunConfig = {
fromPartial(object: DeepPartial<PlanCheckRunConfig>): PlanCheckRunConfig {
const message = createBasePlanCheckRunConfig();
message.sheetId = object.sheetId ?? 0;
+ message.instanceId = object.instanceId ?? 0;
message.databaseId = object.databaseId ?? 0;
message.changeDatabaseType = object.changeDatabaseType ?? 0;
+ message.pitrConfig = (object.pitrConfig !== undefined && object.pitrConfig !== null)
+ ? PlanCheckRunConfig_PitrConfig.fromPartial(object.pitrConfig)
+ : undefined;
+ return message;
+ },
+};
+
+function createBasePlanCheckRunConfig_PitrConfig(): PlanCheckRunConfig_PitrConfig {
+ return { targetInstanceId: 0, targetDatabaseName: "" };
+}
+
+export const PlanCheckRunConfig_PitrConfig = {
+ encode(message: PlanCheckRunConfig_PitrConfig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.targetInstanceId !== 0) {
+ writer.uint32(8).int32(message.targetInstanceId);
+ }
+ if (message.targetDatabaseName !== "") {
+ writer.uint32(18).string(message.targetDatabaseName);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): PlanCheckRunConfig_PitrConfig {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBasePlanCheckRunConfig_PitrConfig();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 8) {
+ break;
+ }
+
+ message.targetInstanceId = reader.int32();
+ continue;
+ case 2:
+ if (tag !== 18) {
+ break;
+ }
+
+ message.targetDatabaseName = reader.string();
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): PlanCheckRunConfig_PitrConfig {
+ return {
+ targetInstanceId: isSet(object.targetInstanceId) ? Number(object.targetInstanceId) : 0,
+ targetDatabaseName: isSet(object.targetDatabaseName) ? String(object.targetDatabaseName) : "",
+ };
+ },
+
+ toJSON(message: PlanCheckRunConfig_PitrConfig): unknown {
+ const obj: any = {};
+ message.targetInstanceId !== undefined && (obj.targetInstanceId = Math.round(message.targetInstanceId));
+ message.targetDatabaseName !== undefined && (obj.targetDatabaseName = message.targetDatabaseName);
+ return obj;
+ },
+
+ create(base?: DeepPartial<PlanCheckRunConfig_PitrConfig>): PlanCheckRunConfig_PitrConfig {
+ return PlanCheckRunConfig_PitrConfig.fromPartial(base ?? {});
+ },
+
+ fromPartial(object: DeepPartial<PlanCheckRunConfig_PitrConfig>): PlanCheckRunConfig_PitrConfig {
+ const message = createBasePlanCheckRunConfig_PitrConfig();
+ message.targetInstanceId = object.targetInstanceId ?? 0;
+ message.targetDatabaseName = object.targetDatabaseName ?? "";
return message;
},
};
diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.md
index d2ee629738..f22ac339cd 100644
--- a/proto/gen/grpc-doc/store/README.md
+++ b/proto/gen/grpc-doc/store/README.md
@@ -107,6 +107,7 @@
- [store/plan_check_run.proto](#store_plan_check_run-proto)
- [PlanCheckRunConfig](#bytebase-store-PlanCheckRunConfig)
+ - [PlanCheckRunConfig.PitrConfig](#bytebase-store-PlanCheckRunConfig-PitrConfig)
- [PlanCheckRunResult](#bytebase-store-PlanCheckRunResult)
- [PlanCheckRunResult.Result](#bytebase-store-PlanCheckRunResult-Result)
- [PlanCheckRunResult.Result.SqlReviewReport](#bytebase-store-PlanCheckRunResult-Result-SqlReviewReport)
@@ -1652,8 +1653,26 @@ Type is the database change type.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| sheet_id | [int32](#int32) | | |
+| instance_id | [int32](#int32) | | |
| database_id | [int32](#int32) | | |
| change_database_type | [PlanCheckRunConfig.ChangeDatabaseType](#bytebase-store-PlanCheckRunConfig-ChangeDatabaseType) | | |
+| pitr_config | [PlanCheckRunConfig.PitrConfig](#bytebase-store-PlanCheckRunConfig-PitrConfig) | | |
+
+
+
+
+
+
+<a name="bytebase-store-PlanCheckRunConfig-PitrConfig"></a>
+
+### PlanCheckRunConfig.PitrConfig
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| target_instance_id | [int32](#int32) | | |
+| target_database_name | [string](#string) | | |
diff --git a/proto/generated-go/store/plan_check_run.pb.go b/proto/generated-go/store/plan_check_run.pb.go
index 2ecbed6775..979e0f2242 100644
--- a/proto/generated-go/store/plan_check_run.pb.go
+++ b/proto/generated-go/store/plan_check_run.pb.go
@@ -130,8 +130,10 @@ type PlanCheckRunConfig struct {
unknownFields protoimpl.UnknownFields
SheetId int32 `protobuf:"varint,1,opt,name=sheet_id,json=sheetId,proto3" json:"sheet_id,omitempty"`
- DatabaseId int32 `protobuf:"varint,2,opt,name=database_id,json=databaseId,proto3" json:"database_id,omitempty"`
- ChangeDatabaseType PlanCheckRunConfig_ChangeDatabaseType `protobuf:"varint,3,opt,name=change_database_type,json=changeDatabaseType,proto3,enum=bytebase.store.PlanCheckRunConfig_ChangeDatabaseType" json:"change_database_type,omitempty"`
+ InstanceId int32 `protobuf:"varint,2,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"`
+ DatabaseId int32 `protobuf:"varint,3,opt,name=database_id,json=databaseId,proto3" json:"database_id,omitempty"`
+ ChangeDatabaseType PlanCheckRunConfig_ChangeDatabaseType `protobuf:"varint,4,opt,name=change_database_type,json=changeDatabaseType,proto3,enum=bytebase.store.PlanCheckRunConfig_ChangeDatabaseType" json:"change_database_type,omitempty"`
+ PitrConfig *PlanCheckRunConfig_PitrConfig `protobuf:"bytes,5,opt,name=pitr_config,json=pitrConfig,proto3" json:"pitr_config,omitempty"`
}
func (x *PlanCheckRunConfig) Reset() {
@@ -173,6 +175,13 @@ func (x *PlanCheckRunConfig) GetSheetId() int32 {
return 0
}
+func (x *PlanCheckRunConfig) GetInstanceId() int32 {
+ if x != nil {
+ return x.InstanceId
+ }
+ return 0
+}
+
func (x *PlanCheckRunConfig) GetDatabaseId() int32 {
if x != nil {
return x.DatabaseId
@@ -187,6 +196,13 @@ func (x *PlanCheckRunConfig) GetChangeDatabaseType() PlanCheckRunConfig_ChangeDa
return PlanCheckRunConfig_CHANGE_DATABASE_TYPE_UNSPECIFIED
}
+func (x *PlanCheckRunConfig) GetPitrConfig() *PlanCheckRunConfig_PitrConfig {
+ if x != nil {
+ return x.PitrConfig
+ }
+ return nil
+}
+
type PlanCheckRunResult struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -242,6 +258,61 @@ func (x *PlanCheckRunResult) GetError() string {
return ""
}
+type PlanCheckRunConfig_PitrConfig struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ TargetInstanceId int32 `protobuf:"varint,1,opt,name=target_instance_id,json=targetInstanceId,proto3" json:"target_instance_id,omitempty"`
+ TargetDatabaseName string `protobuf:"bytes,2,opt,name=target_database_name,json=targetDatabaseName,proto3" json:"target_database_name,omitempty"`
+}
+
+func (x *PlanCheckRunConfig_PitrConfig) Reset() {
+ *x = PlanCheckRunConfig_PitrConfig{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_store_plan_check_run_proto_msgTypes[2]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *PlanCheckRunConfig_PitrConfig) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*PlanCheckRunConfig_PitrConfig) ProtoMessage() {}
+
+func (x *PlanCheckRunConfig_PitrConfig) ProtoReflect() protoreflect.Message {
+ mi := &file_store_plan_check_run_proto_msgTypes[2]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use PlanCheckRunConfig_PitrConfig.ProtoReflect.Descriptor instead.
+func (*PlanCheckRunConfig_PitrConfig) Descriptor() ([]byte, []int) {
+ return file_store_plan_check_run_proto_rawDescGZIP(), []int{0, 0}
+}
+
+func (x *PlanCheckRunConfig_PitrConfig) GetTargetInstanceId() int32 {
+ if x != nil {
+ return x.TargetInstanceId
+ }
+ return 0
+}
+
+func (x *PlanCheckRunConfig_PitrConfig) GetTargetDatabaseName() string {
+ if x != nil {
+ return x.TargetDatabaseName
+ }
+ return ""
+}
+
type PlanCheckRunResult_Result struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -261,7 +332,7 @@ type PlanCheckRunResult_Result struct {
func (x *PlanCheckRunResult_Result) Reset() {
*x = PlanCheckRunResult_Result{}
if protoimpl.UnsafeEnabled {
- mi := &file_store_plan_check_run_proto_msgTypes[2]
+ mi := &file_store_plan_check_run_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -274,7 +345,7 @@ func (x *PlanCheckRunResult_Result) String() string {
func (*PlanCheckRunResult_Result) ProtoMessage() {}
func (x *PlanCheckRunResult_Result) ProtoReflect() protoreflect.Message {
- mi := &file_store_plan_check_run_proto_msgTypes[2]
+ mi := &file_store_plan_check_run_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -367,7 +438,7 @@ type PlanCheckRunResult_Result_SqlSummaryReport struct {
func (x *PlanCheckRunResult_Result_SqlSummaryReport) Reset() {
*x = PlanCheckRunResult_Result_SqlSummaryReport{}
if protoimpl.UnsafeEnabled {
- mi := &file_store_plan_check_run_proto_msgTypes[3]
+ mi := &file_store_plan_check_run_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -380,7 +451,7 @@ func (x *PlanCheckRunResult_Result_SqlSummaryReport) String() string {
func (*PlanCheckRunResult_Result_SqlSummaryReport) ProtoMessage() {}
func (x *PlanCheckRunResult_Result_SqlSummaryReport) ProtoReflect() protoreflect.Message {
- mi := &file_store_plan_check_run_proto_msgTypes[3]
+ mi := &file_store_plan_check_run_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -425,7 +496,7 @@ type PlanCheckRunResult_Result_SqlReviewReport struct {
func (x *PlanCheckRunResult_Result_SqlReviewReport) Reset() {
*x = PlanCheckRunResult_Result_SqlReviewReport{}
if protoimpl.UnsafeEnabled {
- mi := &file_store_plan_check_run_proto_msgTypes[4]
+ mi := &file_store_plan_check_run_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -438,7 +509,7 @@ func (x *PlanCheckRunResult_Result_SqlReviewReport) String() string {
func (*PlanCheckRunResult_Result_SqlReviewReport) ProtoMessage() {}
func (x *PlanCheckRunResult_Result_SqlReviewReport) ProtoReflect() protoreflect.Message {
- mi := &file_store_plan_check_run_proto_msgTypes[4]
+ mi := &file_store_plan_check_run_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -487,74 +558,88 @@ var File_store_plan_check_run_proto protoreflect.FileDescriptor
var file_store_plan_check_run_proto_rawDesc = []byte{
0x0a, 0x1a, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x6c, 0x61, 0x6e, 0x5f, 0x63, 0x68, 0x65,
0x63, 0x6b, 0x5f, 0x72, 0x75, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x62, 0x79,
- 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x22, 0x90, 0x02, 0x0a,
+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x22, 0xef, 0x03, 0x0a,
0x12, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x43, 0x6f, 0x6e,
0x66, 0x69, 0x67, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x68, 0x65, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x73, 0x68, 0x65, 0x65, 0x74, 0x49, 0x64, 0x12, 0x1f,
- 0x0a, 0x0b, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20,
- 0x01, 0x28, 0x05, 0x52, 0x0a, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x49, 0x64, 0x12,
- 0x67, 0x0a, 0x14, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61,
- 0x73, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x35, 0x2e,
- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x50,
- 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69,
- 0x67, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65,
- 0x54, 0x79, 0x70, 0x65, 0x52, 0x12, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x44, 0x61, 0x74, 0x61,
- 0x62, 0x61, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, 0x55, 0x0a, 0x12, 0x43, 0x68, 0x61, 0x6e,
- 0x67, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x24,
- 0x0a, 0x20, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x42, 0x41, 0x53,
- 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49,
- 0x45, 0x44, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x44, 0x44, 0x4c, 0x10, 0x01, 0x12, 0x07, 0x0a,
- 0x03, 0x44, 0x4d, 0x4c, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x53, 0x44, 0x4c, 0x10, 0x03, 0x22,
- 0xf9, 0x05, 0x0a, 0x12, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e,
- 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x43, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74,
- 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
- 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65,
- 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x75,
- 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x65,
- 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f,
- 0x72, 0x1a, 0x87, 0x05, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x48, 0x0a, 0x06,
- 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x30, 0x2e, 0x62,
- 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x6c,
- 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74,
- 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06,
- 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18,
- 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07,
- 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63,
- 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x04,
- 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x6a, 0x0a, 0x12, 0x73, 0x71,
- 0x6c, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74,
- 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
+ 0x0a, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20,
+ 0x01, 0x28, 0x05, 0x52, 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x64, 0x12,
+ 0x1f, 0x0a, 0x0b, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03,
+ 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x49, 0x64,
+ 0x12, 0x67, 0x0a, 0x14, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x62,
+ 0x61, 0x73, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x35,
+ 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e,
+ 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x43, 0x6f, 0x6e, 0x66,
+ 0x69, 0x67, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73,
+ 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x12, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x44, 0x61, 0x74,
+ 0x61, 0x62, 0x61, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x4e, 0x0a, 0x0b, 0x70, 0x69, 0x74,
+ 0x72, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d,
+ 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e,
+ 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x43, 0x6f, 0x6e, 0x66,
+ 0x69, 0x67, 0x2e, 0x50, 0x69, 0x74, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0a, 0x70,
+ 0x69, 0x74, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0x6c, 0x0a, 0x0a, 0x50, 0x69, 0x74,
+ 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2c, 0x0a, 0x12, 0x74, 0x61, 0x72, 0x67, 0x65,
+ 0x74, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20,
+ 0x01, 0x28, 0x05, 0x52, 0x10, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x6e, 0x73, 0x74, 0x61,
+ 0x6e, 0x63, 0x65, 0x49, 0x64, 0x12, 0x30, 0x0a, 0x14, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f,
+ 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20,
+ 0x01, 0x28, 0x09, 0x52, 0x12, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x44, 0x61, 0x74, 0x61, 0x62,
+ 0x61, 0x73, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x55, 0x0a, 0x12, 0x43, 0x68, 0x61, 0x6e, 0x67,
+ 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x24, 0x0a,
+ 0x20, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x42, 0x41, 0x53, 0x45,
+ 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45,
+ 0x44, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x44, 0x44, 0x4c, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03,
+ 0x44, 0x4d, 0x4c, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x53, 0x44, 0x4c, 0x10, 0x03, 0x22, 0xf9,
+ 0x05, 0x0a, 0x12, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x52,
+ 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x43, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73,
+ 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63,
0x6b, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c,
- 0x74, 0x2e, 0x53, 0x71, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x70, 0x6f,
- 0x72, 0x74, 0x48, 0x00, 0x52, 0x10, 0x73, 0x71, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79,
- 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x67, 0x0a, 0x11, 0x73, 0x71, 0x6c, 0x5f, 0x72, 0x65,
- 0x76, 0x69, 0x65, 0x77, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28,
- 0x0b, 0x32, 0x39, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f,
- 0x72, 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x52,
- 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x53, 0x71, 0x6c,
- 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x48, 0x00, 0x52, 0x0f,
- 0x73, 0x71, 0x6c, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x1a,
- 0x5e, 0x0a, 0x10, 0x53, 0x71, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x70,
- 0x6f, 0x72, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74,
- 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x74, 0x61,
- 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x66,
- 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28,
- 0x03, 0x52, 0x0c, 0x61, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x52, 0x6f, 0x77, 0x73, 0x1a,
- 0x69, 0x0a, 0x0f, 0x53, 0x71, 0x6c, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x70, 0x6f,
- 0x72, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03,
- 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e,
- 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x12, 0x16,
- 0x0a, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06,
- 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x04,
- 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x45, 0x0a, 0x06, 0x53, 0x74,
- 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55,
- 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05,
- 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x57, 0x41, 0x52, 0x4e, 0x49,
- 0x4e, 0x47, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10,
- 0x03, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x42, 0x14, 0x5a, 0x12, 0x67,
- 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x73, 0x74, 0x6f, 0x72,
- 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72,
+ 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72,
+ 0x1a, 0x87, 0x05, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x48, 0x0a, 0x06, 0x73,
+ 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x30, 0x2e, 0x62, 0x79,
+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x6c, 0x61,
+ 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e,
+ 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73,
+ 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02,
+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63,
+ 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f,
+ 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20,
+ 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x6a, 0x0a, 0x12, 0x73, 0x71, 0x6c,
+ 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18,
+ 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
+ 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b,
+ 0x52, 0x75, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74,
+ 0x2e, 0x53, 0x71, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x70, 0x6f, 0x72,
+ 0x74, 0x48, 0x00, 0x52, 0x10, 0x73, 0x71, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52,
+ 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x67, 0x0a, 0x11, 0x73, 0x71, 0x6c, 0x5f, 0x72, 0x65, 0x76,
+ 0x69, 0x65, 0x77, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b,
+ 0x32, 0x39, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72,
+ 0x65, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x75, 0x6e, 0x52, 0x65,
+ 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x53, 0x71, 0x6c, 0x52,
+ 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x48, 0x00, 0x52, 0x0f, 0x73,
+ 0x71, 0x6c, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x1a, 0x5e,
+ 0x0a, 0x10, 0x53, 0x71, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x70, 0x6f,
+ 0x72, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f,
+ 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x74, 0x61, 0x74,
+ 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x66, 0x66,
+ 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03,
+ 0x52, 0x0c, 0x61, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x52, 0x6f, 0x77, 0x73, 0x1a, 0x69,
+ 0x0a, 0x0f, 0x53, 0x71, 0x6c, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x65, 0x70, 0x6f, 0x72,
+ 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52,
+ 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x18,
+ 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x12, 0x16, 0x0a,
+ 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64,
+ 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20,
+ 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x45, 0x0a, 0x06, 0x53, 0x74, 0x61,
+ 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e,
+ 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x45,
+ 0x52, 0x52, 0x4f, 0x52, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x57, 0x41, 0x52, 0x4e, 0x49, 0x4e,
+ 0x47, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x03,
+ 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x42, 0x14, 0x5a, 0x12, 0x67, 0x65,
+ 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65,
+ 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -570,27 +655,29 @@ func file_store_plan_check_run_proto_rawDescGZIP() []byte {
}
var file_store_plan_check_run_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
-var file_store_plan_check_run_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
+var file_store_plan_check_run_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_store_plan_check_run_proto_goTypes = []interface{}{
(PlanCheckRunConfig_ChangeDatabaseType)(0), // 0: bytebase.store.PlanCheckRunConfig.ChangeDatabaseType
(PlanCheckRunResult_Result_Status)(0), // 1: bytebase.store.PlanCheckRunResult.Result.Status
(*PlanCheckRunConfig)(nil), // 2: bytebase.store.PlanCheckRunConfig
(*PlanCheckRunResult)(nil), // 3: bytebase.store.PlanCheckRunResult
- (*PlanCheckRunResult_Result)(nil), // 4: bytebase.store.PlanCheckRunResult.Result
- (*PlanCheckRunResult_Result_SqlSummaryReport)(nil), // 5: bytebase.store.PlanCheckRunResult.Result.SqlSummaryReport
- (*PlanCheckRunResult_Result_SqlReviewReport)(nil), // 6: bytebase.store.PlanCheckRunResult.Result.SqlReviewReport
+ (*PlanCheckRunConfig_PitrConfig)(nil), // 4: bytebase.store.PlanCheckRunConfig.PitrConfig
+ (*PlanCheckRunResult_Result)(nil), // 5: bytebase.store.PlanCheckRunResult.Result
+ (*PlanCheckRunResult_Result_SqlSummaryReport)(nil), // 6: bytebase.store.PlanCheckRunResult.Result.SqlSummaryReport
+ (*PlanCheckRunResult_Result_SqlReviewReport)(nil), // 7: bytebase.store.PlanCheckRunResult.Result.SqlReviewReport
}
var file_store_plan_check_run_proto_depIdxs = []int32{
0, // 0: bytebase.store.PlanCheckRunConfig.change_database_type:type_name -> bytebase.store.PlanCheckRunConfig.ChangeDatabaseType
- 4, // 1: bytebase.store.PlanCheckRunResult.results:type_name -> bytebase.store.PlanCheckRunResult.Result
- 1, // 2: bytebase.store.PlanCheckRunResult.Result.status:type_name -> bytebase.store.PlanCheckRunResult.Result.Status
- 5, // 3: bytebase.store.PlanCheckRunResult.Result.sql_summary_report:type_name -> bytebase.store.PlanCheckRunResult.Result.SqlSummaryReport
- 6, // 4: bytebase.store.PlanCheckRunResult.Result.sql_review_report:type_name -> bytebase.store.PlanCheckRunResult.Result.SqlReviewReport
- 5, // [5:5] is the sub-list for method output_type
- 5, // [5:5] is the sub-list for method input_type
- 5, // [5:5] is the sub-list for extension type_name
- 5, // [5:5] is the sub-list for extension extendee
- 0, // [0:5] is the sub-list for field type_name
+ 4, // 1: bytebase.store.PlanCheckRunConfig.pitr_config:type_name -> bytebase.store.PlanCheckRunConfig.PitrConfig
+ 5, // 2: bytebase.store.PlanCheckRunResult.results:type_name -> bytebase.store.PlanCheckRunResult.Result
+ 1, // 3: bytebase.store.PlanCheckRunResult.Result.status:type_name -> bytebase.store.PlanCheckRunResult.Result.Status
+ 6, // 4: bytebase.store.PlanCheckRunResult.Result.sql_summary_report:type_name -> bytebase.store.PlanCheckRunResult.Result.SqlSummaryReport
+ 7, // 5: bytebase.store.PlanCheckRunResult.Result.sql_review_report:type_name -> bytebase.store.PlanCheckRunResult.Result.SqlReviewReport
+ 6, // [6:6] is the sub-list for method output_type
+ 6, // [6:6] is the sub-list for method input_type
+ 6, // [6:6] is the sub-list for extension type_name
+ 6, // [6:6] is the sub-list for extension extendee
+ 0, // [0:6] is the sub-list for field type_name
}
func init() { file_store_plan_check_run_proto_init() }
@@ -624,7 +711,7 @@ func file_store_plan_check_run_proto_init() {
}
}
file_store_plan_check_run_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*PlanCheckRunResult_Result); i {
+ switch v := v.(*PlanCheckRunConfig_PitrConfig); i {
case 0:
return &v.state
case 1:
@@ -636,7 +723,7 @@ func file_store_plan_check_run_proto_init() {
}
}
file_store_plan_check_run_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*PlanCheckRunResult_Result_SqlSummaryReport); i {
+ switch v := v.(*PlanCheckRunResult_Result); i {
case 0:
return &v.state
case 1:
@@ -648,6 +735,18 @@ func file_store_plan_check_run_proto_init() {
}
}
file_store_plan_check_run_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*PlanCheckRunResult_Result_SqlSummaryReport); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_store_plan_check_run_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PlanCheckRunResult_Result_SqlReviewReport); i {
case 0:
return &v.state
@@ -660,7 +759,7 @@ func file_store_plan_check_run_proto_init() {
}
}
}
- file_store_plan_check_run_proto_msgTypes[2].OneofWrappers = []interface{}{
+ file_store_plan_check_run_proto_msgTypes[3].OneofWrappers = []interface{}{
(*PlanCheckRunResult_Result_SqlSummaryReport_)(nil),
(*PlanCheckRunResult_Result_SqlReviewReport_)(nil),
}
@@ -670,7 +769,7 @@ func file_store_plan_check_run_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_store_plan_check_run_proto_rawDesc,
NumEnums: 2,
- NumMessages: 5,
+ NumMessages: 6,
NumExtensions: 0,
NumServices: 0,
},
diff --git a/proto/store/plan_check_run.proto b/proto/store/plan_check_run.proto
index de363c2d8f..3200b3a2fd 100644
--- a/proto/store/plan_check_run.proto
+++ b/proto/store/plan_check_run.proto
@@ -6,8 +6,15 @@ option go_package = "generated-go/store";
message PlanCheckRunConfig {
int32 sheet_id = 1;
- int32 database_id = 2;
- ChangeDatabaseType change_database_type = 3;
+ int32 instance_id = 2;
+ int32 database_id = 3;
+ ChangeDatabaseType change_database_type = 4;
+ PitrConfig pitr_config = 5;
+
+ message PitrConfig {
+ int32 target_instance_id = 1;
+ string target_database_name = 2;
+ }
enum ChangeDatabaseType {
CHANGE_DATABASE_TYPE_UNSPECIFIED = 0;