Skip to content

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

chore: deprecate pitr stuff (#11219)

Danny Xu0366a88be0de
diff --git a/backend/api/v1/database_service.go b/backend/api/v1/database_service.go
index 0cad418425..01280d857b 100644
--- a/backend/api/v1/database_service.go
+++ b/backend/api/v1/database_service.go
@@ -37,7 +37,6 @@ import (
"github.com/bytebase/bytebase/backend/plugin/parser/sql/ast"
pgrawparser "github.com/bytebase/bytebase/backend/plugin/parser/sql/engine/pg"
"github.com/bytebase/bytebase/backend/plugin/parser/sql/transform"
- "github.com/bytebase/bytebase/backend/runner/backuprun"
"github.com/bytebase/bytebase/backend/runner/schemasync"
"github.com/bytebase/bytebase/backend/store"
"github.com/bytebase/bytebase/backend/store/model"
@@ -66,7 +65,6 @@ const (
type DatabaseService struct {
v1pb.UnimplementedDatabaseServiceServer
store *store.Store
- backupRunner *backuprun.Runner
schemaSyncer *schemasync.Syncer
licenseService enterprise.LicenseService
profile *config.Profile
@@ -74,10 +72,9 @@ type DatabaseService struct {
}
// NewDatabaseService creates a new DatabaseService.
-func NewDatabaseService(store *store.Store, br *backuprun.Runner, schemaSyncer *schemasync.Syncer, licenseService enterprise.LicenseService, profile *config.Profile, iamManager *iam.Manager) *DatabaseService {
+func NewDatabaseService(store *store.Store, schemaSyncer *schemasync.Syncer, licenseService enterprise.LicenseService, profile *config.Profile, iamManager *iam.Manager) *DatabaseService {
return &DatabaseService{
store: store,
- backupRunner: br,
schemaSyncer: schemaSyncer,
licenseService: licenseService,
profile: profile,
diff --git a/backend/api/v1/org_policy_service.go b/backend/api/v1/org_policy_service.go
index 6851a03821..389d60517a 100644
--- a/backend/api/v1/org_policy_service.go
+++ b/backend/api/v1/org_policy_service.go
@@ -6,7 +6,6 @@ import (
"log/slog"
"strings"
- "github.com/google/cel-go/cel"
"github.com/pkg/errors"
"google.golang.org/genproto/googleapis/type/expr"
"google.golang.org/grpc/codes"
@@ -540,13 +539,6 @@ func validatePolicyPayload(policyType api.PolicyType, policy *v1pb.Policy) error
func (s *OrgPolicyService) convertPolicyPayloadToString(policy *v1pb.Policy) (string, error) {
switch policy.Type {
- case v1pb.PolicyType_WORKSPACE_IAM:
- iamPolicy := convertToStorePBWorkspaceIAMPolicy(policy.GetWorkspaceIamPolicy())
- payloadBytes, err := protojson.Marshal(iamPolicy)
- if err != nil {
- return "", errors.Wrap(err, "failed to marshal workspace iam policy")
- }
- return string(payloadBytes), nil
case v1pb.PolicyType_ROLLOUT_POLICY:
rolloutPolicy := convertToStorePBRolloutPolicy(policy.GetRolloutPolicy())
payloadBytes, err := protojson.Marshal(rolloutPolicy)
@@ -663,18 +655,6 @@ func convertToPolicy(parentPath string, policyMessage *store.PolicyMessage) (*v1
pType := v1pb.PolicyType_POLICY_TYPE_UNSPECIFIED
switch policyMessage.Type {
- case api.PolicyTypeWorkspaceIAM:
- pType = v1pb.PolicyType_WORKSPACE_IAM
- storepbIAMPolicy := &storepb.IamPolicy{}
- err := protojson.Unmarshal([]byte(policyMessage.Payload), storepbIAMPolicy)
- if err != nil {
- return nil, errors.Wrap(err, "failed to unmarshal workspace IAM policy")
- }
- payload, err := convertToV1PBWorkspaceIAMPolicy(storepbIAMPolicy)
- if err != nil {
- return nil, errors.Wrap(err, "failed to convert workspace IAM policy")
- }
- policy.Policy = payload
case api.PolicyTypeRollout:
pType = v1pb.PolicyType_ROLLOUT_POLICY
payload, err := convertToV1RolloutPolicyPayload(policyMessage.Payload)
@@ -754,54 +734,6 @@ func convertToPolicy(parentPath string, policyMessage *store.PolicyMessage) (*v1
return policy, nil
}
-func convertToV1PBWorkspaceIAMPolicy(policy *storepb.IamPolicy) (*v1pb.Policy_WorkspaceIamPolicy, error) {
- iamPolicy := &v1pb.IamPolicy{
- Bindings: []*v1pb.Binding{},
- }
- for _, binding := range policy.Bindings {
- v1pbBinding := v1pb.Binding{
- Role: binding.Role,
- Members: binding.Members,
- Condition: binding.Condition,
- }
-
- env, err := cel.NewEnv(common.IAMPolicyConditionCELAttributes...)
- if err != nil {
- return nil, errors.Wrap(err, "failed to create cel environment")
- }
- if binding.Condition.Expression != "" {
- ast, issues := env.Parse(binding.Condition.Expression)
- if issues != nil && issues.Err() != nil {
- return nil, errors.Wrap(issues.Err(), "failed to parse expression")
- }
- parsedExpr, err := cel.AstToParsedExpr(ast)
- if err != nil {
- return nil, errors.Wrap(err, "failed to convert ast to parsed expression")
- }
- v1pbBinding.ParsedExpr = parsedExpr
- }
- iamPolicy.Bindings = append(iamPolicy.Bindings, &v1pbBinding)
- }
- return &v1pb.Policy_WorkspaceIamPolicy{
- WorkspaceIamPolicy: iamPolicy,
- }, nil
-}
-
-func convertToStorePBWorkspaceIAMPolicy(policy *v1pb.IamPolicy) *storepb.IamPolicy {
- iamPolicy := &storepb.IamPolicy{
- Bindings: []*storepb.Binding{},
- }
- for _, binding := range policy.Bindings {
- iamBinding := storepb.Binding{
- Role: binding.Role,
- Members: binding.Members,
- Condition: binding.Condition,
- }
- iamPolicy.Bindings = append(iamPolicy.Bindings, &iamBinding)
- }
- return iamPolicy
-}
-
func convertToV1PBSQLReviewPolicy(payloadStr string) (*v1pb.Policy_SqlReviewPolicy, error) {
p := new(storepb.SQLReviewPolicy)
if err := protojson.Unmarshal([]byte(payloadStr), p); err != nil {
@@ -1121,8 +1053,6 @@ func convertToRestrictIssueCreationForSQLReviewPayload(policy *v1pb.RestrictIssu
func convertPolicyType(pType string) (api.PolicyType, error) {
var policyType api.PolicyType
switch strings.ToUpper(pType) {
- case v1pb.PolicyType_WORKSPACE_IAM.String():
- return api.PolicyTypeWorkspaceIAM, nil
case v1pb.PolicyType_ROLLOUT_POLICY.String():
return api.PolicyTypeRollout, nil
case v1pb.PolicyType_SQL_REVIEW.String():
diff --git a/backend/legacyapi/anomaly.go b/backend/legacyapi/anomaly.go
index e71f978ef9..768bc9aa70 100644
--- a/backend/legacyapi/anomaly.go
+++ b/backend/legacyapi/anomaly.go
@@ -8,10 +8,6 @@ const (
AnomalyInstanceConnection AnomalyType = "bb.anomaly.instance.connection"
// AnomalyInstanceMigrationSchema is the anomaly type for schema migrations.
AnomalyInstanceMigrationSchema AnomalyType = "bb.anomaly.instance.migration-schema"
- // AnomalyDatabaseBackupPolicyViolation is the anomaly type for backup policy violations.
- AnomalyDatabaseBackupPolicyViolation AnomalyType = "bb.anomaly.database.backup.policy-violation"
- // AnomalyDatabaseBackupMissing is the anomaly type for missing backups.
- AnomalyDatabaseBackupMissing AnomalyType = "bb.anomaly.database.backup.missing"
// AnomalyDatabaseConnection is the anomaly type for database connections.
AnomalyDatabaseConnection AnomalyType = "bb.anomaly.database.connection"
// AnomalyDatabaseSchemaDrift is the anomaly type for database schema drifts.
@@ -24,20 +20,6 @@ type AnomalyInstanceConnectionPayload struct {
Detail string `json:"detail,omitempty"`
}
-// AnomalyDatabaseBackupPolicyViolationPayload is the API message for backup policy violation payloads.
-type AnomalyDatabaseBackupPolicyViolationPayload struct {
- EnvironmentID int `json:"environmentId,omitempty"`
- ExpectedBackupSchedule BackupPlanPolicySchedule `json:"expectedSchedule,omitempty"`
- ActualBackupSchedule BackupPlanPolicySchedule `json:"actualSchedule,omitempty"`
-}
-
-// AnomalyDatabaseBackupMissingPayload is the API message for missing backup payloads.
-type AnomalyDatabaseBackupMissingPayload struct {
- ExpectedBackupSchedule BackupPlanPolicySchedule `json:"expectedSchedule,omitempty"`
- // Time of last successful backup created
- LastBackupTs int64 `json:"lastBackupTs,omitempty"`
-}
-
// AnomalyDatabaseConnectionPayload is the API message for database connection payloads.
type AnomalyDatabaseConnectionPayload struct {
// Connection failure detail
diff --git a/backend/legacyapi/policy.go b/backend/legacyapi/policy.go
index 063aaaee1d..5e2cd7728f 100644
--- a/backend/legacyapi/policy.go
+++ b/backend/legacyapi/policy.go
@@ -28,12 +28,8 @@ const (
// DefaultPolicyID is the ID of the default policy.
DefaultPolicyID int = 0
- // PolicyTypeWorkspaceIAM is the workspace IAM policy type.
- PolicyTypeWorkspaceIAM PolicyType = "bb.policy.workspace-iam"
// PolicyTypeRollout is the rollout policy type.
PolicyTypeRollout PolicyType = "bb.policy.rollout"
- // PolicyTypeBackupPlan is the backup plan policy type.
- PolicyTypeBackupPlan PolicyType = "bb.policy.backup-plan"
// PolicyTypeSQLReview is the sql review policy type.
PolicyTypeSQLReview PolicyType = "bb.policy.sql-review"
// PolicyTypeEnvironmentTier is the tier of an environment.
@@ -90,9 +86,7 @@ const (
var (
// AllowedResourceTypes includes allowed resource types for each policy type.
AllowedResourceTypes = map[PolicyType][]PolicyResourceType{
- PolicyTypeWorkspaceIAM: {PolicyResourceTypeWorkspace},
PolicyTypeRollout: {PolicyResourceTypeEnvironment},
- PolicyTypeBackupPlan: {PolicyResourceTypeEnvironment},
PolicyTypeSQLReview: {PolicyResourceTypeEnvironment},
PolicyTypeEnvironmentTier: {PolicyResourceTypeEnvironment},
PolicyTypeMasking: {PolicyResourceTypeDatabase},
diff --git a/backend/legacyapi/task.go b/backend/legacyapi/task.go
index a32c26f010..15ec83c0e4 100644
--- a/backend/legacyapi/task.go
+++ b/backend/legacyapi/task.go
@@ -46,12 +46,6 @@ const (
TaskDatabaseSchemaUpdateGhostCutover TaskType = "bb.task.database.schema.update.ghost.cutover"
// TaskDatabaseDataUpdate is the task type for updating database data.
TaskDatabaseDataUpdate TaskType = "bb.task.database.data.update"
- // TaskDatabaseBackup is the task type for creating database backups.
- TaskDatabaseBackup TaskType = "bb.task.database.backup"
- // TaskDatabaseRestorePITRRestore is the task type for restoring databases using PITR.
- TaskDatabaseRestorePITRRestore TaskType = "bb.task.database.restore.pitr.restore"
- // TaskDatabaseRestorePITRCutover is the task type for swapping the pitr and original database.
- TaskDatabaseRestorePITRCutover TaskType = "bb.task.database.restore.pitr.cutover"
// TaskDatabaseDataExport is the task type for exporting database data.
TaskDatabaseDataExport TaskType = "bb.task.database.data.export"
)
@@ -60,43 +54,6 @@ const (
// So we annotate with json tag using camelCase naming which is consistent with normal
// json naming convention
-// TaskDatabasePITRRestorePayload is the task payload for database PITR restore.
-type TaskDatabasePITRRestorePayload struct {
- // Common fields
- Skipped bool `json:"skipped,omitempty"`
- SkippedReason string `json:"skippedReason,omitempty"`
- SpecID string `json:"specId,omitempty"`
-
- // The project owning the database.
- ProjectID int `json:"projectId,omitempty"`
-
- // DatabaseName is the target database name.
- // It is nil for the case of in-place PITR.
- DatabaseName *string `json:"databaseName,omitempty"`
-
- // TargetInstanceId must be within the same environment as the instance of the original database.
- // Only used when doing PITR to a new database now.
- TargetInstanceID *int `json:"targetInstanceId,omitempty"`
-
- // BackupID and PointInTimeTs only allow one non-nil.
-
- // Only used when doing restore full backup only.
- BackupID *int `json:"backupId,omitempty"`
-
- // After the PITR operations, the database will be recovered to the state at this time.
- // Represented in UNIX timestamp in seconds.
- PointInTimeTs *int64 `json:"pointInTimeTs,omitempty"`
-}
-
-// TaskDatabasePITRCutoverPayload is the task payload for PITR cutover.
-// It is currently only a placeholder.
-type TaskDatabasePITRCutoverPayload struct {
- // Common fields
- Skipped bool `json:"skipped,omitempty"`
- SkippedReason string `json:"skippedReason,omitempty"`
- SpecID string `json:"specId,omitempty"`
-}
-
// TaskDatabaseCreatePayload is the task payload for creating databases.
type TaskDatabaseCreatePayload struct {
// Common fields
@@ -234,16 +191,6 @@ type PreUpdateBackupDetail struct {
Database string `json:"database,omitempty"`
}
-// TaskDatabaseBackupPayload is the task payload for database backup.
-type TaskDatabaseBackupPayload struct {
- // Common fields
- Skipped bool `json:"skipped,omitempty"`
- SkippedReason string `json:"skippedReason,omitempty"`
- SpecID string `json:"specId,omitempty"`
-
- BackupID int `json:"backupId,omitempty"`
-}
-
// TaskDatabaseDataExportPayload is the task payload for database data export.
type TaskDatabaseDataExportPayload struct {
// Common fields
diff --git a/backend/metric/collector/policy_count.go b/backend/metric/collector/policy_count.go
index db7251161d..f8eac2b9e2 100644
--- a/backend/metric/collector/policy_count.go
+++ b/backend/metric/collector/policy_count.go
@@ -54,15 +54,7 @@ func (c *policyCountCollector) Collect(ctx context.Context) ([]*metric.Metric, e
rowStatus = api.Archived
}
- switch policy.Type {
- case api.PolicyTypeBackupPlan:
- payload, err := api.UnmarshalBackupPlanPolicy(policy.Payload)
- if err != nil {
- continue
- }
- value = string(payload.Schedule)
- key = fmt.Sprintf("%s_%s_%s_%s", policy.Type, environment.Title, value, rowStatus)
- case api.PolicyTypeSQLReview:
+ if policy.Type == api.PolicyTypeSQLReview {
key = fmt.Sprintf("%s_%s_%s", policy.Type, environment.Title, rowStatus)
// SQL review policy don't need to set the value.
value = ""
diff --git a/backend/migrator/migration/prod/2.15/0002##pitr.sql b/backend/migrator/migration/prod/2.15/0002##pitr.sql
new file mode 100644
index 0000000000..f594544383
--- /dev/null
+++ b/backend/migrator/migration/prod/2.15/0002##pitr.sql
@@ -0,0 +1,13 @@
+ALTER TABLE db DROP COLUMN source_backup_id;
+DROP TABLE backup;
+DROP TABLE backup_setting;
+DELETE FROM anomaly WHERE type = 'bb.anomaly.database.backup.missing';
+DELETE FROM anomaly WHERE type = 'bb.anomaly.database.backup.policy-violation';
+DELETE FROM policy WHERE type = 'bb.policy.backup-plan';
+DELETE FROM policy WHERE type = 'bb.policy.workspace-iam';
+DELETE FROM plan_check_run WHERE type = 'bb.plan-check.database.pitr.mysql';
+DELETE FROM task_run WHERE task_id IN (SELECT id FROM task WHERE type = 'bb.task.database.backup' OR type = 'bb.task.database.restore.pitr.restore' OR type = 'bb.task.database.restore.pitr.cutover');
+DELETE FROM task WHERE type = 'bb.task.database.backup' OR type = 'bb.task.database.restore.pitr.restore' OR type = 'bb.task.database.restore.pitr.cutover';
+DELETE FROM stage WHERE NOT EXISTS (SELECT task.id FROM task WHERE task.stage_id = stage.id);
+DELETE FROM issue WHERE NOT EXISTS (SELECT task.id FROM task WHERE task.pipeline_id = issue.pipeline_id) AND issue.type = 'bb.issue.database.general';
+DELETE FROM pipeline WHERE NOT EXISTS (SELECT task.id FROM task WHERE task.pipeline_id = pipeline.id);
diff --git a/backend/migrator/migration/prod/LATEST.sql b/backend/migrator/migration/prod/LATEST.sql
index 7605b6d337..c4ee68b323 100644
--- a/backend/migrator/migration/prod/LATEST.sql
+++ b/backend/migrator/migration/prod/LATEST.sql
@@ -399,8 +399,6 @@ CREATE TABLE db (
instance_id INTEGER NOT NULL REFERENCES instance (id),
project_id INTEGER NOT NULL REFERENCES project (id),
environment_id INTEGER REFERENCES environment (id),
- -- If db is restored from a backup, then we will record that backup id. We can thus trace up to the original db.
- source_backup_id INTEGER,
sync_status TEXT NOT NULL CHECK (sync_status IN ('OK', 'NOT_FOUND')),
last_successful_sync_ts BIGINT NOT NULL,
schema_version TEXT NOT NULL,
@@ -482,68 +480,6 @@ UPDATE
ON data_source FOR EACH ROW
EXECUTE FUNCTION trigger_update_updated_ts();
--- backup stores the backups for a particular database.
-CREATE TABLE backup (
- id SERIAL PRIMARY KEY,
- row_status row_status NOT NULL DEFAULT 'NORMAL',
- creator_id INTEGER NOT NULL REFERENCES principal (id),
- created_ts BIGINT NOT NULL DEFAULT extract(epoch from now()),
- updater_id INTEGER NOT NULL REFERENCES principal (id),
- updated_ts BIGINT NOT NULL DEFAULT extract(epoch from now()),
- database_id INTEGER NOT NULL REFERENCES db (id),
- name TEXT NOT NULL,
- status TEXT NOT NULL CHECK (status IN ('PENDING_CREATE', 'DONE', 'FAILED')),
- type TEXT NOT NULL CHECK (type IN ('MANUAL', 'AUTOMATIC', 'PITR')),
- storage_backend TEXT NOT NULL CHECK (storage_backend IN ('LOCAL', 'S3', 'GCS', 'OSS')),
- migration_history_version TEXT NOT NULL,
- path TEXT NOT NULL,
- comment TEXT NOT NULL DEFAULT '',
- payload JSONB NOT NULL DEFAULT '{}'
-);
-
-CREATE INDEX idx_backup_database_id ON backup(database_id);
-
-CREATE UNIQUE INDEX idx_backup_unique_database_id_name ON backup(database_id, name);
-
-ALTER SEQUENCE backup_id_seq RESTART WITH 101;
-
-CREATE TRIGGER update_backup_updated_ts
-BEFORE
-UPDATE
- ON backup FOR EACH ROW
-EXECUTE FUNCTION trigger_update_updated_ts();
-
--- backup_setting stores the backup settings for a particular database.
--- This is a strict version of cron expression using UTC timezone uniformly.
-CREATE TABLE backup_setting (
- id SERIAL PRIMARY KEY,
- row_status row_status NOT NULL DEFAULT 'NORMAL',
- creator_id INTEGER NOT NULL REFERENCES principal (id),
- created_ts BIGINT NOT NULL DEFAULT extract(epoch from now()),
- updater_id INTEGER NOT NULL REFERENCES principal (id),
- updated_ts BIGINT NOT NULL DEFAULT extract(epoch from now()),
- database_id INTEGER NOT NULL REFERENCES db (id),
- -- enable automatic backup schedule.
- enabled BOOLEAN NOT NULL,
- hour INTEGER NOT NULL CHECK (hour >= 0 AND hour <= 23),
- -- day_of_week can be -1 which is wildcard (daily automatic backup).
- day_of_week INTEGER NOT NULL CHECK (day_of_week >= -1 AND day_of_week <= 6),
- -- retention_period_ts == 0 means unset retention period and we do not delete any data.
- retention_period_ts INTEGER NOT NULL DEFAULT 0 CHECK (retention_period_ts >= 0),
- -- hook_url is the callback url to be requested after a successful backup.
- hook_url TEXT NOT NULL
-);
-
-CREATE UNIQUE INDEX idx_backup_setting_unique_database_id ON backup_setting(database_id);
-
-ALTER SEQUENCE backup_setting_id_seq RESTART WITH 101;
-
-CREATE TRIGGER update_backup_setting_updated_ts
-BEFORE
-UPDATE
- ON backup_setting FOR EACH ROW
-EXECUTE FUNCTION trigger_update_updated_ts();
-
-----------------------
-- Pipeline related BEGIN
-- pipeline table
diff --git a/backend/migrator/migrator_test.go b/backend/migrator/migrator_test.go
index 2e407822ae..6922c10b7a 100644
--- a/backend/migrator/migrator_test.go
+++ b/backend/migrator/migrator_test.go
@@ -230,5 +230,5 @@ func TestMigrationCompatibility(t *testing.T) {
func TestGetCutoffVersion(t *testing.T) {
releaseVersion, err := getProdCutoffVersion()
require.NoError(t, err)
- require.Equal(t, semver.MustParse("2.15.1"), releaseVersion)
+ require.Equal(t, semver.MustParse("2.15.2"), releaseVersion)
}
diff --git a/backend/runner/backuprun/runner.go b/backend/runner/backuprun/runner.go
deleted file mode 100644
index cb756fac51..0000000000
--- a/backend/runner/backuprun/runner.go
+++ /dev/null
@@ -1,533 +0,0 @@
-// Package backuprun is the runner for backups.
-package backuprun
-
-import (
- "context"
- "encoding/json"
- "fmt"
- "log/slog"
- "math"
- "net/http"
- "os"
- "path"
- "path/filepath"
- "sync"
- "time"
-
- "github.com/gosimple/slug"
- "github.com/pkg/errors"
-
- "github.com/bytebase/bytebase/backend/common"
- "github.com/bytebase/bytebase/backend/common/log"
- "github.com/bytebase/bytebase/backend/component/config"
- "github.com/bytebase/bytebase/backend/component/dbfactory"
- "github.com/bytebase/bytebase/backend/component/state"
- api "github.com/bytebase/bytebase/backend/legacyapi"
- "github.com/bytebase/bytebase/backend/plugin/db"
- "github.com/bytebase/bytebase/backend/plugin/db/mysql"
- "github.com/bytebase/bytebase/backend/plugin/storage/s3"
- "github.com/bytebase/bytebase/backend/store"
- "github.com/bytebase/bytebase/backend/utils"
- storepb "github.com/bytebase/bytebase/proto/generated-go/store"
-)
-
-// NewRunner creates a new backup runner.
-func NewRunner(store *store.Store, dbFactory *dbfactory.DBFactory, s3Client *s3.Client, stateCfg *state.State, profile *config.Profile) *Runner {
- return &Runner{
- store: store,
- dbFactory: dbFactory,
- s3Client: s3Client,
- stateCfg: stateCfg,
- profile: profile,
- downloadBinlogInstanceIDs: make(map[int]bool),
- }
-}
-
-// Runner is the backup runner scheduling automatic backups.
-type Runner struct {
- store *store.Store
- dbFactory *dbfactory.DBFactory
- s3Client *s3.Client
- stateCfg *state.State
- profile *config.Profile
- downloadBinlogInstanceIDs map[int]bool
- backupWg sync.WaitGroup
- downloadBinlogWg sync.WaitGroup
- downloadBinlogMu sync.Mutex
-}
-
-// Run is the runner for backup runner.
-func (r *Runner) Run(ctx context.Context, wg *sync.WaitGroup) {
- ticker := time.NewTicker(r.profile.BackupRunnerInterval)
- defer ticker.Stop()
- defer wg.Done()
- slog.Debug("Auto backup runner started", slog.Duration("interval", r.profile.BackupRunnerInterval))
- for {
- select {
- case <-ticker.C:
- func() {
- defer func() {
- if r := recover(); r != nil {
- err, ok := r.(error)
- if !ok {
- err = errors.Errorf("%v", r)
- }
- slog.Error("Auto backup runner PANIC RECOVER", log.BBError(err), log.BBStack("panic-stack"))
- }
- }()
- r.startAutoBackups(ctx)
- r.downloadBinlogFiles(ctx)
- r.purgeExpiredBackupData(ctx)
- }()
- case <-ctx.Done(): // if cancel() execute
- r.backupWg.Wait()
- r.downloadBinlogWg.Wait()
- return
- }
- }
-}
-
-// TODO(dragonly): Make best effort to assure that users could recover to at least RetentionPeriodTs ago.
-// This may require pending deleting expired backup files and binlog files.
-func (r *Runner) purgeExpiredBackupData(ctx context.Context) {
- backupSettingList, err := r.store.ListBackupSettingV2(ctx, &store.FindBackupSettingMessage{})
- if err != nil {
- slog.Error("Failed to find all the backup settings.", log.BBError(err))
- return
- }
-
- for _, bs := range backupSettingList {
- if bs.RetentionPeriodTs == api.BackupRetentionPeriodUnset {
- continue // next database
- }
- statusNormal := api.Normal
- backupList, err := r.store.ListBackupV2(ctx, &store.FindBackupMessage{
- DatabaseUID: &bs.DatabaseUID,
- RowStatus: &statusNormal,
- })
- if err != nil {
- slog.Error("Failed to get backups for database.", slog.Int("databaseID", bs.DatabaseUID))
- return
- }
- for _, backup := range backupList {
- backupTime := time.Unix(backup.UpdatedTs, 0)
- expireTime := backupTime.Add(time.Duration(bs.RetentionPeriodTs) * time.Second)
- if time.Now().After(expireTime) {
- slog.Debug("Purging expired backup", slog.Int("databaseID", backup.DatabaseUID), slog.String("backup", backup.Name), slog.String("storageBackend", string(backup.StorageBackend)))
- if err := r.purgeBackup(ctx, backup); err != nil {
- slog.Error("Failed to purge backup", slog.String("backup", backup.Name), log.BBError(err))
- }
- }
- }
- }
-
- instanceList, err := r.store.ListInstancesV2(ctx, &store.FindInstanceMessage{})
- if err != nil {
- slog.Error("Failed to find non-archived instances.", log.BBError(err))
- return
- }
-
- for _, instance := range instanceList {
- if instance.Engine != storepb.Engine_MYSQL && instance.Engine != storepb.Engine_MARIADB {
- continue
- }
- maxRetentionPeriodTs, err := r.getMaxRetentionPeriodTsForMySQLInstance(ctx, instance)
- if err != nil {
- slog.Error("Failed to get max retention period for MySQL instance", slog.String("instance", instance.Title), log.BBError(err))
- continue
- }
- if maxRetentionPeriodTs == math.MaxInt {
- continue
- }
- if err := r.purgeBinlogFiles(ctx, instance.UID, maxRetentionPeriodTs); err != nil {
- slog.Error("Failed to purge binlog files for instance", slog.String("instance", instance.Title), slog.Int("retentionPeriodTs", maxRetentionPeriodTs), log.BBError(err))
- }
- }
-}
-
-func (r *Runner) getMaxRetentionPeriodTsForMySQLInstance(ctx context.Context, instance *store.InstanceMessage) (int, error) {
- backupSettingList, err := r.store.ListBackupSettingV2(ctx, &store.FindBackupSettingMessage{InstanceUID: &instance.UID})
- if err != nil {
- slog.Error("Failed to find backup settings for instance.", slog.String("instance", instance.Title), log.BBError(err))
- return 0, errors.Wrapf(err, "failed to find backup settings for instance %q", instance.Title)
- }
- maxRetentionPeriodTs := math.MaxInt
- for _, bs := range backupSettingList {
- if bs.RetentionPeriodTs != api.BackupRetentionPeriodUnset && bs.RetentionPeriodTs < maxRetentionPeriodTs {
- maxRetentionPeriodTs = bs.RetentionPeriodTs
- }
- }
- return maxRetentionPeriodTs, nil
-}
-
-func (r *Runner) purgeBinlogFiles(ctx context.Context, instanceID, retentionPeriodTs int) error {
- binlogDir := common.GetBinlogAbsDir(r.profile.DataDir, instanceID)
- switch r.profile.BackupStorageBackend {
- case api.BackupStorageBackendLocal:
- return r.purgeBinlogFilesLocal(binlogDir, retentionPeriodTs)
- case api.BackupStorageBackendS3:
- return r.purgeBinlogFilesOnCloud(ctx, binlogDir, retentionPeriodTs)
- default:
- return errors.Errorf("purge binlog files not implemented for storage backend %s", r.profile.BackupStorageBackend)
- }
-}
-
-func (r *Runner) purgeBinlogFilesOnCloud(ctx context.Context, binlogDir string, retentionPeriodTs int) error {
- binlogDirOnCloud := common.GetBinlogRelativeDir(binlogDir)
- listOutput, err := r.s3Client.ListObjects(ctx, binlogDirOnCloud)
- if err != nil {
- return errors.Wrapf(err, "failed to list binlog dir %q in the cloud storage", binlogDirOnCloud)
- }
- var purgeBinlogPathList []string
- for _, item := range listOutput {
- expireTime := item.LastModified.Add(time.Duration(retentionPeriodTs) * time.Second)
- if time.Now().After(expireTime) {
- purgeBinlogPathList = append(purgeBinlogPathList, *item.Key)
- }
- }
- if len(purgeBinlogPathList) > 0 {
- slog.Debug(fmt.Sprintf("Deleting %d expired binlog files from the cloud storage.", len(purgeBinlogPathList)))
- if _, err := r.s3Client.DeleteObjects(ctx, purgeBinlogPathList...); err != nil {
- return errors.Wrapf(err, "failed to delete %d expired binlog files from the cloud storage", len(purgeBinlogPathList))
- }
- }
- return nil
-}
-
-// TODO(dragonly): Remove metadata as well.
-func (*Runner) purgeBinlogFilesLocal(binlogDir string, retentionPeriodTs int) error {
- binlogFileInfoList, err := os.ReadDir(binlogDir)
- if err != nil {
- if os.IsNotExist(err) {
- return nil
- }
- return errors.Wrapf(err, "failed to read backup directory %q", binlogDir)
- }
- for _, binlogFileInfo := range binlogFileInfoList {
- // We use modification time of local binlog files which is later than the modification time of that on the MySQL server,
- // which in turn is later than the last event timestamp of the binlog file.
- // This is not accurate and gives about 10 minutes (backup runner interval) more retention time to the binlog files, which is acceptable.
- fileInfo, err := binlogFileInfo.Info()
- if err != nil {
- slog.Warn("Failed to get file info.", slog.String("path", binlogFileInfo.Name()), log.BBError(err))
- continue
- }
- expireTime := fileInfo.ModTime().Add(time.Duration(retentionPeriodTs) * time.Second)
- if time.Now().After(expireTime) {
- binlogFilePath := path.Join(binlogDir, binlogFileInfo.Name())
- slog.Debug("Deleting expired local binlog file for MySQL instance.", slog.String("path", binlogFilePath))
- if err := os.Remove(binlogFilePath); err != nil {
- if !os.IsNotExist(err) {
- slog.Warn("Failed to remove an expired binlog file.", slog.String("path", binlogFilePath), log.BBError(err))
- }
- continue
- }
- slog.Info("Deleted expired binlog file.", slog.String("path", binlogFilePath))
- }
- }
- return nil
-}
-
-func (r *Runner) purgeBackup(ctx context.Context, backup *store.BackupMessage) error {
- archive := api.Archived
- backupPatch := &store.UpdateBackupMessage{
- UID: backup.UID,
- UpdaterID: api.SystemBotID,
- RowStatus: &archive,
- }
- if _, err := r.store.UpdateBackupV2(ctx, backupPatch); err != nil {
- return errors.Wrapf(err, "failed to update status for deleted backup %q for database with ID %d", backup.Name, backup.DatabaseUID)
- }
- slog.Debug("Archived expired backup record", slog.String("name", backup.Name), slog.Int("id", backup.UID))
-
- switch backup.StorageBackend {
- case api.BackupStorageBackendLocal:
- backupFilePath := GetBackupAbsFilePath(r.profile.DataDir, backup.DatabaseUID, backup.Name)
- if err := os.Remove(backupFilePath); err != nil {
- return errors.Wrapf(err, "failed to delete an expired backup file %q", backupFilePath)
- }
- slog.Debug(fmt.Sprintf("Deleted expired local backup file %s", backupFilePath))
- case api.BackupStorageBackendS3:
- backupFilePath := getBackupRelativeFilePath(backup.DatabaseUID, backup.Name)
- if _, err := r.s3Client.DeleteObjects(ctx, backupFilePath); err != nil {
- return errors.Wrapf(err, "failed to delete backup file %s in the cloud storage", backupFilePath)
- }
- slog.Debug(fmt.Sprintf("Deleted expired backup file %s in the cloud storage", backupFilePath))
- }
-
- return nil
-}
-
-func (r *Runner) downloadBinlogFiles(ctx context.Context) {
- instances, err := r.store.FindInstanceWithDatabaseBackupEnabled(ctx)
- if err != nil {
- slog.Error("Failed to retrieve MySQL instance list with at least one database backup enabled", log.BBError(err))
- return
- }
-
- r.downloadBinlogMu.Lock()
- defer r.downloadBinlogMu.Unlock()
- for _, instance := range instances {
- if instance.Engine != storepb.Engine_MYSQL && instance.Engine != storepb.Engine_MARIADB {
- continue
- }
- if _, ok := r.downloadBinlogInstanceIDs[instance.UID]; !ok {
- r.downloadBinlogInstanceIDs[instance.UID] = true
- go r.downloadBinlogFilesForInstance(ctx, instance)
- r.downloadBinlogWg.Add(1)
- }
- }
-}
-
-func (r *Runner) downloadBinlogFilesForInstance(ctx context.Context, instance *store.InstanceMessage) {
- defer func() {
- r.downloadBinlogMu.Lock()
- delete(r.downloadBinlogInstanceIDs, instance.UID)
- r.downloadBinlogMu.Unlock()
- r.downloadBinlogWg.Done()
- }()
- driver, err := r.dbFactory.GetAdminDatabaseDriver(ctx, instance, nil /* database */, db.ConnectionContext{})
- if err != nil {
- if common.ErrorCode(err) == common.DbConnectionFailure {
- slog.Debug("Cannot connect to instance", slog.String("instance", instance.ResourceID), log.BBError(err))
- return
- }
- slog.Error("Failed to get driver for MySQL instance when downloading binlog", slog.String("instance", instance.ResourceID), log.BBError(err))
- return
- }
- defer driver.Close(ctx)
-
- mysqlDriver, ok := driver.(*mysql.Driver)
- if !ok {
- slog.Error("Failed to cast driver to mysql.Driver", slog.String("instance", instance.ResourceID))
- return
- }
- if err := mysqlDriver.FetchAllBinlogFiles(ctx, false /* downloadLatestBinlogFile */, r.s3Client); err != nil {
- slog.Error("Failed to download all binlog files for instance", slog.String("instance", instance.ResourceID), log.BBError(err))
- return
- }
-}
-
-func (r *Runner) startAutoBackups(ctx context.Context) {
- // Find all databases that need a backup in this hour.
- t := time.Now().UTC().Truncate(time.Hour)
- backupSettingList, err := r.store.FindBackupSettingsMatch(ctx, &store.BackupSettingsMatchMessage{
- Hour: t.Hour(),
- DayOfWeek: int(t.Weekday()),
- })
- if err != nil {
- slog.Error("Failed to retrieve backup settings match", log.BBError(err))
- return
- }
-
- for _, backupSetting := range backupSettingList {
- if _, ok := r.stateCfg.RunningBackupDatabases.Load(backupSetting.DatabaseUID); ok {
- continue
- }
- database, err := r.store.GetDatabaseV2(ctx, &store.FindDatabaseMessage{UID: &backupSetting.DatabaseUID})
- if err != nil {
- slog.Error("Failed to get database", log.BBError(err))
- return
- }
- project, err := r.store.GetProjectV2(ctx, &store.FindProjectMessage{ResourceID: &database.ProjectID})
- if err != nil {
- slog.Error("Failed to get project", log.BBError(err))
- }
- if project.Deleted {
- continue
- }
- instance, err := r.store.GetInstanceV2(ctx, &store.FindInstanceMessage{ResourceID: &database.InstanceID})
- if err != nil {
- slog.Error("Failed to get instance", log.BBError(err))
- }
- if instance.Deleted {
- continue
- }
- // backup for ClickHouse, Snowflake, MongoDB, Spanner, Redis, Oracle is not supported.
- if instance.Engine == storepb.Engine_CLICKHOUSE || instance.Engine == storepb.Engine_SNOWFLAKE || instance.Engine == storepb.Engine_MONGODB || instance.Engine == storepb.Engine_SPANNER || instance.Engine == storepb.Engine_REDIS || instance.Engine == storepb.Engine_ORACLE || instance.Engine == storepb.Engine_OCEANBASE_ORACLE {
- continue
- }
- environment, err := r.store.GetEnvironmentV2(ctx, &store.FindEnvironmentMessage{ResourceID: &database.EffectiveEnvironmentID})
- if err != nil {
- slog.Error("Failed to get environment", log.BBError(err))
- }
- if environment.Deleted {
- continue
- }
- backupName := fmt.Sprintf("%s-%s-%s-autobackup", slug.Make(project.Title), slug.Make(environment.Title), t.Format("20060102T030405"))
- backupList, err := r.store.ListBackupV2(ctx, &store.FindBackupMessage{
- DatabaseUID: &database.UID,
- Name: &backupName,
- })
- if err != nil {
- slog.Error("Failed to find backup", log.BBError(err))
- continue
- }
- if len(backupList) > 0 {
- continue
- }
-
- r.stateCfg.RunningBackupDatabases.Store(backupSetting.DatabaseUID, true)
- go func(database *store.DatabaseMessage, backupName string, hookURL string) {
- defer func() {
- r.stateCfg.RunningBackupDatabases.Delete(database.UID)
- r.backupWg.Done()
- }()
- slog.Debug("Schedule auto backup",
- slog.String("database", database.DatabaseName),
- slog.String("backup", backupName),
- )
- if _, err := r.ScheduleBackupTask(ctx, database, backupName, api.BackupTypeAutomatic, api.SystemBotID); err != nil {
- slog.Error("Failed to create automatic backup for database",
- slog.Int("databaseID", database.UID),
- log.BBError(err))
- return
- }
- // Backup succeeded. POST hook URL.
- if hookURL == "" {
- return
- }
- resp, err := http.PostForm(hookURL, nil)
- if err != nil {
- slog.Warn("Failed to POST hook URL",
- slog.String("hookURL", hookURL),
- slog.Int("databaseID", database.UID),
- log.BBError(err))
- }
- defer resp.Body.Close()
- }(database, backupName, backupSetting.HookURL)
- r.backupWg.Add(1)
- }
-}
-
-// ScheduleBackupTask schedules a backup task.
-func (r *Runner) ScheduleBackupTask(ctx context.Context, database *store.DatabaseMessage, backupName string, backupType api.BackupType, creatorID int) (*store.BackupMessage, error) {
- instance, err := r.store.GetInstanceV2(ctx, &store.FindInstanceMessage{ResourceID: &database.InstanceID})
- if err != nil {
- return nil, err
- }
- if instance == nil {
- return nil, errors.Errorf("instance %q not found", database.InstanceID)
- }
- if instance.Deleted {
- return nil, errors.Errorf("instance %q deleted", database.InstanceID)
- }
- environment, err := r.store.GetEnvironmentV2(ctx, &store.FindEnvironmentMessage{ResourceID: &database.EffectiveEnvironmentID})
- if err != nil {
- return nil, err
- }
- if environment == nil {
- return nil, errors.Errorf("environment %q not found", instance.EnvironmentID)
- }
-
- driver, err := r.dbFactory.GetAdminDatabaseDriver(ctx, instance, database, db.ConnectionContext{})
- if err != nil {
- return nil, errors.Wrap(err, "failed to get admin database driver")
- }
- defer driver.Close(ctx)
-
- migrationHistoryVersion, err := utils.GetLatestSchemaVersion(ctx, r.store, instance.UID, database.UID, database.DatabaseName)
- if err != nil {
- return nil, errors.Wrapf(err, "failed to get migration history for database %q", database.DatabaseName)
- }
- path := getBackupRelativeFilePath(database.UID, backupName)
- if err := createBackupDirectory(r.profile.DataDir, database.UID); err != nil {
- return nil, errors.Wrap(err, "failed to create backup directory")
- }
-
- backupNew, err := r.store.CreateBackupV2(ctx, &store.BackupMessage{
- Name: backupName,
- Status: api.BackupStatusPendingCreate,
- BackupType: backupType,
- Comment: "",
- StorageBackend: r.profile.BackupStorageBackend,
- MigrationHistoryVersion: migrationHistoryVersion,
- Path: path,
- }, database.UID, creatorID)
- if err != nil {
- if common.ErrorCode(err) == common.Conflict {
- slog.Error("Backup already exists for the database", slog.String("backup", backupName), slog.String("database", database.DatabaseName))
- return nil, nil
- }
- return nil, errors.Wrapf(err, "failed to create backup %q", backupName)
- }
-
- payload := api.TaskDatabaseBackupPayload{
- BackupID: backupNew.UID,
- }
- bytes, err := json.Marshal(payload)
- if err != nil {
- return nil, errors.Wrapf(err, "failed to create task payload for backup %q", backupName)
- }
-
- pipeline, err := r.store.CreatePipelineV2(ctx, &store.PipelineMessage{
- Name: fmt.Sprintf("backup-%s", backupName),
- ProjectID: database.ProjectID,
- }, creatorID)
- if err != nil {
- return nil, errors.Wrapf(err, "failed to create pipeline for backup %q", backupName)
- }
-
- createdStages, err := r.store.CreateStageV2(ctx, []*store.StageMessage{
- {
- Name: fmt.Sprintf("backup-%s", backupName),
- EnvironmentID: environment.UID,
- PipelineID: pipeline.ID,
- },
- }, creatorID)
- if err != nil {
- return nil, errors.Wrapf(err, "failed to create stage for backup %q", backupName)
- }
- if len(createdStages) != 1 {
- return nil, errors.Errorf("expect to get one returned stage after creating stage, got %d", len(createdStages))
- }
-
- createdStage := createdStages[0]
-
- tasks, err := r.store.CreateTasksV2(ctx, &store.TaskMessage{
- Name: fmt.Sprintf("backup-%s", backupName),
- PipelineID: pipeline.ID,
- StageID: createdStage.ID,
- InstanceID: instance.UID,
- DatabaseID: &database.UID,
- Type: api.TaskDatabaseBackup,
- Payload: string(bytes),
- CreatorID: creatorID,
- })
- if err != nil {
- return nil, errors.Wrapf(err, "failed to create task for backup %q", backupName)
- }
- task := tasks[0]
- if err := r.store.CreatePendingTaskRuns(ctx, &store.TaskRunMessage{
- CreatorID: creatorID,
- TaskUID: task.ID,
- Name: fmt.Sprintf("%s %d", task.Name, time.Now().Unix()),
- }); err != nil {
- return nil, errors.Wrapf(err, "failed to create pending task run for backup %q", backupName)
- }
-
- return backupNew, nil
-}
-
-// Get backup dir relative to the data dir.
-func getBackupRelativeDir(databaseID int) string {
- return filepath.Join("backup", "db", fmt.Sprintf("%d", databaseID))
-}
-
-func getBackupRelativeFilePath(databaseID int, name string) string {
- dir := getBackupRelativeDir(databaseID)
- return filepath.Join(dir, fmt.Sprintf("%s.sql", name))
-}
-
-// GetBackupAbsFilePath returns backup absolute file path for a database.
-func GetBackupAbsFilePath(dataDir string, databaseID int, name string) string {
- path := getBackupRelativeFilePath(databaseID, name)
- return filepath.Join(dataDir, path)
-}
-
-// Create backup directory for database.
-func createBackupDirectory(dataDir string, databaseID int) error {
- dir := getBackupRelativeDir(databaseID)
- absDir := filepath.Join(dataDir, dir)
- return os.MkdirAll(absDir, os.ModePerm)
-}
diff --git a/backend/runner/plancheck/pitr_mysql_executor.go b/backend/runner/plancheck/pitr_mysql_executor.go
deleted file mode 100644
index 98202f2376..0000000000
--- a/backend/runner/plancheck/pitr_mysql_executor.go
+++ /dev/null
@@ -1,87 +0,0 @@
-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"
- "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 plan check PITR MySQL executor.
-func NewPITRMySQLExecutor(store *store.Store, dbFactory *dbfactory.DBFactory) Executor {
- return &PITRMySQLExecutor{
- store: store,
- dbFactory: dbFactory,
- }
-}
-
-// PITRMySQLExecutor is to check if the MySQL database is ready for PITR.
-type PITRMySQLExecutor struct {
- store *store.Store
- dbFactory *dbfactory.DBFactory
-}
-
-// Run runs the PITR MySQL executor.
-func (e *PITRMySQLExecutor) Run(ctx context.Context, config *storepb.PlanCheckRunConfig) ([]*storepb.PlanCheckRunResult_Result, error) {
- if config.DatabaseGroupUid != nil {
- return nil, errors.Errorf("database group is not supported")
- }
-
- instanceUID := int(config.InstanceUid)
- instance, err := e.store.GetInstanceV2(ctx, &store.FindInstanceMessage{UID: &instanceUID})
- if err != nil {
- return nil, errors.Wrapf(err, "failed to get instance UID %v", instanceUID)
- }
- if instance == nil {
- return nil, errors.Errorf("instance not found UID %v", instanceUID)
- }
- databaseName := config.DatabaseName
-
- driver, err := e.dbFactory.GetAdminDatabaseDriver(ctx, instance, nil /* database */, db.ConnectionContext{})
- 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.Int32(),
- 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.Int32(),
- Title: "Error",
- Content: err.Error(),
- },
- }
-}
diff --git a/backend/runner/schemasync/syncer.go b/backend/runner/schemasync/syncer.go
index 06c9910041..1cde06f826 100644
--- a/backend/runner/schemasync/syncer.go
+++ b/backend/runner/schemasync/syncer.go
@@ -102,30 +102,6 @@ func (s *Syncer) trySyncAll(ctx context.Context) {
slog.Error("Failed to retrieve instances", log.BBError(err))
return
}
-
- environments, err := s.store.ListEnvironmentV2(ctx, &store.FindEnvironmentMessage{})
- if err != nil {
- slog.Error("Failed to retrieve environments", log.BBError(err))
- return
- }
-
- environmentsMap := map[string]*store.EnvironmentMessage{}
- for _, environment := range environments {
- environmentsMap[environment.ResourceID] = environment
- }
-
- backupPlanPolicyMap := make(map[string]*api.BackupPlanPolicy)
- for _, environment := range environments {
- policy, err := s.store.GetBackupPlanPolicyByEnvID(ctx, environment.UID)
- if err != nil {
- slog.Error("Failed to retrieve backup policy",
- slog.String("environment", environment.Title),
- log.BBError(err))
- return
- }
- backupPlanPolicyMap[environment.ResourceID] = policy
- }
-
now := time.Now()
for _, instance := range instances {
interval := getOrDefaultSyncInterval(instance)
@@ -184,17 +160,6 @@ func (s *Syncer) trySyncAll(ctx context.Context) {
slog.String("databaseName", database.DatabaseName),
log.BBError(err))
}
-
- environment, ok := environmentsMap[database.EffectiveEnvironmentID]
- if !ok {
- continue
- }
- backupPlanPolicy, ok := backupPlanPolicyMap[database.EffectiveEnvironmentID]
- if !ok {
- continue
- }
-
- s.checkBackupAnomaly(ctx, environment, instance, database, backupPlanPolicy)
}
}
@@ -584,171 +549,6 @@ func (s *Syncer) upsertDatabaseConnectionAnomaly(ctx context.Context, instance *
}
}
-func (s *Syncer) checkBackupAnomaly(ctx context.Context, environment *store.EnvironmentMessage, instance *store.InstanceMessage, database *store.DatabaseMessage, policy *api.BackupPlanPolicy) {
- if disableBackupAnomalyCheck(instance.Engine) {
- // skip checking backup anomalies for MongoDB, Spanner, Redis, Oracle, etc. because they don't support Backup.
- return
- }
-
- schedule := api.BackupPlanPolicyScheduleUnset
- backupSetting, err := s.store.GetBackupSettingV2(ctx, database.UID)
- if err != nil {
- slog.Error("Failed to retrieve backup setting",
- slog.String("instance", instance.ResourceID),
- slog.String("database", database.DatabaseName),
- log.BBError(err))
- return
- }
-
- if backupSetting != nil && backupSetting.Enabled && backupSetting.HourOfDay != -1 {
- if backupSetting.DayOfWeek == -1 {
- schedule = api.BackupPlanPolicyScheduleDaily
- } else {
- schedule = api.BackupPlanPolicyScheduleWeekly
- }
- }
-
- // Check backup policy violation
- {
- var backupPolicyAnomalyPayload *api.AnomalyDatabaseBackupPolicyViolationPayload
- if policy.Schedule != api.BackupPlanPolicyScheduleUnset {
- if policy.Schedule == api.BackupPlanPolicyScheduleDaily &&
- schedule != api.BackupPlanPolicyScheduleDaily {
- backupPolicyAnomalyPayload = &api.AnomalyDatabaseBackupPolicyViolationPayload{
- EnvironmentID: environment.UID,
- ExpectedBackupSchedule: policy.Schedule,
- ActualBackupSchedule: schedule,
- }
- } else if policy.Schedule == api.BackupPlanPolicyScheduleWeekly &&
- schedule == api.BackupPlanPolicyScheduleUnset {
- backupPolicyAnomalyPayload = &api.AnomalyDatabaseBackupPolicyViolationPayload{
- EnvironmentID: environment.UID,
- ExpectedBackupSchedule: policy.Schedule,
- ActualBackupSchedule: schedule,
- }
- }
- }
-
- if backupPolicyAnomalyPayload != nil {
- payload, err := json.Marshal(*backupPolicyAnomalyPayload)
- if err != nil {
- slog.Error("Failed to marshal anomaly payload",
- slog.String("instance", instance.ResourceID),
- slog.String("database", database.DatabaseName),
- slog.String("type", string(api.AnomalyDatabaseBackupPolicyViolation)),
- log.BBError(err))
- } else {
- if _, err = s.store.UpsertActiveAnomalyV2(ctx, api.SystemBotID, &store.AnomalyMessage{
- InstanceID: instance.ResourceID,
- DatabaseUID: &database.UID,
- Type: api.AnomalyDatabaseBackupPolicyViolation,
- Payload: string(payload),
- }); err != nil {
- slog.Error("Failed to create anomaly",
- slog.String("instance", instance.ResourceID),
- slog.String("database", database.DatabaseName),
- slog.String("type", string(api.AnomalyDatabaseBackupPolicyViolation)),
- log.BBError(err))
- }
- }
- } else {
- err := s.store.ArchiveAnomalyV2(ctx, &store.ArchiveAnomalyMessage{
- DatabaseUID: &database.UID,
- Type: api.AnomalyDatabaseBackupPolicyViolation,
- })
- if err != nil && common.ErrorCode(err) != common.NotFound {
- slog.Error("Failed to close anomaly",
- slog.String("instance", instance.ResourceID),
- slog.String("database", database.DatabaseName),
- slog.String("type", string(api.AnomalyDatabaseBackupPolicyViolation)),
- log.BBError(err))
- }
- }
- }
-
- // Check backup missing
- {
- var backupMissingAnomalyPayload *api.AnomalyDatabaseBackupMissingPayload
- // The anomaly fires if backup is enabled, however no successful backup has been taken during the period.
- if backupSetting != nil && backupSetting.Enabled {
- expectedSchedule := api.BackupPlanPolicyScheduleWeekly
- backupMaxAge := time.Duration(7*24) * time.Hour
- if backupSetting.DayOfWeek == -1 {
- expectedSchedule = api.BackupPlanPolicyScheduleDaily
- backupMaxAge = time.Duration(24) * time.Hour
- }
-
- // Ignore if backup setting has been changed after the max age.
- if backupSetting.UpdatedTs < time.Now().Add(-backupMaxAge).Unix() {
- status := api.BackupStatusDone
- backupFind := &store.FindBackupMessage{
- DatabaseUID: &database.UID,
- Status: &status,
- }
- backupList, err := s.store.ListBackupV2(ctx, backupFind)
- if err != nil {
- slog.Error("Failed to retrieve backup list",
- slog.String("instance", instance.ResourceID),
- slog.String("database", database.DatabaseName),
- log.BBError(err))
- }
-
- hasValidBackup := false
- if len(backupList) > 0 {
- if backupList[0].UpdatedTs >= time.Now().Add(-backupMaxAge).Unix() {
- hasValidBackup = true
- }
- }
-
- if !hasValidBackup {
- backupMissingAnomalyPayload = &api.AnomalyDatabaseBackupMissingPayload{
- ExpectedBackupSchedule: expectedSchedule,
- }
- if len(backupList) > 0 {
- backupMissingAnomalyPayload.LastBackupTs = backupList[0].UpdatedTs
- }
- }
- }
- }
-
- if backupMissingAnomalyPayload != nil {
- payload, err := json.Marshal(*backupMissingAnomalyPayload)
- if err != nil {
- slog.Error("Failed to marshal anomaly payload",
- slog.String("instance", instance.ResourceID),
- slog.String("database", database.DatabaseName),
- slog.String("type", string(api.AnomalyDatabaseBackupMissing)),
- log.BBError(err))
- } else {
- if _, err = s.store.UpsertActiveAnomalyV2(ctx, api.SystemBotID, &store.AnomalyMessage{
- InstanceID: instance.ResourceID,
- DatabaseUID: &database.UID,
- Type: api.AnomalyDatabaseBackupMissing,
- Payload: string(payload),
- }); err != nil {
- slog.Error("Failed to create anomaly",
- slog.String("instance", instance.ResourceID),
- slog.String("database", database.DatabaseName),
- slog.String("type", string(api.AnomalyDatabaseBackupMissing)),
- log.BBError(err))
- }
- }
- } else {
- err := s.store.ArchiveAnomalyV2(ctx, &store.ArchiveAnomalyMessage{
- DatabaseUID: &database.UID,
- Type: api.AnomalyDatabaseBackupMissing,
- })
- if err != nil && common.ErrorCode(err) != common.NotFound {
- slog.Error("Failed to close anomaly",
- slog.String("instance", instance.ResourceID),
- slog.String("database", database.DatabaseName),
- slog.String("type", string(api.AnomalyDatabaseBackupMissing)),
- log.BBError(err))
- }
- }
- }
-}
-
func equalInstanceMetadata(x, y *storepb.InstanceMetadata) bool {
return cmp.Equal(x, y, protocmp.Transform(), protocmp.IgnoreFields(&storepb.InstanceMetadata{}, "last_sync_time"))
}
@@ -802,18 +602,3 @@ func disableSchemaDriftAnomalyCheck(dbTp storepb.Engine) bool {
_, ok := m[dbTp]
return ok
}
-
-func disableBackupAnomalyCheck(dbTp storepb.Engine) bool {
- m := map[storepb.Engine]struct{}{
- storepb.Engine_MONGODB: {},
- storepb.Engine_SPANNER: {},
- storepb.Engine_REDIS: {},
- storepb.Engine_ORACLE: {},
- storepb.Engine_OCEANBASE_ORACLE: {},
- storepb.Engine_MSSQL: {},
- storepb.Engine_MARIADB: {},
- storepb.Engine_REDSHIFT: {},
- }
- _, ok := m[dbTp]
- return ok
-}
diff --git a/backend/runner/taskrun/database_backup_executor.go b/backend/runner/taskrun/database_backup_executor.go
deleted file mode 100644
index b53d8567a0..0000000000
--- a/backend/runner/taskrun/database_backup_executor.go
+++ /dev/null
@@ -1,218 +0,0 @@
-package taskrun
-
-import (
- "context"
- "encoding/json"
- "fmt"
- "log/slog"
- "os"
- "path/filepath"
- "time"
-
- "github.com/pkg/errors"
- "golang.org/x/sys/unix"
-
- "github.com/bytebase/bytebase/backend/common/log"
- "github.com/bytebase/bytebase/backend/component/config"
- "github.com/bytebase/bytebase/backend/component/dbfactory"
- "github.com/bytebase/bytebase/backend/component/state"
- api "github.com/bytebase/bytebase/backend/legacyapi"
- "github.com/bytebase/bytebase/backend/plugin/db"
- bbs3 "github.com/bytebase/bytebase/backend/plugin/storage/s3"
- "github.com/bytebase/bytebase/backend/runner/backuprun"
- "github.com/bytebase/bytebase/backend/store"
- v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
-)
-
-const (
- // Do not dump backup file when the available file system space is less than 500MB.
- minAvailableFSBytes = 500 * 1024 * 1024
-)
-
-// NewDatabaseBackupExecutor creates a new database backup task executor.
-func NewDatabaseBackupExecutor(store *store.Store, dbFactory *dbfactory.DBFactory, s3Client *bbs3.Client, stateCfg *state.State, profile config.Profile) Executor {
- return &DatabaseBackupExecutor{
- store: store,
- dbFactory: dbFactory,
- s3Client: s3Client,
- stateCfg: stateCfg,
- profile: profile,
- }
-}
-
-// DatabaseBackupExecutor is the task executor for database backup.
-type DatabaseBackupExecutor struct {
- store *store.Store
- dbFactory *dbfactory.DBFactory
- s3Client *bbs3.Client
- stateCfg *state.State
- profile config.Profile
-}
-
-// RunOnce will run database backup once.
-// TODO: support cancellation.
-func (exec *DatabaseBackupExecutor) RunOnce(ctx context.Context, _ context.Context, task *store.TaskMessage, taskRunUID int) (terminated bool, result *api.TaskRunResultPayload, err error) {
- exec.stateCfg.TaskRunExecutionStatuses.Store(taskRunUID,
- state.TaskRunExecutionStatus{
- ExecutionStatus: v1pb.TaskRun_PRE_EXECUTING,
- UpdateTime: time.Now(),
- })
-
- payload := &api.TaskDatabaseBackupPayload{}
- if err := json.Unmarshal([]byte(task.Payload), payload); err != nil {
- return true, nil, errors.Wrap(err, "invalid database backup payload")
- }
-
- database, err := exec.store.GetDatabaseV2(ctx, &store.FindDatabaseMessage{UID: task.DatabaseID})
- if err != nil {
- return true, nil, err
- }
- instance, err := exec.store.GetInstanceV2(ctx, &store.FindInstanceMessage{
- ResourceID: &database.InstanceID,
- })
- if err != nil {
- return true, nil, err
- }
- backup, err := exec.store.GetBackupByUID(ctx, payload.BackupID)
- if err != nil {
- return true, nil, errors.Wrapf(err, "failed to find backup with ID %d", payload.BackupID)
- }
- if backup == nil {
- return true, nil, errors.Errorf("backup %v not found", payload.BackupID)
- }
-
- if backup.StorageBackend == api.BackupStorageBackendLocal {
- backupFileDir := filepath.Dir(filepath.Join(exec.profile.DataDir, backup.Path))
- availableBytes, err := getAvailableFSSpace(backupFileDir)
- if err != nil {
- return true, nil, errors.Wrapf(err, "failed to get available file system space, backup file dir is %s", backupFileDir)
- }
- if availableBytes < minAvailableFSBytes {
- return true, nil, errors.Errorf("the available file system space %dMB is less than the minimal threshold %dMB", availableBytes/1024/1024, minAvailableFSBytes/1024/1024)
- }
- }
-
- exec.stateCfg.TaskRunExecutionStatuses.Store(taskRunUID,
- state.TaskRunExecutionStatus{
- ExecutionStatus: v1pb.TaskRun_EXECUTING,
- UpdateTime: time.Now(),
- })
-
- slog.Debug("Start database backup.", slog.String("instance", instance.Title), slog.String("database", database.DatabaseName), slog.String("backup", backup.Name))
- backupPayload, backupErr := exec.backupDatabase(ctx, exec.dbFactory, exec.s3Client, exec.profile, instance, database, backup)
-
- exec.stateCfg.TaskRunExecutionStatuses.Store(taskRunUID,
- state.TaskRunExecutionStatus{
- ExecutionStatus: v1pb.TaskRun_POST_EXECUTING,
- UpdateTime: time.Now(),
- })
-
- backupStatus := string(api.BackupStatusDone)
- comment := ""
- if backupErr != nil {
- backupStatus = string(api.BackupStatusFailed)
- comment = backupErr.Error()
- if err := removeLocalBackupFile(exec.profile.DataDir, backup); err != nil {
- slog.Warn(err.Error())
- }
- }
- backupPatch := store.UpdateBackupMessage{
- UID: backup.UID,
- Status: &backupStatus,
- UpdaterID: api.SystemBotID,
- Comment: &comment,
- Payload: &backupPayload,
- }
-
- if _, err := exec.store.UpdateBackupV2(ctx, &backupPatch); err != nil {
- return true, nil, errors.Wrap(err, "failed to patch backup")
- }
-
- if backupErr != nil {
- return true, nil, backupErr
- }
-
- return true, &api.TaskRunResultPayload{
- Detail: fmt.Sprintf("Backup database %q", database.DatabaseName),
- }, nil
-}
-
-func removeLocalBackupFile(dataDir string, backup *store.BackupMessage) error {
- if backup.StorageBackend != api.BackupStorageBackendLocal {
- return nil
- }
- backupFilePath := backuprun.GetBackupAbsFilePath(dataDir, backup.DatabaseUID, backup.Name)
- if err := os.Remove(backupFilePath); err != nil {
- return errors.Wrapf(err, "failed to delete the local backup file %s", backupFilePath)
- }
- return nil
-}
-
-// getAvailableFSSpace gets the free space of the mounted filesystem.
-// path is the pathname of any file within the mounted filesystem.
-// It calls syscall statfs under the hood.
-// Returns available space in bytes.
-func getAvailableFSSpace(path string) (uint64, error) {
- var stat unix.Statfs_t
- if err := unix.Statfs(path, &stat); err != nil {
- return 0, errors.Wrap(err, "failed to call syscall statfs")
- }
- // Ref: https://man7.org/linux/man-pages/man2/statfs.2.html
- // Bavail: Free blocks available to unprivileged user.
- // Bsize: Optimal transfer block size.
- return stat.Bavail * uint64(stat.Bsize), nil
-}
-
-func dumpBackupFile(ctx context.Context, driver db.Driver, backupFilePath string) (string, error) {
- backupFile, err := os.Create(backupFilePath)
- if err != nil {
- return "", errors.Errorf("failed to open backup path %q", backupFilePath)
- }
- defer backupFile.Close()
- payload, err := driver.Dump(ctx, backupFile, false /* schemaOnly */)
- if err != nil {
- return "", errors.Wrapf(err, "failed to dump database to local backup file %q", backupFilePath)
- }
- return payload, nil
-}
-
-// backupDatabase will take a backup of a database.
-func (*DatabaseBackupExecutor) backupDatabase(ctx context.Context, dbFactory *dbfactory.DBFactory, s3Client *bbs3.Client, profile config.Profile, instance *store.InstanceMessage, database *store.DatabaseMessage, backup *store.BackupMessage) (string, error) {
- driver, err := dbFactory.GetAdminDatabaseDriver(ctx, instance, database, db.ConnectionContext{})
- if err != nil {
- return "", err
- }
- defer driver.Close(ctx)
-
- backupFilePathLocal := filepath.Join(profile.DataDir, backup.Path)
- payload, err := dumpBackupFile(ctx, driver, backupFilePathLocal)
- if err != nil {
- return "", errors.Wrapf(err, "failed to dump backup file %q", backupFilePathLocal)
- }
-
- switch backup.StorageBackend {
- case api.BackupStorageBackendLocal:
- return payload, nil
- case api.BackupStorageBackendS3:
- slog.Debug("Uploading backup to s3 bucket.", slog.String("bucket", s3Client.GetBucket()), slog.String("path", backupFilePathLocal))
- bucketFileToUpload, err := os.Open(backupFilePathLocal)
- if err != nil {
- return "", errors.Wrapf(err, "failed to open backup file %q for uploading to s3 bucket", backupFilePathLocal)
- }
- defer bucketFileToUpload.Close()
-
- if _, err := s3Client.UploadObject(ctx, backup.Path, bucketFileToUpload); err != nil {
- return "", errors.Wrapf(err, "failed to upload backup to AWS S3")
- }
- slog.Debug("Successfully uploaded backup to s3 bucket.")
-
- if err := os.Remove(backupFilePathLocal); err != nil {
- slog.Warn("Failed to remove the local backup file after uploading to s3 bucket.", slog.String("path", backupFilePathLocal), log.BBError(err))
- } else {
- slog.Debug("Successfully removed the local backup file after uploading to s3 bucket.", slog.String("path", backupFilePathLocal))
- }
- return payload, nil
- default:
- return "", errors.Errorf("backup to %s not implemented yet", backup.StorageBackend)
- }
-}
diff --git a/backend/runner/taskrun/pitr_cutover_executor.go b/backend/runner/taskrun/pitr_cutover_executor.go
deleted file mode 100644
index 4bf898cbe8..0000000000
--- a/backend/runner/taskrun/pitr_cutover_executor.go
+++ /dev/null
@@ -1,295 +0,0 @@
-package taskrun
-
-import (
- "context"
- "database/sql"
- "fmt"
- "log/slog"
- "time"
-
- "github.com/gosimple/slug"
- "github.com/pkg/errors"
-
- "github.com/bytebase/bytebase/backend/common"
- "github.com/bytebase/bytebase/backend/common/log"
- "github.com/bytebase/bytebase/backend/component/activity"
- "github.com/bytebase/bytebase/backend/component/config"
- "github.com/bytebase/bytebase/backend/component/dbfactory"
- "github.com/bytebase/bytebase/backend/component/state"
- api "github.com/bytebase/bytebase/backend/legacyapi"
- "github.com/bytebase/bytebase/backend/plugin/db"
- "github.com/bytebase/bytebase/backend/plugin/db/mysql"
- "github.com/bytebase/bytebase/backend/plugin/db/util"
- "github.com/bytebase/bytebase/backend/runner/backuprun"
- "github.com/bytebase/bytebase/backend/runner/schemasync"
- "github.com/bytebase/bytebase/backend/store"
- "github.com/bytebase/bytebase/backend/utils"
- storepb "github.com/bytebase/bytebase/proto/generated-go/store"
- v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
-)
-
-// NewPITRCutoverExecutor creates a PITR cutover task executor.
-func NewPITRCutoverExecutor(store *store.Store, dbFactory *dbfactory.DBFactory, schemaSyncer *schemasync.Syncer, stateCfg *state.State, backupRunner *backuprun.Runner, activityManager *activity.Manager, profile config.Profile) Executor {
- return &PITRCutoverExecutor{
- store: store,
- dbFactory: dbFactory,
- schemaSyncer: schemaSyncer,
- stateCfg: stateCfg,
- backupRunner: backupRunner,
- activityManager: activityManager,
- profile: profile,
- }
-}
-
-// PITRCutoverExecutor is the PITR cutover task executor.
-type PITRCutoverExecutor struct {
- store *store.Store
- dbFactory *dbfactory.DBFactory
- schemaSyncer *schemasync.Syncer
- stateCfg *state.State
- backupRunner *backuprun.Runner
- activityManager *activity.Manager
- profile config.Profile
-}
-
-// RunOnce will run the PITR cutover task executor once.
-// TODO: support cancellation.
-func (exec *PITRCutoverExecutor) RunOnce(ctx context.Context, _ context.Context, task *store.TaskMessage, taskRunUID int) (terminated bool, result *api.TaskRunResultPayload, err error) {
- exec.stateCfg.TaskRunExecutionStatuses.Store(taskRunUID,
- state.TaskRunExecutionStatus{
- ExecutionStatus: v1pb.TaskRun_EXECUTING,
- UpdateTime: time.Now(),
- })
-
- slog.Info("Run PITR cutover task", slog.String("task", task.Name))
- issue, err := exec.store.GetIssueV2(ctx, &store.FindIssueMessage{PipelineID: &task.PipelineID})
- if err != nil {
- slog.Error("failed to fetch containing issue doing pitr cutover task", log.BBError(err))
- return true, nil, err
- }
- if issue == nil {
- return true, nil, errors.Errorf("issue not found for pipeline %v", task.PipelineID)
- }
- database, err := exec.store.GetDatabaseV2(ctx, &store.FindDatabaseMessage{UID: task.DatabaseID})
- if err != nil {
- return true, nil, err
- }
- // Currently api.TaskDatabasePITRCutoverPayload is empty, so we do not need to unmarshal from task.Payload.
- terminated, result, err = exec.pitrCutover(ctx, exec.dbFactory, exec.backupRunner, exec.schemaSyncer, exec.profile, task, taskRunUID, database, issue)
- if err != nil {
- return terminated, result, err
- }
- return terminated, result, nil
-}
-
-// pitrCutover performs the PITR cutover algorithm:
-// 1. Swap the current and PITR database.
-// 2. Create a backup with type PITR. The backup is scheduled asynchronously.
-// We must check the possible failed/ongoing PITR type backup in the recovery process.
-func (exec *PITRCutoverExecutor) pitrCutover(ctx context.Context, dbFactory *dbfactory.DBFactory, backupRunner *backuprun.Runner, schemaSyncer *schemasync.Syncer, profile config.Profile, task *store.TaskMessage, taskRunUID int, database *store.DatabaseMessage, issue *store.IssueMessage) (terminated bool, result *api.TaskRunResultPayload, err error) {
- instance, err := exec.store.GetInstanceV2(ctx, &store.FindInstanceMessage{UID: &task.InstanceID})
- if err != nil {
- return true, nil, err
- }
- environment, err := exec.store.GetEnvironmentV2(ctx, &store.FindEnvironmentMessage{ResourceID: &database.EffectiveEnvironmentID})
- if err != nil {
- return true, nil, err
- }
- project, err := exec.store.GetProjectV2(ctx, &store.FindProjectMessage{ResourceID: &database.ProjectID})
- if err != nil {
- return true, nil, err
- }
- creator, err := exec.store.GetUserByID(ctx, task.CreatorID)
- if err != nil {
- return true, nil, err
- }
-
- if err := exec.doCutover(ctx, instance, issue, database.DatabaseName); err != nil {
- return true, nil, err
- }
-
- // RestorePITR will create the pitr database.
- // Since it's ephemeral and will be renamed to the original database soon, we will reuse the original
- // database's migration history, and append a new BRANCH migration.
- slog.Debug("Appending new migration history record")
- m := &db.MigrationInfo{
- InstanceID: &task.InstanceID,
- IssueUID: &issue.UID,
- ReleaseVersion: profile.Version,
- Version: common.DefaultMigrationVersion(),
- Namespace: database.DatabaseName,
- Database: database.DatabaseName,
- DatabaseID: &database.UID,
- Environment: environment.ResourceID,
- Source: db.MigrationSource(project.Workflow),
- Type: db.Branch,
- Status: db.Done,
- Description: fmt.Sprintf("PITR: restoring database %s", database.DatabaseName),
- Creator: creator.Name,
- CreatorID: creator.ID,
- }
-
- driver, err := dbFactory.GetAdminDatabaseDriver(ctx, instance, database, db.ConnectionContext{})
- if err != nil {
- return true, nil, err
- }
- defer driver.Close(ctx)
-
- if _, _, err := utils.ExecuteMigrationDefault(ctx, ctx, exec.store, exec.stateCfg, taskRunUID, driver, m, "" /* pitr cutover */, nil, db.ExecuteOptions{}); err != nil {
- slog.Error("Failed to add migration history record", log.BBError(err))
- return true, nil, errors.Wrap(err, "failed to add migration history record")
- }
-
- // TODO(dragonly): Only needed for in-place PITR.
- backupName := fmt.Sprintf("%s-%s-pitr-%d", slug.Make(project.Title), slug.Make(environment.Title), issue.CreatedTime.Unix())
- if _, err := backupRunner.ScheduleBackupTask(ctx, database, backupName, api.BackupTypePITR, api.SystemBotID); err != nil {
- return true, nil, errors.Wrapf(err, "failed to schedule backup task for database %q after PITR", database.DatabaseName)
- }
-
- // Sync database schema after restore is completed.
- if err := schemaSyncer.SyncDatabaseSchema(ctx, database, true /* force */); err != nil {
- slog.Error("failed to sync database schema",
- slog.String("instanceName", instance.ResourceID),
- slog.String("databaseName", database.DatabaseName),
- log.BBError(err),
- )
- }
-
- return true, &api.TaskRunResultPayload{
- Detail: fmt.Sprintf("Swapped PITR database for target database %q", database.DatabaseName),
- }, nil
-}
-
-func (exec *PITRCutoverExecutor) doCutover(ctx context.Context, instance *store.InstanceMessage, issue *store.IssueMessage, databaseName string) error {
- switch instance.Engine {
- case storepb.Engine_POSTGRES:
- // Retry so that if there are clients reconnecting to the related databases, we can potentially kill the connections and do the cutover successfully.
- ticker := time.NewTicker(100 * time.Millisecond)
- defer ticker.Stop()
- maxRetry := 3
- retry := 0
- for {
- select {
- case <-ticker.C:
- retry++
- if err := exec.pitrCutoverPostgres(ctx, instance, issue, databaseName); err != nil {
- if retry == maxRetry {
- return errors.Wrapf(err, "failed to do cutover for PostgreSQL after retried for %d times", maxRetry)
- }
- slog.Debug("Failed to do cutover for PostgreSQL. Retry later.", log.BBError(err))
- } else {
- return nil
- }
- case <-ctx.Done():
- return errors.Errorf("context is canceled when doing cutover for PostgreSQL")
- }
- }
- case storepb.Engine_MYSQL, storepb.Engine_MARIADB:
- if err := exec.pitrCutoverMySQL(ctx, instance, issue, databaseName); err != nil {
- return errors.Wrap(err, "failed to do cutover for MySQL")
- }
- return nil
- default:
- return errors.Errorf("invalid database type %q for cutover task", instance.Engine)
- }
-}
-
-func (exec *PITRCutoverExecutor) pitrCutoverMySQL(ctx context.Context, instance *store.InstanceMessage, issue *store.IssueMessage, databaseName string) error {
- driver, err := exec.dbFactory.GetAdminDatabaseDriver(ctx, instance, nil /* database */, db.ConnectionContext{})
- if err != nil {
- return err
- }
- defer driver.Close(ctx)
- driverDB := driver.GetDB()
- conn, err := driverDB.Conn(ctx)
- if err != nil {
- return err
- }
- defer conn.Close()
- slog.Debug("Swapping the original and PITR database", slog.String("originalDatabase", databaseName))
- pitrDatabaseName, pitrOldDatabaseName, err := mysql.SwapPITRDatabase(ctx, conn, databaseName, issue.CreatedTime.Unix())
- if err != nil {
- slog.Error("Failed to swap the original and PITR database", slog.String("originalDatabase", databaseName), slog.String("pitrDatabase", pitrDatabaseName), log.BBError(err))
- return errors.Wrap(err, "failed to swap the original and PITR database")
- }
- slog.Debug("Finished swapping the original and PITR database", slog.String("originalDatabase", databaseName), slog.String("pitrDatabase", pitrDatabaseName), slog.String("oldDatabase", pitrOldDatabaseName))
- return nil
-}
-
-func (exec *PITRCutoverExecutor) pitrCutoverPostgres(ctx context.Context, instance *store.InstanceMessage, issue *store.IssueMessage, databaseName string) error {
- pitrDatabaseName := util.GetPITRDatabaseName(databaseName, issue.CreatedTime.Unix())
- pitrOldDatabaseName := util.GetPITROldDatabaseName(databaseName, issue.CreatedTime.Unix())
-
- defaultDBDriver, err := exec.dbFactory.GetAdminDatabaseDriver(ctx, instance, nil /* database */, db.ConnectionContext{})
- if err != nil {
- return err
- }
- db := defaultDBDriver.GetDB()
-
- // The original database may not exist.
- // This is possible if there's a former task execution which successfully renamed original -> _del database and failed.
- // Now we have the _del and the _pitr database.
- existOriginal, err := pgDatabaseExist(ctx, db, databaseName)
- if err != nil {
- return errors.Wrapf(err, "failed to check existence of database %q", databaseName)
- }
- if existOriginal {
- // Kill connections to the original database in the beginning of cutover.
- if err := pgKillConnectionsToDatabase(ctx, db, databaseName); err != nil {
- return err
- }
- if _, err := db.ExecContext(ctx, fmt.Sprintf("ALTER DATABASE %s RENAME TO %s;", databaseName, pitrOldDatabaseName)); err != nil {
- return errors.Wrapf(err, "failed to rename database %q to %q", databaseName, pitrOldDatabaseName)
- }
- slog.Debug("Successfully renamed database", slog.String("from", databaseName), slog.String("to", pitrOldDatabaseName))
- }
-
- // The _pitr database may not exist.
- // This is possible if there's a former task execution which successfully renamed _pitr -> original database and failed.
- // Now we have the _del and the original database.
- existPITR, err := pgDatabaseExist(ctx, db, pitrDatabaseName)
- if err != nil {
- return errors.Wrapf(err, "failed to check existence of database %q", pitrDatabaseName)
- }
- if existPITR {
- // Kill connections to the original database again in case that the clients reconnect to the original database.
- if err := pgKillConnectionsToDatabase(ctx, db, databaseName); err != nil {
- return err
- }
- // Kill connection to the _pitr database in case there's someone connecting to all of the existing databases like postgres-exporter.
- if err := pgKillConnectionsToDatabase(ctx, db, pitrDatabaseName); err != nil {
- return err
- }
- if _, err := db.ExecContext(ctx, fmt.Sprintf("ALTER DATABASE %s RENAME TO %s;", pitrDatabaseName, databaseName)); err != nil {
- return errors.Wrapf(err, "failed to rename database %q to %q", pitrDatabaseName, databaseName)
- }
- slog.Debug("Successfully renamed database", slog.String("from", pitrDatabaseName), slog.String("to", databaseName))
- }
-
- return nil
-}
-
-func pgKillConnectionsToDatabase(ctx context.Context, db *sql.DB, database string) error {
- stmt := `
- SELECT pg_terminate_backend( pid )
- FROM pg_stat_activity
- WHERE pid <> pg_backend_pid( )
- AND datname = $1;
-`
- if _, err := db.ExecContext(ctx, stmt, database); err != nil {
- return errors.Wrapf(err, "failed to kill all connections to database %q", database)
- }
- return nil
-}
-
-func pgDatabaseExist(ctx context.Context, db *sql.DB, database string) (bool, error) {
- query := fmt.Sprintf("SELECT datname FROM pg_database WHERE datname='%s';", database)
- var unused string
- if err := db.QueryRowContext(ctx, query).Scan(&unused); err != nil {
- if err == sql.ErrNoRows {
- return false, nil
- }
- return false, util.FormatErrorWithQuery(err, query)
- }
- return true, nil
-}
diff --git a/backend/runner/taskrun/pitr_restore_executor.go b/backend/runner/taskrun/pitr_restore_executor.go
deleted file mode 100644
index 6f4fd62e70..0000000000
--- a/backend/runner/taskrun/pitr_restore_executor.go
+++ /dev/null
@@ -1,578 +0,0 @@
-package taskrun
-
-import (
- "context"
- "encoding/json"
- "fmt"
- "log/slog"
- "os"
- "path"
- "path/filepath"
- "time"
-
- "github.com/pkg/errors"
-
- "github.com/bytebase/bytebase/backend/common"
- "github.com/bytebase/bytebase/backend/common/log"
- "github.com/bytebase/bytebase/backend/component/config"
- "github.com/bytebase/bytebase/backend/component/dbfactory"
- "github.com/bytebase/bytebase/backend/component/state"
- api "github.com/bytebase/bytebase/backend/legacyapi"
- "github.com/bytebase/bytebase/backend/plugin/db"
- "github.com/bytebase/bytebase/backend/plugin/db/mysql"
- "github.com/bytebase/bytebase/backend/plugin/db/pg"
- "github.com/bytebase/bytebase/backend/plugin/db/util"
- bbs3 "github.com/bytebase/bytebase/backend/plugin/storage/s3"
- "github.com/bytebase/bytebase/backend/runner/backuprun"
- "github.com/bytebase/bytebase/backend/runner/schemasync"
- "github.com/bytebase/bytebase/backend/store"
- "github.com/bytebase/bytebase/backend/store/model"
- "github.com/bytebase/bytebase/backend/utils"
- storepb "github.com/bytebase/bytebase/proto/generated-go/store"
- v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
-)
-
-// NewPITRRestoreExecutor creates a PITR restore task executor.
-func NewPITRRestoreExecutor(store *store.Store, dbFactory *dbfactory.DBFactory, s3Client *bbs3.Client, schemaSyncer *schemasync.Syncer, stateCfg *state.State, profile config.Profile) Executor {
- return &PITRRestoreExecutor{
- store: store,
- dbFactory: dbFactory,
- s3Client: s3Client,
- schemaSyncer: schemaSyncer,
- stateCfg: stateCfg,
- profile: profile,
- }
-}
-
-// PITRRestoreExecutor is the PITR restore task executor.
-type PITRRestoreExecutor struct {
- store *store.Store
- dbFactory *dbfactory.DBFactory
- s3Client *bbs3.Client
- schemaSyncer *schemasync.Syncer
- stateCfg *state.State
- profile config.Profile
-}
-
-// RunOnce will run the PITR restore task executor once.
-// TODO: support cancellation.
-func (exec *PITRRestoreExecutor) RunOnce(ctx context.Context, _ context.Context, task *store.TaskMessage, taskRunUID int) (terminated bool, result *api.TaskRunResultPayload, err error) {
- exec.stateCfg.TaskRunExecutionStatuses.Store(taskRunUID,
- state.TaskRunExecutionStatus{
- ExecutionStatus: v1pb.TaskRun_EXECUTING,
- UpdateTime: time.Now(),
- })
-
- slog.Info("Run PITR restore task", slog.String("task", task.Name))
-
- payload := api.TaskDatabasePITRRestorePayload{}
- if err := json.Unmarshal([]byte(task.Payload), &payload); err != nil {
- return true, nil, errors.Wrapf(err, "invalid PITR restore payload: %s", task.Payload)
- }
-
- if (payload.BackupID == nil) == (payload.PointInTimeTs == nil) {
- return true, nil, errors.Errorf("only one of BackupID and time point can be set")
- }
-
- if !((payload.DatabaseName == nil) == (payload.TargetInstanceID == nil)) {
- return true, nil, errors.Errorf("DatabaseName and TargetInstanceID must be both set or unset")
- }
-
- // There are 2 * 2 = 4 kinds of task by combination of the following cases:
- // 1. in-place or restore to new database: the latter does not create database with _pitr/_del suffix
- // 2. backup restore or Point-in-Time restore: the former does not apply binlog/wal
-
- if payload.BackupID != nil {
- // Restore Backup
- resultPayload, err := exec.doBackupRestore(ctx, exec.store, exec.dbFactory, exec.s3Client, exec.schemaSyncer, exec.profile, task, taskRunUID, payload)
- return true, resultPayload, err
- }
-
- resultPayload, err := exec.doPITRRestore(ctx, exec.dbFactory, exec.s3Client, exec.profile, task, payload)
- return true, resultPayload, err
-}
-
-func (exec *PITRRestoreExecutor) doBackupRestore(ctx context.Context, stores *store.Store, dbFactory *dbfactory.DBFactory, s3Client *bbs3.Client, schemaSyncer *schemasync.Syncer, profile config.Profile, task *store.TaskMessage, taskRunUID int, payload api.TaskDatabasePITRRestorePayload) (*api.TaskRunResultPayload, error) {
- instance, err := stores.GetInstanceV2(ctx, &store.FindInstanceMessage{UID: &task.InstanceID})
- if err != nil {
- return nil, errors.Wrap(err, "failed to find database for the backup")
- }
- backup, err := stores.GetBackupByUID(ctx, *payload.BackupID)
- if err != nil {
- return nil, errors.Wrapf(err, "failed to find backup with ID %d", *payload.BackupID)
- }
- if backup == nil {
- return nil, errors.Errorf("backup with ID %d not found", *payload.BackupID)
- }
-
- // TODO(dragonly): We should let users restore the backup even if the source database is gone.
- sourceDatabase, err := stores.GetDatabaseV2(ctx, &store.FindDatabaseMessage{UID: &backup.DatabaseUID})
- if err != nil {
- return nil, errors.Wrap(err, "failed to find database for the backup")
- }
- if sourceDatabase == nil {
- return nil, errors.Errorf("source database ID not found %v", backup.DatabaseUID)
- }
-
- if payload.TargetInstanceID == nil {
- // Backup restore in place
- if instance.Engine == storepb.Engine_POSTGRES {
- issue, err := stores.GetIssueV2(ctx, &store.FindIssueMessage{PipelineID: &task.PipelineID})
- if err != nil {
- return nil, err
- }
- return exec.doRestoreInPlacePostgres(ctx, stores, dbFactory, profile, issue, task, payload)
- }
- return nil, errors.Errorf("we only support backup restore replace for PostgreSQL now")
- }
-
- targetInstance, err := exec.store.GetInstanceV2(ctx, &store.FindInstanceMessage{UID: payload.TargetInstanceID})
- if err != nil {
- return nil, err
- }
- targetDatabase, err := exec.store.GetDatabaseV2(ctx, &store.FindDatabaseMessage{
- InstanceID: &targetInstance.ResourceID,
- DatabaseName: payload.DatabaseName,
- IgnoreCaseSensitive: store.IgnoreDatabaseAndTableCaseSensitive(targetInstance),
- })
- if err != nil {
- return nil, errors.Wrapf(err, "failed to find target database %q in instance %q", *payload.DatabaseName, instance.Title)
- }
- if targetDatabase == nil {
- return nil, errors.Wrapf(err, "target database %q not found in instance %q", *payload.DatabaseName, instance.Title)
- }
- slog.Debug("Start database restore from backup...",
- slog.String("source_instance", sourceDatabase.InstanceID),
- slog.String("source_database", sourceDatabase.DatabaseName),
- slog.String("target_instance", targetInstance.ResourceID),
- slog.String("target_database", targetDatabase.DatabaseName),
- slog.String("backup", backup.Name),
- )
-
- // Restore the database to the target database.
- if err := exec.restoreDatabase(ctx, dbFactory, s3Client, profile, targetInstance, targetDatabase, backup); err != nil {
- return nil, err
- }
- // TODO(zp): This should be done in the same transaction as restoreDatabase to guarantee consistency.
- // For now, we do this after restoreDatabase, since this one is unlikely to fail.
- migrationID, version, err := createBranchMigrationHistory(ctx, stores, dbFactory, exec.stateCfg, profile, targetInstance, sourceDatabase, targetDatabase, backup, task, taskRunUID)
- if err != nil {
- return nil, err
- }
-
- // Patch the backup id after we successfully restore the database using the backup.
- // restoringDatabase is changing the customer database instance, while here we are changing our own meta db,
- // and since we can't guarantee cross database transaction consistency, there is always a chance to have
- // inconsistent data. We choose to do Patch afterwards since this one is unlikely to fail.
- if _, err := stores.UpdateDatabase(ctx, &store.UpdateDatabaseMessage{
- InstanceID: targetDatabase.InstanceID,
- DatabaseName: targetDatabase.DatabaseName,
- SourceBackupID: &backup.UID,
- }, api.SystemBotID); err != nil {
- return nil, errors.Wrapf(err, "failed to update database %d backup source ID %d after restore", targetDatabase.UID, backup.UID)
- }
-
- // Sync database schema after restore is completed.
- if err := schemaSyncer.SyncDatabaseSchema(ctx, targetDatabase, true /* force */); err != nil {
- slog.Error("failed to sync database schema",
- slog.String("instanceName", targetDatabase.InstanceID),
- slog.String("databaseName", targetDatabase.DatabaseName),
- log.BBError(err),
- )
- }
-
- storedVersion, err := version.Marshal()
- if err != nil {
- slog.Error("failed to convert database schema version",
- slog.String("version", version.Version),
- log.BBError(err),
- )
- }
- return &api.TaskRunResultPayload{
- Detail: fmt.Sprintf("Restored database %q from backup %q", targetDatabase.DatabaseName, backup.Name),
- MigrationID: migrationID,
- ChangeHistory: fmt.Sprintf("instances/%s/databases/%s/changeHistories/%s", instance.ResourceID, targetDatabase.DatabaseName, migrationID),
- Version: storedVersion,
- }, nil
-}
-
-func (exec *PITRRestoreExecutor) doPITRRestore(ctx context.Context, dbFactory *dbfactory.DBFactory, s3Client *bbs3.Client, profile config.Profile, task *store.TaskMessage, payload api.TaskDatabasePITRRestorePayload) (*api.TaskRunResultPayload, error) {
- instance, err := exec.store.GetInstanceV2(ctx, &store.FindInstanceMessage{UID: &task.InstanceID})
- if err != nil {
- return nil, err
- }
- database, err := exec.store.GetDatabaseV2(ctx, &store.FindDatabaseMessage{UID: task.DatabaseID})
- if err != nil {
- return nil, err
- }
-
- sourceDriver, err := dbFactory.GetAdminDatabaseDriver(ctx, instance, nil /* database */, db.ConnectionContext{})
- if err != nil {
- return nil, err
- }
- defer sourceDriver.Close(ctx)
-
- targetDriver := sourceDriver
- if payload.TargetInstanceID != nil {
- targetInstance, err := exec.store.GetInstanceV2(ctx, &store.FindInstanceMessage{UID: payload.TargetInstanceID})
- if err != nil {
- return nil, err
- }
- if targetDriver, err = dbFactory.GetAdminDatabaseDriver(ctx, targetInstance, nil /* database */, db.ConnectionContext{}); err != nil {
- return nil, err
- }
- }
- // DB.Close is idempotent, so we can feel free to assign sourceDriver to targetDriver first.
- defer targetDriver.Close(ctx)
-
- issue, err := exec.store.GetIssueV2(ctx, &store.FindIssueMessage{PipelineID: &task.PipelineID})
- if err != nil {
- return nil, err
- }
- if issue == nil {
- return nil, errors.Errorf("issue not found for pipeline %v", task.PipelineID)
- }
-
- backupStatus := api.BackupStatusDone
- backupList, err := exec.store.ListBackupV2(ctx, &store.FindBackupMessage{DatabaseUID: task.DatabaseID, Status: &backupStatus})
- if err != nil {
- return nil, err
- }
- slog.Debug("Found backup list", "backups", store.SLogBackupArray(backupList))
-
- mysqlSourceDriver, sourceOk := sourceDriver.(*mysql.Driver)
- mysqlTargetDriver, targetOk := targetDriver.(*mysql.Driver)
- if (!sourceOk) || (!targetOk) {
- slog.Error("Failed to cast driver to mysql.Driver")
- return nil, errors.Errorf("[internal] cast driver to mysql.Driver failed")
- }
-
- slog.Debug("Downloading all binlog files")
- if err := mysqlSourceDriver.FetchAllBinlogFiles(ctx, true /* downloadLatestBinlogFile */, s3Client); err != nil {
- return nil, err
- }
-
- targetTs := *payload.PointInTimeTs
- slog.Debug("Getting latest backup before or equal to targetTs", slog.Int64("targetTs", targetTs))
- backup, targetBinlogInfo, err := mysqlSourceDriver.GetLatestBackupBeforeOrEqualTs(ctx, backupList, targetTs, s3Client)
- if err != nil {
- targetTsHuman := time.Unix(targetTs, 0).Format(time.RFC822)
- slog.Error("Failed to get backup before or equal to time",
- slog.Int64("targetTs", targetTs),
- slog.String("targetTsHuman", targetTsHuman),
- log.BBError(err))
- return nil, errors.Wrapf(err, "failed to get latest backup before or equal to %s", targetTsHuman)
- }
- startBinlogInfo := backup.Payload.BinlogInfo
- binlogDir := common.GetBinlogAbsDir(profile.DataDir, instance.UID)
- slog.Debug("Got latest backup before or equal to targetTs", slog.String("backup", backup.Name))
-
- backupAbsPathLocal := backuprun.GetBackupAbsFilePath(profile.DataDir, backup.DatabaseUID, backup.Name)
- if backup.StorageBackend == api.BackupStorageBackendS3 {
- if err := downloadBackupFileFromCloud(ctx, s3Client, backup.Path, backupAbsPathLocal); err != nil {
- return nil, errors.Wrapf(err, "failed to download backup %q from S3", backup.Path)
- }
- defer os.Remove(backupAbsPathLocal)
- replayBinlogPathList, err := downloadBinlogFilesFromCloud(ctx, s3Client, startBinlogInfo, *targetBinlogInfo, binlogDir)
- if err != nil {
- return nil, errors.Wrapf(err, "failed to download binlog files from %s to %s from S3", startBinlogInfo.FileName, targetBinlogInfo.FileName)
- }
- defer func() {
- for _, binlogPath := range replayBinlogPathList {
- if err := os.Remove(binlogPath); err != nil {
- slog.Warn("Failed to remove downloaded local binlog file after PITR", slog.String("path", binlogPath))
- }
- }
- }()
- }
-
- backupFile, err := os.Open(backupAbsPathLocal)
- if err != nil {
- return nil, errors.Wrapf(err, "failed to open backup file %q", backupAbsPathLocal)
- }
- defer backupFile.Close()
- slog.Debug("Successfully opened backup file", slog.String("filename", backupAbsPathLocal))
-
- slog.Debug("Start creating and restoring PITR database",
- slog.String("instance", instance.ResourceID),
- slog.String("database", database.DatabaseName),
- )
-
- if err := exec.updateProgress(ctx, mysqlTargetDriver, task.ID, backupFile, startBinlogInfo, *targetBinlogInfo, binlogDir); err != nil {
- return nil, errors.Wrap(err, "failed to setup progress update process")
- }
-
- if payload.DatabaseName != nil {
- // case 1: PITR to a new database.
- if err := mysqlTargetDriver.RestoreBackupToDatabase(ctx, backupFile, *payload.DatabaseName); err != nil {
- slog.Error("failed to restore full backup in the new database",
- slog.Int("issueID", issue.UID),
- slog.String("databaseName", *payload.DatabaseName),
- log.BBError(err))
- return nil, errors.Wrap(err, "failed to restore full backup in the new database")
- }
- if err := mysqlTargetDriver.ReplayBinlogToDatabase(ctx, database.DatabaseName, *payload.DatabaseName, startBinlogInfo, *targetBinlogInfo, targetTs, mysqlSourceDriver.GetBinlogDir()); err != nil {
- slog.Error("failed to perform a PITR restore in the new database",
- slog.Int("issueID", issue.UID),
- slog.String("databaseName", *payload.DatabaseName),
- log.BBError(err))
- return nil, errors.Wrap(err, "failed to perform a PITR restore in the new database")
- }
- } else {
- // case 2: in-place PITR.
- if err := mysqlTargetDriver.RestoreBackupToPITRDatabase(ctx, backupFile, database.DatabaseName, issue.CreatedTime.Unix()); err != nil {
- slog.Error("failed to restore full backup in the PITR database",
- slog.Int("issueID", issue.UID),
- slog.String("databaseName", database.DatabaseName),
- log.BBError(err))
- return nil, errors.Wrap(err, "failed to perform a backup restore in the PITR database")
- }
- if err := mysqlTargetDriver.ReplayBinlogToPITRDatabase(ctx, database.DatabaseName, startBinlogInfo, *targetBinlogInfo, issue.CreatedTime.Unix(), targetTs); err != nil {
- slog.Error("failed to perform a PITR restore in the PITR database",
- slog.Int("issueID", issue.UID),
- slog.String("databaseName", database.DatabaseName),
- log.BBError(err))
- return nil, errors.Wrap(err, "failed to replay binlog in the PITR database")
- }
- }
-
- targetDatabaseName := database.DatabaseName
- if payload.DatabaseName != nil {
- targetDatabaseName = *payload.DatabaseName
- }
- slog.Info("PITR restore success", slog.String("target database", targetDatabaseName))
- return &api.TaskRunResultPayload{
- Detail: fmt.Sprintf("PITR restore success for target database %q", targetDatabaseName),
- }, nil
-}
-
-func downloadBinlogFilesFromCloud(ctx context.Context, client *bbs3.Client, startBinlogInfo, targetBinlogInfo api.BinlogInfo, binlogDir string) ([]string, error) {
- replayBinlogPathList, err := mysql.GetBinlogReplayList(startBinlogInfo, targetBinlogInfo, binlogDir)
- if err != nil {
- return nil, errors.Wrapf(err, "failed to get binlog replay list in directory %s", binlogDir)
- }
- for _, binlogFilePath := range replayBinlogPathList {
- // Use path.Join to compose a path on cloud which always uses / as the separator.
- filePathOnCloud := path.Join(common.GetBinlogRelativeDir(binlogDir), filepath.Base(binlogFilePath))
- if err := client.DownloadFileFromCloud(ctx, binlogFilePath, filePathOnCloud); err != nil {
- return nil, errors.Wrapf(err, "failed to download binlog file %s from the cloud storage", binlogFilePath)
- }
- }
- return replayBinlogPathList, nil
-}
-
-func (*PITRRestoreExecutor) doRestoreInPlacePostgres(ctx context.Context, stores *store.Store, dbFactory *dbfactory.DBFactory, profile config.Profile, issue *store.IssueMessage, task *store.TaskMessage, payload api.TaskDatabasePITRRestorePayload) (*api.TaskRunResultPayload, error) {
- if payload.BackupID == nil {
- return nil, errors.Errorf("PITR for Postgres is not implemented")
- }
-
- backup, err := stores.GetBackupByUID(ctx, *payload.BackupID)
- if err != nil {
- return nil, errors.Wrapf(err, "failed to find backup with ID %d", *payload.BackupID)
- }
- if backup == nil {
- return nil, errors.Errorf("backup with ID %d not found", *payload.BackupID)
- }
- backupFileName := backuprun.GetBackupAbsFilePath(profile.DataDir, backup.DatabaseUID, backup.Name)
- backupFile, err := os.Open(backupFileName)
- if err != nil {
- return nil, errors.Wrapf(err, "failed to open backup file %q", backupFileName)
- }
- defer backupFile.Close()
-
- instance, err := stores.GetInstanceV2(ctx, &store.FindInstanceMessage{UID: &task.InstanceID})
- if err != nil {
- return nil, err
- }
- database, err := stores.GetDatabaseV2(ctx, &store.FindDatabaseMessage{UID: task.DatabaseID})
- if err != nil {
- return nil, err
- }
- driver, err := dbFactory.GetAdminDatabaseDriver(ctx, instance, database, db.ConnectionContext{})
- if err != nil {
- return nil, err
- }
- defer driver.Close(ctx)
-
- pgDriver, ok := driver.(*pg.Driver)
- if !ok {
- slog.Error("Failed to cast driver to pg.Driver")
- return nil, errors.Errorf("[internal] cast driver to pg.Driver failed")
- }
- originalOwner, err := pgDriver.GetCurrentDatabaseOwner(ctx)
- if err != nil {
- return nil, errors.Wrapf(err, "failed to get the OWNER of database %q", database.DatabaseName)
- }
-
- defaultDBDriver, err := dbFactory.GetAdminDatabaseDriver(ctx, instance, nil /* database */, db.ConnectionContext{})
- if err != nil {
- return nil, err
- }
- defer defaultDBDriver.Close(ctx)
- dbConn := defaultDBDriver.GetDB()
- pitrDatabaseName := util.GetPITRDatabaseName(database.DatabaseName, issue.CreatedTime.Unix())
- // If there's already a PITR database, it means there's a failed trial before this task execution.
- // We need to clean up the dirty state and start clean for idempotent task execution.
- if _, err := dbConn.ExecContext(ctx, fmt.Sprintf("DROP DATABASE IF EXISTS %s;", pitrDatabaseName)); err != nil {
- return nil, errors.Wrapf(err, "failed to drop the dirty PITR database %q left from a former task execution", pitrDatabaseName)
- }
- if _, err := dbConn.ExecContext(ctx, fmt.Sprintf("CREATE DATABASE %s WITH OWNER %s;", pitrDatabaseName, originalOwner)); err != nil {
- return nil, errors.Wrapf(err, "failed to create the PITR database %q", pitrDatabaseName)
- }
-
- pitrDBDriver, err := dbFactory.GetAdminDatabaseDriver(ctx, instance, nil /* database */, db.ConnectionContext{})
- if err != nil {
- return nil, err
- }
- defer pitrDBDriver.Close(ctx)
- if err := pitrDBDriver.Restore(ctx, backupFile); err != nil {
- return nil, errors.Wrapf(err, "failed to restore backup to the PITR database %q", pitrDatabaseName)
- }
- return &api.TaskRunResultPayload{
- Detail: fmt.Sprintf("Restored backup %q to the temporary PITR database %q", backup.Name, pitrDatabaseName),
- }, nil
-}
-
-func (exec *PITRRestoreExecutor) updateProgress(ctx context.Context, driver *mysql.Driver, taskID int, backupFile *os.File, startBinlogInfo, targetBinlogInfo api.BinlogInfo, binlogDir string) error {
- backupFileInfo, err := backupFile.Stat()
- if err != nil {
- return errors.Wrapf(err, "failed to get stat of backup file %q", backupFile.Name())
- }
- backupFileBytes := backupFileInfo.Size()
- replayBinlogPaths, err := mysql.GetBinlogReplayList(startBinlogInfo, targetBinlogInfo, binlogDir)
- if err != nil {
- return errors.Wrapf(err, "failed to get binlog replay list from %s to %s in binlog directory %q", startBinlogInfo.FileName, targetBinlogInfo.FileName, binlogDir)
- }
- totalBinlogBytes, err := common.GetFileSizeSum(replayBinlogPaths)
- if err != nil {
- return errors.Wrap(err, "failed to get file size sum of replay binlog files")
- }
-
- go func() {
- ticker := time.NewTicker(1 * time.Second)
- defer ticker.Stop()
- createdTs := time.Now().Unix()
- totalUnit := backupFileBytes + totalBinlogBytes
- exec.stateCfg.TaskProgress.Store(taskID, api.Progress{
- TotalUnit: totalUnit,
- CompletedUnit: 0,
- CreatedTs: createdTs,
- UpdatedTs: createdTs,
- })
- for {
- select {
- case <-ticker.C:
- exec.stateCfg.TaskProgress.Store(taskID, api.Progress{
- TotalUnit: totalUnit,
- CompletedUnit: driver.GetRestoredBackupBytes() + driver.GetReplayedBinlogBytes(),
- CreatedTs: createdTs,
- UpdatedTs: time.Now().Unix(),
- })
- case <-ctx.Done():
- return
- }
- }
- }()
-
- return nil
-}
-
-// restoreDatabase will restore the database to the instance from the backup.
-func (*PITRRestoreExecutor) restoreDatabase(ctx context.Context, dbFactory *dbfactory.DBFactory, s3Client *bbs3.Client, profile config.Profile, instance *store.InstanceMessage, database *store.DatabaseMessage, backup *store.BackupMessage) error {
- driver, err := dbFactory.GetAdminDatabaseDriver(ctx, instance, database, db.ConnectionContext{})
- if err != nil {
- return err
- }
- defer driver.Close(ctx)
-
- backupAbsPathLocal := filepath.Join(profile.DataDir, backup.Path)
-
- if backup.StorageBackend == api.BackupStorageBackendS3 {
- if err := downloadBackupFileFromCloud(ctx, s3Client, backup.Path, backupAbsPathLocal); err != nil {
- return errors.Wrapf(err, "failed to download backup %q from S3", backup.Path)
- }
- defer os.Remove(backupAbsPathLocal)
- }
-
- backupFileLocal, err := os.Open(backupAbsPathLocal)
- if err != nil {
- return errors.Wrapf(err, "failed to open backup file at %s", backupAbsPathLocal)
- }
- defer backupFileLocal.Close()
-
- if err := driver.Restore(ctx, backupFileLocal); err != nil {
- return errors.Wrap(err, "failed to restore backup")
- }
-
- return nil
-}
-
-func downloadBackupFileFromCloud(ctx context.Context, s3Client *bbs3.Client, backupPath, backupAbsPathLocal string) error {
- slog.Debug("Downloading backup file from s3 bucket.", slog.String("path", backupPath))
- backupFileDownload, err := os.Create(backupAbsPathLocal)
- if err != nil {
- return errors.Wrapf(err, "failed to create local backup file %q for downloading from s3 bucket", backupAbsPathLocal)
- }
- defer backupFileDownload.Close()
- if _, err := s3Client.DownloadObject(ctx, backupPath, backupFileDownload); err != nil {
- return errors.Wrapf(err, "failed to download backup file %q from s3 bucket", backupPath)
- }
- slog.Debug("Successfully downloaded backup file from s3 bucket.")
- return nil
-}
-
-// createBranchMigrationHistory creates a migration history with "BRANCH" type. We choose NOT to copy over
-// all migration history from source database because that might be expensive (e.g. we may use restore to
-// create many ephemeral databases from backup for testing purpose)
-// Returns migration history id and the version on success.
-func createBranchMigrationHistory(ctx context.Context, stores *store.Store, dbFactory *dbfactory.DBFactory, stateCfg *state.State, profile config.Profile, targetInstance *store.InstanceMessage, sourceDatabase, targetDatabase *store.DatabaseMessage, backup *store.BackupMessage, task *store.TaskMessage, taskRunUID int) (string, model.Version, error) {
- targetInstanceEnvironment, err := stores.GetEnvironmentV2(ctx, &store.FindEnvironmentMessage{ResourceID: &targetDatabase.EffectiveEnvironmentID})
- if err != nil {
- return "", model.Version{}, err
- }
- targetDatabaseProject, err := stores.GetProjectV2(ctx, &store.FindProjectMessage{ResourceID: &targetDatabase.ProjectID})
- if err != nil {
- return "", model.Version{}, err
- }
- issue, err := stores.GetIssueV2(ctx, &store.FindIssueMessage{PipelineID: &task.PipelineID})
- if err != nil {
- return "", model.Version{}, errors.Wrapf(err, "failed to fetch containing issue when creating the migration history: %v", task.Name)
- }
- // Add a branch migration history record.
- description := fmt.Sprintf("Restored from backup %q of database %q.", backup.Name, sourceDatabase.DatabaseName)
- if sourceDatabase.InstanceID != targetDatabase.InstanceID {
- description = fmt.Sprintf("Restored from backup %q of database %q in instance %q.", backup.Name, sourceDatabase.DatabaseName, sourceDatabase.InstanceID)
- }
- creator, err := stores.GetUserByID(ctx, task.CreatorID)
- if err != nil {
- return "", model.Version{}, err
- }
-
- // TODO(d): support semantic versioning.
- m := &db.MigrationInfo{
- InstanceID: &task.InstanceID,
- IssueUID: &issue.UID,
- ReleaseVersion: profile.Version,
- Version: common.DefaultMigrationVersion(),
- Namespace: targetDatabase.DatabaseName,
- Database: targetDatabase.DatabaseName,
- DatabaseID: &targetDatabase.UID,
- Environment: targetInstanceEnvironment.ResourceID,
- Source: db.MigrationSource(targetDatabaseProject.Workflow),
- Type: db.Branch,
- Description: description,
- Creator: creator.Name,
- CreatorID: creator.ID,
- }
- targetDriver, err := dbFactory.GetAdminDatabaseDriver(ctx, targetInstance, targetDatabase, db.ConnectionContext{})
- if err != nil {
- return "", model.Version{}, err
- }
- defer targetDriver.Close(ctx)
-
- migrationID, _, err := utils.ExecuteMigrationDefault(ctx, ctx, stores, stateCfg, taskRunUID, targetDriver, m, "", nil, db.ExecuteOptions{})
- if err != nil {
- return "", model.Version{}, errors.Wrap(err, "failed to create migration history")
- }
- return migrationID, m.Version, nil
-}
diff --git a/backend/server/grpc_routes.go b/backend/server/grpc_routes.go
index 910a8c5685..7435e2560b 100644
--- a/backend/server/grpc_routes.go
+++ b/backend/server/grpc_routes.go
@@ -18,7 +18,6 @@ import (
"github.com/bytebase/bytebase/backend/component/state"
enterprise "github.com/bytebase/bytebase/backend/enterprise/api"
api "github.com/bytebase/bytebase/backend/legacyapi"
- "github.com/bytebase/bytebase/backend/runner/backuprun"
"github.com/bytebase/bytebase/backend/runner/metricreport"
"github.com/bytebase/bytebase/backend/runner/plancheck"
"github.com/bytebase/bytebase/backend/runner/relay"
@@ -40,7 +39,6 @@ func configureGrpcRouters(
schemaSyncer *schemasync.Syncer,
activityManager *activity.Manager,
iamManager *iam.Manager,
- backupRunner *backuprun.Runner,
relayRunner *relay.Runner,
planCheckScheduler *plancheck.Scheduler,
postCreateUser apiv1.CreateUserFunc,
@@ -70,7 +68,7 @@ func configureGrpcRouters(
schemaSyncer,
iamManager))
v1pb.RegisterProjectServiceServer(grpcServer, apiv1.NewProjectService(stores, activityManager, profile, iamManager, licenseService))
- v1pb.RegisterDatabaseServiceServer(grpcServer, apiv1.NewDatabaseService(stores, backupRunner, schemaSyncer, licenseService, profile, iamManager))
+ v1pb.RegisterDatabaseServiceServer(grpcServer, apiv1.NewDatabaseService(stores, schemaSyncer, licenseService, profile, iamManager))
v1pb.RegisterInstanceRoleServiceServer(grpcServer, apiv1.NewInstanceRoleService(stores, dbFactory))
v1pb.RegisterOrgPolicyServiceServer(grpcServer, apiv1.NewOrgPolicyService(stores, licenseService))
v1pb.RegisterIdentityProviderServiceServer(grpcServer, apiv1.NewIdentityProviderService(stores, licenseService))
diff --git a/backend/server/server.go b/backend/server/server.go
index 6620d90f51..55cc1fff8c 100644
--- a/backend/server/server.go
+++ b/backend/server/server.go
@@ -42,7 +42,6 @@ import (
"github.com/bytebase/bytebase/backend/resources/mysqlutil"
"github.com/bytebase/bytebase/backend/resources/postgres"
"github.com/bytebase/bytebase/backend/runner/approval"
- "github.com/bytebase/bytebase/backend/runner/backuprun"
"github.com/bytebase/bytebase/backend/runner/mail"
"github.com/bytebase/bytebase/backend/runner/metricreport"
"github.com/bytebase/bytebase/backend/runner/plancheck"
@@ -73,7 +72,6 @@ type Server struct {
schemaSyncer *schemasync.Syncer
slowQuerySyncer *slowquerysync.Syncer
mailSender *mail.SlowQueryWeeklyMailSender
- backupRunner *backuprun.Runner
rollbackRunner *rollbackrun.Runner
approvalRunner *approval.Runner
relayRunner *relay.Runner
@@ -269,7 +267,6 @@ func NewServer(ctx context.Context, profile config.Profile) (*Server, error) {
s.schemaSyncer = schemasync.NewSyncer(storeInstance, s.dbFactory, s.stateCfg, profile, s.licenseService)
if !profile.Readonly {
s.slowQuerySyncer = slowquerysync.NewSyncer(storeInstance, s.dbFactory, s.stateCfg, profile)
- s.backupRunner = backuprun.NewRunner(storeInstance, s.dbFactory, s.s3Client, s.stateCfg, &profile)
s.rollbackRunner = rollbackrun.NewRunner(&profile, storeInstance, s.dbFactory, s.stateCfg)
s.mailSender = mail.NewSender(s.store, s.stateCfg)
s.relayRunner = relay.NewRunner(storeInstance, s.activityManager, s.stateCfg)
@@ -282,11 +279,8 @@ func NewServer(ctx context.Context, profile config.Profile) (*Server, error) {
s.taskSchedulerV2.Register(api.TaskDatabaseSchemaUpdate, taskrun.NewSchemaUpdateExecutor(storeInstance, s.dbFactory, s.activityManager, s.licenseService, s.stateCfg, s.schemaSyncer, profile))
s.taskSchedulerV2.Register(api.TaskDatabaseSchemaUpdateSDL, taskrun.NewSchemaUpdateSDLExecutor(storeInstance, s.dbFactory, s.activityManager, s.licenseService, s.stateCfg, s.schemaSyncer, profile))
s.taskSchedulerV2.Register(api.TaskDatabaseDataUpdate, taskrun.NewDataUpdateExecutor(storeInstance, s.dbFactory, s.activityManager, s.licenseService, s.stateCfg, s.schemaSyncer, profile))
- s.taskSchedulerV2.Register(api.TaskDatabaseBackup, taskrun.NewDatabaseBackupExecutor(storeInstance, s.dbFactory, s.s3Client, s.stateCfg, profile))
s.taskSchedulerV2.Register(api.TaskDatabaseSchemaUpdateGhostSync, taskrun.NewSchemaUpdateGhostSyncExecutor(storeInstance, s.stateCfg, s.secret))
s.taskSchedulerV2.Register(api.TaskDatabaseSchemaUpdateGhostCutover, taskrun.NewSchemaUpdateGhostCutoverExecutor(storeInstance, s.dbFactory, s.activityManager, s.licenseService, s.stateCfg, s.schemaSyncer, profile))
- s.taskSchedulerV2.Register(api.TaskDatabaseRestorePITRRestore, taskrun.NewPITRRestoreExecutor(storeInstance, s.dbFactory, s.s3Client, s.schemaSyncer, s.stateCfg, profile))
- s.taskSchedulerV2.Register(api.TaskDatabaseRestorePITRCutover, taskrun.NewPITRCutoverExecutor(storeInstance, s.dbFactory, s.schemaSyncer, s.stateCfg, s.backupRunner, s.activityManager, profile))
s.planCheckScheduler = plancheck.NewScheduler(storeInstance, s.licenseService, s.stateCfg)
databaseConnectExecutor := plancheck.NewDatabaseConnectExecutor(storeInstance, s.dbFactory)
@@ -297,8 +291,6 @@ 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)
statementReportExecutor := plancheck.NewStatementReportExecutor(storeInstance, s.dbFactory)
s.planCheckScheduler.Register(store.PlanCheckDatabaseStatementSummaryReport, statementReportExecutor)
@@ -355,7 +347,7 @@ func NewServer(ctx context.Context, profile config.Profile) (*Server, error) {
}
return nil
}
- rolloutService, issueService, err := configureGrpcRouters(ctx, mux, s.grpcServer, s.store, s.dbFactory, s.licenseService, s.profile, s.metricReporter, s.stateCfg, s.schemaSyncer, s.activityManager, s.iamManager, s.backupRunner, s.relayRunner, s.planCheckScheduler, postCreateUser, s.secret, &s.errorRecordRing, tokenDuration)
+ rolloutService, issueService, err := configureGrpcRouters(ctx, mux, s.grpcServer, s.store, s.dbFactory, s.licenseService, s.profile, s.metricReporter, s.stateCfg, s.schemaSyncer, s.activityManager, s.iamManager, s.relayRunner, s.planCheckScheduler, postCreateUser, s.secret, &s.errorRecordRing, tokenDuration)
if err != nil {
return nil, err
}
@@ -389,8 +381,6 @@ func (s *Server) Run(ctx context.Context, port int) error {
s.runnerWG.Add(1)
go s.mailSender.Run(ctx, &s.runnerWG)
s.runnerWG.Add(1)
- go s.backupRunner.Run(ctx, &s.runnerWG)
- s.runnerWG.Add(1)
go s.rollbackRunner.Run(ctx, &s.runnerWG)
s.runnerWG.Add(1)
go s.approvalRunner.Run(ctx, &s.runnerWG)
diff --git a/backend/store/plan_check_run.go b/backend/store/plan_check_run.go
index 9c9ba84ccd..3fa5fd5d22 100644
--- a/backend/store/plan_check_run.go
+++ b/backend/store/plan_check_run.go
@@ -29,8 +29,6 @@ const (
PlanCheckDatabaseConnect PlanCheckRunType = "bb.plan-check.database.connect"
// PlanCheckDatabaseGhostSync is the plan check type for the gh-ost sync task.
PlanCheckDatabaseGhostSync PlanCheckRunType = "bb.plan-check.database.ghost.sync"
- // PlanCheckDatabasePITRMySQL is the plan check type for MySQL PITR.
- PlanCheckDatabasePITRMySQL PlanCheckRunType = "bb.plan-check.database.pitr.mysql"
)
// PlanCheckRunStatus is the status of a plan check run.
diff --git a/backend/store/policy.go b/backend/store/policy.go
index e941d774d3..0b29ef2386 100644
--- a/backend/store/policy.go
+++ b/backend/store/policy.go
@@ -14,26 +14,6 @@ import (
storepb "github.com/bytebase/bytebase/proto/generated-go/store"
)
-// GetBackupPlanPolicyByEnvID will get the backup plan policy for an environment.
-func (s *Store) GetBackupPlanPolicyByEnvID(ctx context.Context, environmentID int) (*api.BackupPlanPolicy, error) {
- resourceType := api.PolicyResourceTypeEnvironment
- pType := api.PolicyTypeBackupPlan
- policy, err := s.GetPolicyV2(ctx, &FindPolicyMessage{
- ResourceType: &resourceType,
- ResourceUID: &environmentID,
- Type: &pType,
- })
- if err != nil {
- return nil, err
- }
- if policy == nil {
- return &api.BackupPlanPolicy{
- Schedule: api.BackupPlanPolicyScheduleUnset,
- }, nil
- }
- return api.UnmarshalBackupPlanPolicy(policy.Payload)
-}
-
func (s *Store) GetRolloutPolicy(ctx context.Context, environmentID int) (*storepb.RolloutPolicy, error) {
resourceType := api.PolicyResourceTypeEnvironment
pType := api.PolicyTypeRollout
diff --git a/frontend/src/types/proto/v1/org_policy_service.ts b/frontend/src/types/proto/v1/org_policy_service.ts
index de24aa3479..345886ccd2 100644
--- a/frontend/src/types/proto/v1/org_policy_service.ts
+++ b/frontend/src/types/proto/v1/org_policy_service.ts
@@ -5,13 +5,11 @@ import { Empty } from "../google/protobuf/empty";
import { FieldMask } from "../google/protobuf/field_mask";
import { Expr } from "../google/type/expr";
import { Engine, engineFromJSON, engineToJSON, MaskingLevel, maskingLevelFromJSON, maskingLevelToJSON } from "./common";
-import { IamPolicy } from "./iam_policy";
export const protobufPackage = "bytebase.v1";
export enum PolicyType {
POLICY_TYPE_UNSPECIFIED = 0,
- WORKSPACE_IAM = 1,
ROLLOUT_POLICY = 11,
SQL_REVIEW = 4,
MASKING = 5,
@@ -28,9 +26,6 @@ export function policyTypeFromJSON(object: any): PolicyType {
case 0:
case "POLICY_TYPE_UNSPECIFIED":
return PolicyType.POLICY_TYPE_UNSPECIFIED;
- case 1:
- case "WORKSPACE_IAM":
- return PolicyType.WORKSPACE_IAM;
case 11:
case "ROLLOUT_POLICY":
return PolicyType.ROLLOUT_POLICY;
@@ -66,8 +61,6 @@ export function policyTypeToJSON(object: PolicyType): string {
switch (object) {
case PolicyType.POLICY_TYPE_UNSPECIFIED:
return "POLICY_TYPE_UNSPECIFIED";
- case PolicyType.WORKSPACE_IAM:
- return "WORKSPACE_IAM";
case PolicyType.ROLLOUT_POLICY:
return "ROLLOUT_POLICY";
case PolicyType.SQL_REVIEW:
@@ -303,7 +296,6 @@ export interface Policy {
uid: string;
inheritFromParent: boolean;
type: PolicyType;
- workspaceIamPolicy?: IamPolicy | undefined;
rolloutPolicy?: RolloutPolicy | undefined;
maskingPolicy?: MaskingPolicy | undefined;
sqlReviewPolicy?: SQLReviewPolicy | undefined;
@@ -937,7 +929,6 @@ function createBasePolicy(): Policy {
uid: "",
inheritFromParent: false,
type: 0,
- workspaceIamPolicy: undefined,
rolloutPolicy: undefined,
maskingPolicy: undefined,
sqlReviewPolicy: undefined,
@@ -966,9 +957,6 @@ export const Policy = {
if (message.type !== 0) {
writer.uint32(40).int32(message.type);
}
- if (message.workspaceIamPolicy !== undefined) {
- IamPolicy.encode(message.workspaceIamPolicy, writer.uint32(50).fork()).ldelim();
- }
if (message.rolloutPolicy !== undefined) {
RolloutPolicy.encode(message.rolloutPolicy, writer.uint32(154).fork()).ldelim();
}
@@ -1043,13 +1031,6 @@ export const Policy = {
message.type = reader.int32() as any;
continue;
- case 6:
- if (tag !== 50) {
- break;
- }
-
- message.workspaceIamPolicy = IamPolicy.decode(reader, reader.uint32());
- continue;
case 19:
if (tag !== 154) {
break;
@@ -1145,7 +1126,6 @@ export const Policy = {
uid: isSet(object.uid) ? globalThis.String(object.uid) : "",
inheritFromParent: isSet(object.inheritFromParent) ? globalThis.Boolean(object.inheritFromParent) : false,
type: isSet(object.type) ? policyTypeFromJSON(object.type) : 0,
- workspaceIamPolicy: isSet(object.workspaceIamPolicy) ? IamPolicy.fromJSON(object.workspaceIamPolicy) : undefined,
rolloutPolicy: isSet(object.rolloutPolicy) ? RolloutPolicy.fromJSON(object.rolloutPolicy) : undefined,
maskingPolicy: isSet(object.maskingPolicy) ? MaskingPolicy.fromJSON(object.maskingPolicy) : undefined,
sqlReviewPolicy: isSet(object.sqlReviewPolicy) ? SQLReviewPolicy.fromJSON(object.sqlReviewPolicy) : undefined,
@@ -1182,9 +1162,6 @@ export const Policy = {
if (message.type !== 0) {
obj.type = policyTypeToJSON(message.type);
}
- if (message.workspaceIamPolicy !== undefined) {
- obj.workspaceIamPolicy = IamPolicy.toJSON(message.workspaceIamPolicy);
- }
if (message.rolloutPolicy !== undefined) {
obj.rolloutPolicy = RolloutPolicy.toJSON(message.rolloutPolicy);
}
@@ -1232,9 +1209,6 @@ export const Policy = {
message.uid = object.uid ?? "";
message.inheritFromParent = object.inheritFromParent ?? false;
message.type = object.type ?? 0;
- message.workspaceIamPolicy = (object.workspaceIamPolicy !== undefined && object.workspaceIamPolicy !== null)
- ? IamPolicy.fromPartial(object.workspaceIamPolicy)
- : undefined;
message.rolloutPolicy = (object.rolloutPolicy !== undefined && object.rolloutPolicy !== null)
? RolloutPolicy.fromPartial(object.rolloutPolicy)
: undefined;
diff --git a/go.mod b/go.mod
index 98f849a565..9e5dc105ac 100644
--- a/go.mod
+++ b/go.mod
@@ -79,7 +79,6 @@ require (
golang.org/x/crypto v0.21.0
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225
golang.org/x/oauth2 v0.17.0
- golang.org/x/sys v0.18.0
golang.org/x/text v0.14.0
google.golang.org/api v0.167.0
google.golang.org/genproto v0.0.0-20240228224816-df926f6c8641
@@ -183,6 +182,7 @@ require (
go.opentelemetry.io/otel/metric v1.23.0 // indirect
go.uber.org/zap v1.26.0 // indirect
golang.org/x/mod v0.15.0 // indirect
+ golang.org/x/sys v0.18.0 // indirect
golang.org/x/term v0.18.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index 6ae2d33c47..1b3cef90a0 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -5400,7 +5400,6 @@ MaskingExceptionPolicy is the allowlist of users who can access sensitive data.
| uid | [string](#string) | | The system-assigned, unique identifier for a resource. |
| inherit_from_parent | [bool](#bool) | | |
| type | [PolicyType](#bytebase-v1-PolicyType) | | |
-| workspace_iam_policy | [IamPolicy](#bytebase-v1-IamPolicy) | | |
| rollout_policy | [RolloutPolicy](#bytebase-v1-RolloutPolicy) | | |
| masking_policy | [MaskingPolicy](#bytebase-v1-MaskingPolicy) | | |
| sql_review_policy | [SQLReviewPolicy](#bytebase-v1-SQLReviewPolicy) | | |
@@ -5559,7 +5558,6 @@ The policy&#39;s `name` field is used to identify the instance to update. Format
| Name | Number | Description |
| ---- | ------ | ----------- |
| POLICY_TYPE_UNSPECIFIED | 0 | |
-| WORKSPACE_IAM | 1 | |
| ROLLOUT_POLICY | 11 | |
| SQL_REVIEW | 4 | |
| MASKING | 5 | |
diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.html
index b862248ded..7a905fbedf 100644
--- a/proto/gen/grpc-doc/v1/index.html
+++ b/proto/gen/grpc-doc/v1/index.html
@@ -15416,13 +15416,6 @@ Database resource name: instances/instance-id/databases/database-name. </p></td>
<td><p> </p></td>
</tr>
- <tr>
- <td>workspace_iam_policy</td>
- <td><a href="#bytebase.v1.IamPolicy">IamPolicy</a></td>
- <td></td>
- <td><p> </p></td>
- </tr>
-
<tr>
<td>rollout_policy</td>
<td><a href="#bytebase.v1.RolloutPolicy">RolloutPolicy</a></td>
@@ -15822,12 +15815,6 @@ In this situation, `update_mask` is ignored. </p></td>
<td><p></p></td>
</tr>
- <tr>
- <td>WORKSPACE_IAM</td>
- <td>1</td>
- <td><p></p></td>
- </tr>
-
<tr>
<td>ROLLOUT_POLICY</td>
<td>11</td>
diff --git a/proto/generated-go/v1/org_policy_service.pb.go b/proto/generated-go/v1/org_policy_service.pb.go
index c0bd0a2d3b..4c39ba6659 100644
--- a/proto/generated-go/v1/org_policy_service.pb.go
+++ b/proto/generated-go/v1/org_policy_service.pb.go
@@ -28,7 +28,6 @@ type PolicyType int32
const (
PolicyType_POLICY_TYPE_UNSPECIFIED PolicyType = 0
- PolicyType_WORKSPACE_IAM PolicyType = 1
PolicyType_ROLLOUT_POLICY PolicyType = 11
PolicyType_SQL_REVIEW PolicyType = 4
PolicyType_MASKING PolicyType = 5
@@ -43,7 +42,6 @@ const (
var (
PolicyType_name = map[int32]string{
0: "POLICY_TYPE_UNSPECIFIED",
- 1: "WORKSPACE_IAM",
11: "ROLLOUT_POLICY",
4: "SQL_REVIEW",
5: "MASKING",
@@ -55,7 +53,6 @@ var (
}
PolicyType_value = map[string]int32{
"POLICY_TYPE_UNSPECIFIED": 0,
- "WORKSPACE_IAM": 1,
"ROLLOUT_POLICY": 11,
"SQL_REVIEW": 4,
"MASKING": 5,
@@ -665,7 +662,6 @@ type Policy struct {
Type PolicyType `protobuf:"varint,5,opt,name=type,proto3,enum=bytebase.v1.PolicyType" json:"type,omitempty"`
// Types that are assignable to Policy:
//
- // *Policy_WorkspaceIamPolicy
// *Policy_RolloutPolicy
// *Policy_MaskingPolicy
// *Policy_SqlReviewPolicy
@@ -749,13 +745,6 @@ func (m *Policy) GetPolicy() isPolicy_Policy {
return nil
}
-func (x *Policy) GetWorkspaceIamPolicy() *IamPolicy {
- if x, ok := x.GetPolicy().(*Policy_WorkspaceIamPolicy); ok {
- return x.WorkspaceIamPolicy
- }
- return nil
-}
-
func (x *Policy) GetRolloutPolicy() *RolloutPolicy {
if x, ok := x.GetPolicy().(*Policy_RolloutPolicy); ok {
return x.RolloutPolicy
@@ -837,10 +826,6 @@ type isPolicy_Policy interface {
isPolicy_Policy()
}
-type Policy_WorkspaceIamPolicy struct {
- WorkspaceIamPolicy *IamPolicy `protobuf:"bytes,6,opt,name=workspace_iam_policy,json=workspaceIamPolicy,proto3,oneof"`
-}
-
type Policy_RolloutPolicy struct {
RolloutPolicy *RolloutPolicy `protobuf:"bytes,19,opt,name=rollout_policy,json=rolloutPolicy,proto3,oneof"`
}
@@ -873,8 +858,6 @@ type Policy_RestrictIssueCreationForSqlReviewPolicy struct {
RestrictIssueCreationForSqlReviewPolicy *RestrictIssueCreationForSQLReviewPolicy `protobuf:"bytes,20,opt,name=restrict_issue_creation_for_sql_review_policy,json=restrictIssueCreationForSqlReviewPolicy,proto3,oneof"`
}
-func (*Policy_WorkspaceIamPolicy) isPolicy_Policy() {}
-
func (*Policy_RolloutPolicy) isPolicy_Policy() {}
func (*Policy_MaskingPolicy) isPolicy_Policy() {}
@@ -1626,350 +1609,342 @@ var file_v1_org_policy_service_proto_rawDesc = []byte{
0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x1a, 0x16, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x65,
0x78, 0x70, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x76, 0x31, 0x2f, 0x63, 0x6f,
- 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x76, 0x31, 0x2f, 0x69,
- 0x61, 0x6d, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
- 0x91, 0x01, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79,
- 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e,
- 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x70, 0x61,
- 0x72, 0x65, 0x6e, 0x74, 0x12, 0x30, 0x0a, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x02,
- 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
- 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06,
- 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x2b, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03,
- 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
- 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74,
- 0x79, 0x70, 0x65, 0x22, 0xa9, 0x01, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f,
- 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x30, 0x0a, 0x06, 0x70,
- 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x62, 0x79,
- 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79,
- 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x3b, 0x0a,
- 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01,
- 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
- 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a,
- 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x6c,
- 0x6c, 0x6f, 0x77, 0x5f, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28,
- 0x08, 0x52, 0x0c, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x22,
- 0x2e, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52,
- 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01,
- 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22,
- 0x2b, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75,
- 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
- 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xe0, 0x01, 0x0a,
- 0x13, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71,
- 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01,
- 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e,
- 0x74, 0x12, 0x3d, 0x0a, 0x0b, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65,
- 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
- 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x54, 0x79, 0x70, 0x65, 0x48,
- 0x00, 0x52, 0x0a, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x54, 0x79, 0x70, 0x65, 0x88, 0x01, 0x01,
- 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20,
- 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a,
- 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28,
- 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x21, 0x0a, 0x0c,
- 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01,
- 0x28, 0x08, 0x52, 0x0b, 0x73, 0x68, 0x6f, 0x77, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x42,
- 0x0e, 0x0a, 0x0c, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x22,
- 0x6f, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52,
- 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x08, 0x70, 0x6f, 0x6c, 0x69, 0x63,
- 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x62, 0x79, 0x74, 0x65,
- 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x08,
- 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74,
- 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28,
- 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e,
- 0x22, 0xcc, 0x08, 0x0a, 0x06, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e,
- 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12,
- 0x15, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41,
- 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x2e, 0x0a, 0x13, 0x69, 0x6e, 0x68, 0x65, 0x72, 0x69,
- 0x74, 0x5f, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20,
- 0x01, 0x28, 0x08, 0x52, 0x11, 0x69, 0x6e, 0x68, 0x65, 0x72, 0x69, 0x74, 0x46, 0x72, 0x6f, 0x6d,
- 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x2b, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05,
- 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
- 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74,
- 0x79, 0x70, 0x65, 0x12, 0x4a, 0x0a, 0x14, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65,
- 0x5f, 0x69, 0x61, 0x6d, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28,
- 0x0b, 0x32, 0x16, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
- 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x48, 0x00, 0x52, 0x12, 0x77, 0x6f, 0x72,
- 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12,
- 0x43, 0x0a, 0x0e, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63,
- 0x79, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
- 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x50, 0x6f, 0x6c,
- 0x69, 0x63, 0x79, 0x48, 0x00, 0x52, 0x0d, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x50, 0x6f,
- 0x6c, 0x69, 0x63, 0x79, 0x12, 0x43, 0x0a, 0x0e, 0x6d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x5f,
- 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x62,
+ 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x91, 0x01, 0x0a, 0x13, 0x43,
+ 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65,
+ 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01,
+ 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12,
+ 0x30, 0x0a, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
+ 0x13, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f,
+ 0x6c, 0x69, 0x63, 0x79, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63,
+ 0x79, 0x12, 0x2b, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32,
+ 0x17, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f,
+ 0x6c, 0x69, 0x63, 0x79, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0xa9,
+ 0x01, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52,
+ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x30, 0x0a, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79,
+ 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
+ 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x42, 0x03, 0xe0, 0x41, 0x02,
+ 0x52, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61,
+ 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e,
+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
+ 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74,
+ 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x6d,
+ 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x61, 0x6c,
+ 0x6c, 0x6f, 0x77, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x22, 0x2e, 0x0a, 0x13, 0x44, 0x65,
+ 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
+ 0x74, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42,
+ 0x03, 0xe0, 0x41, 0x02, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x2b, 0x0a, 0x10, 0x47, 0x65,
+ 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17,
+ 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41,
+ 0x02, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xe0, 0x01, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74,
+ 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
+ 0x1b, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42,
+ 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x3d, 0x0a, 0x0b,
+ 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
+ 0x0e, 0x32, 0x17, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
+ 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x54, 0x79, 0x70, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x70, 0x6f,
+ 0x6c, 0x69, 0x63, 0x79, 0x54, 0x79, 0x70, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1b, 0x0a, 0x09, 0x70,
+ 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08,
+ 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65,
+ 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61,
+ 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x68, 0x6f, 0x77, 0x5f,
+ 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x73,
+ 0x68, 0x6f, 0x77, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x70,
+ 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x22, 0x6f, 0x0a, 0x14, 0x4c, 0x69,
+ 0x73, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
+ 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x08, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x18, 0x01,
+ 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
+ 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x08, 0x70, 0x6f, 0x6c, 0x69, 0x63,
+ 0x69, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65,
+ 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65,
+ 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x80, 0x08, 0x0a, 0x06,
+ 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01,
+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x15, 0x0a, 0x03, 0x75, 0x69,
+ 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x03, 0x75, 0x69,
+ 0x64, 0x12, 0x2e, 0x0a, 0x13, 0x69, 0x6e, 0x68, 0x65, 0x72, 0x69, 0x74, 0x5f, 0x66, 0x72, 0x6f,
+ 0x6d, 0x5f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11,
+ 0x69, 0x6e, 0x68, 0x65, 0x72, 0x69, 0x74, 0x46, 0x72, 0x6f, 0x6d, 0x50, 0x61, 0x72, 0x65, 0x6e,
+ 0x74, 0x12, 0x2b, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32,
+ 0x17, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f,
+ 0x6c, 0x69, 0x63, 0x79, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x43,
+ 0x0a, 0x0e, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79,
+ 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
+ 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x50, 0x6f, 0x6c, 0x69,
+ 0x63, 0x79, 0x48, 0x00, 0x52, 0x0d, 0x72, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x50, 0x6f, 0x6c,
+ 0x69, 0x63, 0x79, 0x12, 0x43, 0x0a, 0x0e, 0x6d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x70,
+ 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x62, 0x79,
+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e,
+ 0x67, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x48, 0x00, 0x52, 0x0d, 0x6d, 0x61, 0x73, 0x6b, 0x69,
+ 0x6e, 0x67, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x4a, 0x0a, 0x11, 0x73, 0x71, 0x6c, 0x5f,
+ 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x0b, 0x20,
+ 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
+ 0x31, 0x2e, 0x53, 0x51, 0x4c, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x50, 0x6f, 0x6c, 0x69, 0x63,
+ 0x79, 0x48, 0x00, 0x52, 0x0f, 0x73, 0x71, 0x6c, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x50, 0x6f,
+ 0x6c, 0x69, 0x63, 0x79, 0x12, 0x4a, 0x0a, 0x11, 0x73, 0x6c, 0x6f, 0x77, 0x5f, 0x71, 0x75, 0x65,
+ 0x72, 0x79, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32,
+ 0x1c, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x6c,
+ 0x6f, 0x77, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x48, 0x00, 0x52,
+ 0x0f, 0x73, 0x6c, 0x6f, 0x77, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79,
+ 0x12, 0x5d, 0x0a, 0x18, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x70, 0x79,
+ 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x10, 0x20, 0x01,
+ 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
+ 0x2e, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x6f, 0x70, 0x79, 0x44, 0x61, 0x74, 0x61,
+ 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x48, 0x00, 0x52, 0x15, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c,
+ 0x65, 0x43, 0x6f, 0x70, 0x79, 0x44, 0x61, 0x74, 0x61, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12,
+ 0x50, 0x0a, 0x13, 0x6d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x5f,
+ 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x62,
0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x73, 0x6b, 0x69,
- 0x6e, 0x67, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x48, 0x00, 0x52, 0x0d, 0x6d, 0x61, 0x73, 0x6b,
- 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x4a, 0x0a, 0x11, 0x73, 0x71, 0x6c,
- 0x5f, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x0b,
- 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
- 0x76, 0x31, 0x2e, 0x53, 0x51, 0x4c, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x50, 0x6f, 0x6c, 0x69,
- 0x63, 0x79, 0x48, 0x00, 0x52, 0x0f, 0x73, 0x71, 0x6c, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x50,
- 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x4a, 0x0a, 0x11, 0x73, 0x6c, 0x6f, 0x77, 0x5f, 0x71, 0x75,
- 0x65, 0x72, 0x79, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b,
- 0x32, 0x1c, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53,
- 0x6c, 0x6f, 0x77, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x48, 0x00,
- 0x52, 0x0f, 0x73, 0x6c, 0x6f, 0x77, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x6c, 0x69, 0x63,
- 0x79, 0x12, 0x5d, 0x0a, 0x18, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x70,
- 0x79, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x10, 0x20,
- 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
- 0x31, 0x2e, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x6f, 0x70, 0x79, 0x44, 0x61, 0x74,
- 0x61, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x48, 0x00, 0x52, 0x15, 0x64, 0x69, 0x73, 0x61, 0x62,
- 0x6c, 0x65, 0x43, 0x6f, 0x70, 0x79, 0x44, 0x61, 0x74, 0x61, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79,
- 0x12, 0x50, 0x0a, 0x13, 0x6d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x72, 0x75, 0x6c, 0x65,
- 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e,
- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x73, 0x6b,
- 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x48, 0x00, 0x52,
- 0x11, 0x6d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x50, 0x6f, 0x6c, 0x69,
- 0x63, 0x79, 0x12, 0x5f, 0x0a, 0x18, 0x6d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x65, 0x78,
- 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x12,
- 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
- 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x45, 0x78, 0x63, 0x65, 0x70, 0x74,
- 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x48, 0x00, 0x52, 0x16, 0x6d, 0x61, 0x73,
- 0x6b, 0x69, 0x6e, 0x67, 0x45, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c,
- 0x69, 0x63, 0x79, 0x12, 0x96, 0x01, 0x0a, 0x2d, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74,
- 0x5f, 0x69, 0x73, 0x73, 0x75, 0x65, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f,
- 0x66, 0x6f, 0x72, 0x5f, 0x73, 0x71, 0x6c, 0x5f, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x70,
- 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x62, 0x79,
- 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x74, 0x72, 0x69,
- 0x63, 0x74, 0x49, 0x73, 0x73, 0x75, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46,
- 0x6f, 0x72, 0x53, 0x51, 0x4c, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x50, 0x6f, 0x6c, 0x69, 0x63,
- 0x79, 0x48, 0x00, 0x52, 0x27, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x49, 0x73, 0x73,
- 0x75, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x53, 0x71, 0x6c,
- 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x18, 0x0a, 0x07,
- 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65,
- 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x12, 0x49, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72,
- 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e,
- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69,
- 0x63, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x42, 0x03,
- 0xe0, 0x41, 0x03, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70,
- 0x65, 0x12, 0x26, 0x0a, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x75, 0x69,
- 0x64, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0b, 0x72, 0x65,
- 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x55, 0x69, 0x64, 0x42, 0x08, 0x0a, 0x06, 0x70, 0x6f, 0x6c,
- 0x69, 0x63, 0x79, 0x4a, 0x04, 0x08, 0x07, 0x10, 0x08, 0x4a, 0x04, 0x08, 0x0a, 0x10, 0x0b, 0x22,
- 0x9c, 0x01, 0x0a, 0x0d, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63,
- 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x18, 0x01,
- 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x12,
- 0x27, 0x0a, 0x0f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x72, 0x6f, 0x6c,
- 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70,
- 0x61, 0x63, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x6a,
- 0x65, 0x63, 0x74, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52,
- 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x12, 0x1f, 0x0a,
- 0x0b, 0x69, 0x73, 0x73, 0x75, 0x65, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03,
- 0x28, 0x09, 0x52, 0x0a, 0x69, 0x73, 0x73, 0x75, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x22, 0x29,
- 0x0a, 0x0f, 0x53, 0x6c, 0x6f, 0x77, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x6c, 0x69, 0x63,
+ 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x48, 0x00, 0x52, 0x11,
+ 0x6d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63,
+ 0x79, 0x12, 0x5f, 0x0a, 0x18, 0x6d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x65, 0x78, 0x63,
+ 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x12, 0x20,
+ 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
+ 0x31, 0x2e, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x45, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69,
+ 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x48, 0x00, 0x52, 0x16, 0x6d, 0x61, 0x73, 0x6b,
+ 0x69, 0x6e, 0x67, 0x45, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69,
+ 0x63, 0x79, 0x12, 0x96, 0x01, 0x0a, 0x2d, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x5f,
+ 0x69, 0x73, 0x73, 0x75, 0x65, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66,
+ 0x6f, 0x72, 0x5f, 0x73, 0x71, 0x6c, 0x5f, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x70, 0x6f,
+ 0x6c, 0x69, 0x63, 0x79, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x62, 0x79, 0x74,
+ 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63,
+ 0x74, 0x49, 0x73, 0x73, 0x75, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6f,
+ 0x72, 0x53, 0x51, 0x4c, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79,
+ 0x48, 0x00, 0x52, 0x27, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x49, 0x73, 0x73, 0x75,
+ 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x53, 0x71, 0x6c, 0x52,
+ 0x65, 0x76, 0x69, 0x65, 0x77, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x65,
+ 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e,
+ 0x66, 0x6f, 0x72, 0x63, 0x65, 0x12, 0x49, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
+ 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x62,
+ 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63,
+ 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x42, 0x03, 0xe0,
+ 0x41, 0x03, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65,
+ 0x12, 0x26, 0x0a, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x75, 0x69, 0x64,
+ 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0b, 0x72, 0x65, 0x73,
+ 0x6f, 0x75, 0x72, 0x63, 0x65, 0x55, 0x69, 0x64, 0x42, 0x08, 0x0a, 0x06, 0x70, 0x6f, 0x6c, 0x69,
+ 0x63, 0x79, 0x4a, 0x04, 0x08, 0x07, 0x10, 0x08, 0x4a, 0x04, 0x08, 0x0a, 0x10, 0x0b, 0x22, 0x9c,
+ 0x01, 0x0a, 0x0d, 0x52, 0x6f, 0x6c, 0x6c, 0x6f, 0x75, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79,
+ 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x18, 0x01, 0x20,
+ 0x01, 0x28, 0x08, 0x52, 0x09, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x12, 0x27,
+ 0x0a, 0x0f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x72, 0x6f, 0x6c, 0x65,
+ 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61,
+ 0x63, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65,
+ 0x63, 0x74, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c,
+ 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b,
+ 0x69, 0x73, 0x73, 0x75, 0x65, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28,
+ 0x09, 0x52, 0x0a, 0x69, 0x73, 0x73, 0x75, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x22, 0x29, 0x0a,
+ 0x0f, 0x53, 0x6c, 0x6f, 0x77, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79,
+ 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08,
+ 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x22, 0x2f, 0x0a, 0x15, 0x44, 0x69, 0x73, 0x61,
+ 0x62, 0x6c, 0x65, 0x43, 0x6f, 0x70, 0x79, 0x44, 0x61, 0x74, 0x61, 0x50, 0x6f, 0x6c, 0x69, 0x63,
0x79, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
- 0x08, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x22, 0x2f, 0x0a, 0x15, 0x44, 0x69, 0x73,
- 0x61, 0x62, 0x6c, 0x65, 0x43, 0x6f, 0x70, 0x79, 0x44, 0x61, 0x74, 0x61, 0x50, 0x6f, 0x6c, 0x69,
- 0x63, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x01, 0x20, 0x01,
- 0x28, 0x08, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x22, 0x43, 0x0a, 0x0d, 0x4d, 0x61,
- 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x32, 0x0a, 0x09, 0x6d,
- 0x61, 0x73, 0x6b, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15,
- 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x73,
- 0x6b, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x61, 0x73, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x22,
- 0x8c, 0x02, 0x0a, 0x08, 0x4d, 0x61, 0x73, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x12, 0x16, 0x0a, 0x06,
- 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63,
- 0x68, 0x65, 0x6d, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20,
- 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f,
- 0x6c, 0x75, 0x6d, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x6f, 0x6c, 0x75,
- 0x6d, 0x6e, 0x12, 0x3e, 0x0a, 0x0d, 0x6d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x6c, 0x65,
- 0x76, 0x65, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65,
- 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x4c,
- 0x65, 0x76, 0x65, 0x6c, 0x52, 0x0c, 0x6d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x76,
- 0x65, 0x6c, 0x12, 0x39, 0x0a, 0x19, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x69,
- 0x6e, 0x67, 0x5f, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x5f, 0x69, 0x64, 0x18,
- 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x16, 0x66, 0x75, 0x6c, 0x6c, 0x4d, 0x61, 0x73, 0x6b, 0x69,
- 0x6e, 0x67, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x49, 0x64, 0x12, 0x3f, 0x0a,
- 0x1c, 0x70, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67,
- 0x5f, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20,
- 0x01, 0x28, 0x09, 0x52, 0x19, 0x70, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x4d, 0x61, 0x73, 0x6b,
- 0x69, 0x6e, 0x67, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x49, 0x64, 0x22, 0x57,
- 0x0a, 0x0f, 0x53, 0x51, 0x4c, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x50, 0x6f, 0x6c, 0x69, 0x63,
- 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
- 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x30, 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x02,
- 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
- 0x76, 0x31, 0x2e, 0x53, 0x51, 0x4c, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x75, 0x6c, 0x65,
- 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x22, 0xbb, 0x01, 0x0a, 0x0d, 0x53, 0x51, 0x4c, 0x52,
- 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70,
- 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x35, 0x0a,
- 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x62,
- 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x51, 0x4c, 0x52, 0x65,
- 0x76, 0x69, 0x65, 0x77, 0x52, 0x75, 0x6c, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x05, 0x6c,
- 0x65, 0x76, 0x65, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18,
- 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x2b,
- 0x0a, 0x06, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13,
- 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x67,
- 0x69, 0x6e, 0x65, 0x52, 0x06, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63,
- 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f,
- 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0xa9, 0x03, 0x0a, 0x16, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e,
+ 0x08, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x22, 0x43, 0x0a, 0x0d, 0x4d, 0x61, 0x73,
+ 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x32, 0x0a, 0x09, 0x6d, 0x61,
+ 0x73, 0x6b, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e,
+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x73, 0x6b,
+ 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x61, 0x73, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x22, 0x8c,
+ 0x02, 0x0a, 0x08, 0x4d, 0x61, 0x73, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x12, 0x16, 0x0a, 0x06, 0x73,
+ 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x68,
+ 0x65, 0x6d, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01,
+ 0x28, 0x09, 0x52, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6c,
+ 0x75, 0x6d, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d,
+ 0x6e, 0x12, 0x3e, 0x0a, 0x0d, 0x6d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x6c, 0x65, 0x76,
+ 0x65, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
+ 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x4c, 0x65,
+ 0x76, 0x65, 0x6c, 0x52, 0x0c, 0x6d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x76, 0x65,
+ 0x6c, 0x12, 0x39, 0x0a, 0x19, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x69, 0x6e,
+ 0x67, 0x5f, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x05,
+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x16, 0x66, 0x75, 0x6c, 0x6c, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e,
+ 0x67, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x49, 0x64, 0x12, 0x3f, 0x0a, 0x1c,
+ 0x70, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x5f,
+ 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01,
+ 0x28, 0x09, 0x52, 0x19, 0x70, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x4d, 0x61, 0x73, 0x6b, 0x69,
+ 0x6e, 0x67, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x49, 0x64, 0x22, 0x57, 0x0a,
+ 0x0f, 0x53, 0x51, 0x4c, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79,
+ 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
+ 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x30, 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20,
+ 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
+ 0x31, 0x2e, 0x53, 0x51, 0x4c, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x75, 0x6c, 0x65, 0x52,
+ 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x22, 0xbb, 0x01, 0x0a, 0x0d, 0x53, 0x51, 0x4c, 0x52, 0x65,
+ 0x76, 0x69, 0x65, 0x77, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65,
+ 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x35, 0x0a, 0x05,
+ 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x62, 0x79,
+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x51, 0x4c, 0x52, 0x65, 0x76,
+ 0x69, 0x65, 0x77, 0x52, 0x75, 0x6c, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x05, 0x6c, 0x65,
+ 0x76, 0x65, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x03,
+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x2b, 0x0a,
+ 0x06, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e,
+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x67, 0x69,
+ 0x6e, 0x65, 0x52, 0x06, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f,
+ 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d,
+ 0x6d, 0x65, 0x6e, 0x74, 0x22, 0xa9, 0x03, 0x0a, 0x16, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67,
+ 0x45, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12,
+ 0x63, 0x0a, 0x12, 0x6d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x65, 0x78, 0x63, 0x65, 0x70,
+ 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x62, 0x79,
+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e,
0x67, 0x45, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79,
- 0x12, 0x63, 0x0a, 0x12, 0x6d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x65, 0x78, 0x63, 0x65,
- 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x62,
- 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x73, 0x6b, 0x69,
- 0x6e, 0x67, 0x45, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63,
- 0x79, 0x2e, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x45, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69,
- 0x6f, 0x6e, 0x52, 0x11, 0x6d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x45, 0x78, 0x63, 0x65, 0x70,
- 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0xa9, 0x02, 0x0a, 0x10, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e,
- 0x67, 0x45, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x53, 0x0a, 0x06, 0x61, 0x63,
- 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3b, 0x2e, 0x62, 0x79, 0x74,
- 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67,
- 0x45, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e,
- 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x45, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e,
- 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12,
- 0x3e, 0x0a, 0x0d, 0x6d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c,
- 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
- 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x76, 0x65,
- 0x6c, 0x52, 0x0c, 0x6d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12,
- 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
- 0x06, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x2f, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69,
- 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x6f, 0x6f,
- 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x09, 0x63,
- 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x37, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69,
- 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53,
- 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x51, 0x55,
- 0x45, 0x52, 0x59, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x45, 0x58, 0x50, 0x4f, 0x52, 0x54, 0x10,
- 0x02, 0x22, 0xe6, 0x01, 0x0a, 0x11, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c,
- 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x40, 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73,
- 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
- 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65,
- 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x75,
- 0x6c, 0x65, 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x1a, 0x8e, 0x01, 0x0a, 0x0b, 0x4d, 0x61,
- 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18,
- 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2f, 0x0a, 0x09, 0x63, 0x6f, 0x6e,
- 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67,
- 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52,
- 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x0d, 0x6d, 0x61,
- 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28,
- 0x0e, 0x32, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
- 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x0c, 0x6d, 0x61,
- 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0x45, 0x0a, 0x27, 0x52, 0x65,
- 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x49, 0x73, 0x73, 0x75, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74,
- 0x69, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x53, 0x51, 0x4c, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x50,
- 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f,
- 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f,
- 0x77, 0x2a, 0xf5, 0x01, 0x0a, 0x0a, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x54, 0x79, 0x70, 0x65,
- 0x12, 0x1b, 0x0a, 0x17, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f,
- 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x11, 0x0a,
- 0x0d, 0x57, 0x4f, 0x52, 0x4b, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x49, 0x41, 0x4d, 0x10, 0x01,
- 0x12, 0x12, 0x0a, 0x0e, 0x52, 0x4f, 0x4c, 0x4c, 0x4f, 0x55, 0x54, 0x5f, 0x50, 0x4f, 0x4c, 0x49,
- 0x43, 0x59, 0x10, 0x0b, 0x12, 0x0e, 0x0a, 0x0a, 0x53, 0x51, 0x4c, 0x5f, 0x52, 0x45, 0x56, 0x49,
- 0x45, 0x57, 0x10, 0x04, 0x12, 0x0b, 0x0a, 0x07, 0x4d, 0x41, 0x53, 0x4b, 0x49, 0x4e, 0x47, 0x10,
- 0x05, 0x12, 0x0e, 0x0a, 0x0a, 0x53, 0x4c, 0x4f, 0x57, 0x5f, 0x51, 0x55, 0x45, 0x52, 0x59, 0x10,
- 0x07, 0x12, 0x15, 0x0a, 0x11, 0x44, 0x49, 0x53, 0x41, 0x42, 0x4c, 0x45, 0x5f, 0x43, 0x4f, 0x50,
- 0x59, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x10, 0x08, 0x12, 0x10, 0x0a, 0x0c, 0x4d, 0x41, 0x53, 0x4b,
- 0x49, 0x4e, 0x47, 0x5f, 0x52, 0x55, 0x4c, 0x45, 0x10, 0x09, 0x12, 0x15, 0x0a, 0x11, 0x4d, 0x41,
- 0x53, 0x4b, 0x49, 0x4e, 0x47, 0x5f, 0x45, 0x58, 0x43, 0x45, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x10,
- 0x0a, 0x12, 0x2a, 0x0a, 0x26, 0x52, 0x45, 0x53, 0x54, 0x52, 0x49, 0x43, 0x54, 0x5f, 0x49, 0x53,
- 0x53, 0x55, 0x45, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x46, 0x4f, 0x52,
- 0x5f, 0x53, 0x51, 0x4c, 0x5f, 0x52, 0x45, 0x56, 0x49, 0x45, 0x57, 0x10, 0x0c, 0x22, 0x04, 0x08,
- 0x02, 0x10, 0x02, 0x22, 0x04, 0x08, 0x06, 0x10, 0x06, 0x2a, 0x7c, 0x0a, 0x12, 0x50, 0x6f, 0x6c,
- 0x69, 0x63, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12,
- 0x1d, 0x0a, 0x19, 0x52, 0x45, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45,
- 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d,
- 0x0a, 0x09, 0x57, 0x4f, 0x52, 0x4b, 0x53, 0x50, 0x41, 0x43, 0x45, 0x10, 0x01, 0x12, 0x0f, 0x0a,
- 0x0b, 0x45, 0x4e, 0x56, 0x49, 0x52, 0x4f, 0x4e, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x02, 0x12, 0x0b,
- 0x0a, 0x07, 0x50, 0x52, 0x4f, 0x4a, 0x45, 0x43, 0x54, 0x10, 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x49,
- 0x4e, 0x53, 0x54, 0x41, 0x4e, 0x43, 0x45, 0x10, 0x04, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x41, 0x54,
- 0x41, 0x42, 0x41, 0x53, 0x45, 0x10, 0x05, 0x2a, 0x51, 0x0a, 0x12, 0x53, 0x51, 0x4c, 0x52, 0x65,
- 0x76, 0x69, 0x65, 0x77, 0x52, 0x75, 0x6c, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x15, 0x0a,
- 0x11, 0x4c, 0x45, 0x56, 0x45, 0x4c, 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, 0x0c, 0x0a, 0x08,
- 0x44, 0x49, 0x53, 0x41, 0x42, 0x4c, 0x45, 0x44, 0x10, 0x03, 0x32, 0xeb, 0x0b, 0x0a, 0x10, 0x4f,
- 0x72, 0x67, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12,
- 0x89, 0x02, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x1d, 0x2e,
- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50,
- 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x62,
- 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63,
- 0x79, 0x22, 0xc7, 0x01, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02,
- 0xb9, 0x01, 0x5a, 0x22, 0x12, 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
+ 0x2e, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x45, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f,
+ 0x6e, 0x52, 0x11, 0x6d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x45, 0x78, 0x63, 0x65, 0x70, 0x74,
+ 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0xa9, 0x02, 0x0a, 0x10, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67,
+ 0x45, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x53, 0x0a, 0x06, 0x61, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3b, 0x2e, 0x62, 0x79, 0x74, 0x65,
+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x45,
+ 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x4d,
+ 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x45, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e,
+ 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e,
+ 0x0a, 0x0d, 0x6d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18,
+ 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
+ 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c,
+ 0x52, 0x0c, 0x6d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x16,
+ 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06,
+ 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x2f, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74,
+ 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
+ 0x6c, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x09, 0x63, 0x6f,
+ 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x37, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50,
+ 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x51, 0x55, 0x45,
+ 0x52, 0x59, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x45, 0x58, 0x50, 0x4f, 0x52, 0x54, 0x10, 0x02,
+ 0x22, 0xe6, 0x01, 0x0a, 0x11, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65,
+ 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x40, 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18,
+ 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
+ 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x50,
+ 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c,
+ 0x65, 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x1a, 0x8e, 0x01, 0x0a, 0x0b, 0x4d, 0x61, 0x73,
+ 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01,
+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2f, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x64,
+ 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x6f,
+ 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x09,
+ 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x0d, 0x6d, 0x61, 0x73,
+ 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e,
+ 0x32, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d,
+ 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x0c, 0x6d, 0x61, 0x73,
+ 0x6b, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0x45, 0x0a, 0x27, 0x52, 0x65, 0x73,
+ 0x74, 0x72, 0x69, 0x63, 0x74, 0x49, 0x73, 0x73, 0x75, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x53, 0x51, 0x4c, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x50, 0x6f,
+ 0x6c, 0x69, 0x63, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77,
+ 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77,
+ 0x2a, 0xe2, 0x01, 0x0a, 0x0a, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12,
+ 0x1b, 0x0a, 0x17, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55,
+ 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e,
+ 0x52, 0x4f, 0x4c, 0x4c, 0x4f, 0x55, 0x54, 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x10, 0x0b,
+ 0x12, 0x0e, 0x0a, 0x0a, 0x53, 0x51, 0x4c, 0x5f, 0x52, 0x45, 0x56, 0x49, 0x45, 0x57, 0x10, 0x04,
+ 0x12, 0x0b, 0x0a, 0x07, 0x4d, 0x41, 0x53, 0x4b, 0x49, 0x4e, 0x47, 0x10, 0x05, 0x12, 0x0e, 0x0a,
+ 0x0a, 0x53, 0x4c, 0x4f, 0x57, 0x5f, 0x51, 0x55, 0x45, 0x52, 0x59, 0x10, 0x07, 0x12, 0x15, 0x0a,
+ 0x11, 0x44, 0x49, 0x53, 0x41, 0x42, 0x4c, 0x45, 0x5f, 0x43, 0x4f, 0x50, 0x59, 0x5f, 0x44, 0x41,
+ 0x54, 0x41, 0x10, 0x08, 0x12, 0x10, 0x0a, 0x0c, 0x4d, 0x41, 0x53, 0x4b, 0x49, 0x4e, 0x47, 0x5f,
+ 0x52, 0x55, 0x4c, 0x45, 0x10, 0x09, 0x12, 0x15, 0x0a, 0x11, 0x4d, 0x41, 0x53, 0x4b, 0x49, 0x4e,
+ 0x47, 0x5f, 0x45, 0x58, 0x43, 0x45, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x0a, 0x12, 0x2a, 0x0a,
+ 0x26, 0x52, 0x45, 0x53, 0x54, 0x52, 0x49, 0x43, 0x54, 0x5f, 0x49, 0x53, 0x53, 0x55, 0x45, 0x5f,
+ 0x43, 0x52, 0x45, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x46, 0x4f, 0x52, 0x5f, 0x53, 0x51, 0x4c,
+ 0x5f, 0x52, 0x45, 0x56, 0x49, 0x45, 0x57, 0x10, 0x0c, 0x22, 0x04, 0x08, 0x02, 0x10, 0x02, 0x22,
+ 0x04, 0x08, 0x06, 0x10, 0x06, 0x2a, 0x7c, 0x0a, 0x12, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52,
+ 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x19, 0x52,
+ 0x45, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53,
+ 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x57, 0x4f,
+ 0x52, 0x4b, 0x53, 0x50, 0x41, 0x43, 0x45, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x45, 0x4e, 0x56,
+ 0x49, 0x52, 0x4f, 0x4e, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x52,
+ 0x4f, 0x4a, 0x45, 0x43, 0x54, 0x10, 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x49, 0x4e, 0x53, 0x54, 0x41,
+ 0x4e, 0x43, 0x45, 0x10, 0x04, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x41, 0x54, 0x41, 0x42, 0x41, 0x53,
+ 0x45, 0x10, 0x05, 0x2a, 0x51, 0x0a, 0x12, 0x53, 0x51, 0x4c, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77,
+ 0x52, 0x75, 0x6c, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x15, 0x0a, 0x11, 0x4c, 0x45, 0x56,
+ 0x45, 0x4c, 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, 0x0c, 0x0a, 0x08, 0x44, 0x49, 0x53, 0x41,
+ 0x42, 0x4c, 0x45, 0x44, 0x10, 0x03, 0x32, 0xeb, 0x0b, 0x0a, 0x10, 0x4f, 0x72, 0x67, 0x50, 0x6f,
+ 0x6c, 0x69, 0x63, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x89, 0x02, 0x0a, 0x09,
+ 0x47, 0x65, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x1d, 0x2e, 0x62, 0x79, 0x74, 0x65,
+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63,
+ 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
+ 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0xc7, 0x01,
+ 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0xb9, 0x01, 0x5a, 0x22,
+ 0x12, 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a,
+ 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x2f,
+ 0x2a, 0x7d, 0x5a, 0x26, 0x12, 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
+ 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x70,
+ 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x5a, 0x23, 0x12, 0x21, 0x2f, 0x76,
+ 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65,
+ 0x73, 0x2f, 0x2a, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x5a,
+ 0x2f, 0x12, 0x2d, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x69, 0x6e, 0x73,
+ 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73,
+ 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x2f, 0x2a, 0x7d,
+ 0x12, 0x15, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x6f, 0x6c, 0x69,
+ 0x63, 0x69, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x90, 0x02, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74,
+ 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x12, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
+ 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63,
+ 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x62, 0x79, 0x74,
+ 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, 0x6c,
+ 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xba, 0x01,
+ 0xda, 0x41, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0xb0, 0x01, 0x5a, 0x22, 0x12, 0x20, 0x2f, 0x76,
+ 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63,
+ 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x5a, 0x26,
+ 0x12, 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x65, 0x6e,
+ 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x70, 0x6f,
+ 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x5a, 0x23, 0x12, 0x21, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70,
+ 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f,
+ 0x2a, 0x7d, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x5a, 0x2f, 0x12, 0x2d, 0x2f,
+ 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x69, 0x6e, 0x73, 0x74, 0x61,
+ 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73,
+ 0x2f, 0x2a, 0x7d, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x12, 0x0c, 0x2f, 0x76,
+ 0x31, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x12, 0xb7, 0x02, 0x0a, 0x0c, 0x43,
+ 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x20, 0x2e, 0x62, 0x79,
+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65,
+ 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e,
+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69,
+ 0x63, 0x79, 0x22, 0xef, 0x01, 0xda, 0x41, 0x0d, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2c, 0x70,
+ 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0xd8, 0x01, 0x3a, 0x06, 0x70, 0x6f,
+ 0x6c, 0x69, 0x63, 0x79, 0x5a, 0x2a, 0x3a, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x20,
+ 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a,
+ 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73,
+ 0x5a, 0x2e, 0x3a, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x24, 0x2f, 0x76, 0x31, 0x2f,
+ 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d,
+ 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73,
+ 0x5a, 0x2b, 0x3a, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x21, 0x2f, 0x76, 0x31, 0x2f,
+ 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65,
+ 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x5a, 0x37, 0x3a,
+ 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x2d, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61,
+ 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a,
+ 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x70, 0x6f,
+ 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x22, 0x0c, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x6f, 0x6c, 0x69,
+ 0x63, 0x69, 0x65, 0x73, 0x12, 0xe8, 0x02, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50,
+ 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
+ 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79,
+ 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
+ 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0xa0, 0x02, 0xda,
+ 0x41, 0x12, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f,
+ 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x84, 0x02, 0x3a, 0x06, 0x70, 0x6f, 0x6c,
+ 0x69, 0x63, 0x79, 0x5a, 0x31, 0x3a, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x32, 0x27, 0x2f,
+ 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63,
- 0x69, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x5a, 0x26, 0x12, 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e,
- 0x61, 0x6d, 0x65, 0x3d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73,
- 0x2f, 0x2a, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x5a, 0x23,
- 0x12, 0x21, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x69, 0x6e, 0x73, 0x74,
- 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73,
- 0x2f, 0x2a, 0x7d, 0x5a, 0x2f, 0x12, 0x2d, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65,
- 0x3d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x61, 0x74,
- 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65,
- 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x15, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
- 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x90, 0x02, 0x0a, 0x0c,
- 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x12, 0x20, 0x2e, 0x62,
- 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50,
- 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21,
- 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73,
- 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
- 0x65, 0x22, 0xba, 0x01, 0xda, 0x41, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0xb0, 0x01, 0x5a, 0x22,
- 0x12, 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72,
- 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69,
- 0x65, 0x73, 0x5a, 0x26, 0x12, 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e,
- 0x74, 0x3d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x2a,
- 0x7d, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x5a, 0x23, 0x12, 0x21, 0x2f, 0x76,
- 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e,
- 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x5a,
- 0x2f, 0x12, 0x2d, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x69,
- 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62,
- 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73,
- 0x12, 0x0c, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x12, 0xb7,
- 0x02, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12,
- 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72,
- 0x65, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
- 0x74, 0x1a, 0x13, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
- 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0xef, 0x01, 0xda, 0x41, 0x0d, 0x70, 0x61, 0x72, 0x65,
- 0x6e, 0x74, 0x2c, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0xd8, 0x01,
- 0x3a, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5a, 0x2a, 0x3a, 0x06, 0x70, 0x6f, 0x6c, 0x69,
- 0x63, 0x79, 0x22, 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d,
- 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x70, 0x6f, 0x6c, 0x69,
- 0x63, 0x69, 0x65, 0x73, 0x5a, 0x2e, 0x3a, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x24,
- 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x65, 0x6e, 0x76, 0x69,
- 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x70, 0x6f, 0x6c, 0x69,
- 0x63, 0x69, 0x65, 0x73, 0x5a, 0x2b, 0x3a, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x21,
- 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x69, 0x6e, 0x73, 0x74,
- 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65,
- 0x73, 0x5a, 0x37, 0x3a, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x2d, 0x2f, 0x76, 0x31,
- 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63,
- 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a,
- 0x7d, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x22, 0x0c, 0x2f, 0x76, 0x31, 0x2f,
- 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x12, 0xe8, 0x02, 0x0a, 0x0c, 0x55, 0x70, 0x64,
- 0x61, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65,
- 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f,
- 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x62, 0x79,
- 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79,
- 0x22, 0xa0, 0x02, 0xda, 0x41, 0x12, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2c, 0x75, 0x70, 0x64,
- 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x84, 0x02, 0x3a,
- 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5a, 0x31, 0x3a, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63,
- 0x79, 0x32, 0x27, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x6e,
- 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x70,
- 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x5a, 0x35, 0x3a, 0x06, 0x70, 0x6f,
- 0x6c, 0x69, 0x63, 0x79, 0x32, 0x2b, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x6f, 0x6c, 0x69, 0x63,
- 0x79, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65,
- 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x2f, 0x2a,
- 0x7d, 0x5a, 0x32, 0x3a, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x32, 0x28, 0x2f, 0x76, 0x31,
+ 0x69, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x5a, 0x35, 0x3a, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79,
+ 0x32, 0x2b, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x6e, 0x61,
+ 0x6d, 0x65, 0x3d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f,
+ 0x2a, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x5a, 0x32, 0x3a,
+ 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x32, 0x28, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x6f,
+ 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e,
+ 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x2f, 0x2a,
+ 0x7d, 0x5a, 0x3e, 0x3a, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x32, 0x34, 0x2f, 0x76, 0x31,
0x2f, 0x7b, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x69, 0x6e,
- 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69,
- 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x5a, 0x3e, 0x3a, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x32,
- 0x34, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x6e, 0x61, 0x6d,
- 0x65, 0x3d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x61,
- 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69,
- 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x32, 0x1c, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x6f, 0x6c, 0x69,
- 0x63, 0x79, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73,
- 0x2f, 0x2a, 0x7d, 0x12, 0x92, 0x02, 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6f,
- 0x6c, 0x69, 0x63, 0x79, 0x12, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
- 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52,
- 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0xc7,
- 0x01, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0xb9, 0x01, 0x5a,
- 0x22, 0x2a, 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f,
- 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73,
- 0x2f, 0x2a, 0x7d, 0x5a, 0x26, 0x2a, 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65,
- 0x3d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x2f,
- 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x5a, 0x23, 0x2a, 0x21, 0x2f,
- 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63,
- 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x2f, 0x2a, 0x7d,
- 0x5a, 0x2f, 0x2a, 0x2d, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x69, 0x6e,
0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61,
0x73, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x2f, 0x2a,
- 0x7d, 0x2a, 0x15, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x6f, 0x6c,
- 0x69, 0x63, 0x69, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x42, 0x11, 0x5a, 0x0f, 0x67, 0x65, 0x6e, 0x65,
- 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x33,
+ 0x7d, 0x32, 0x1c, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x6e,
+ 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x12,
+ 0x92, 0x02, 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79,
+ 0x12, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44,
+ 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65,
+ 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
+ 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0xc7, 0x01, 0xda, 0x41, 0x04,
+ 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0xb9, 0x01, 0x5a, 0x22, 0x2a, 0x20, 0x2f,
+ 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74,
+ 0x73, 0x2f, 0x2a, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x5a,
+ 0x26, 0x2a, 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x65, 0x6e, 0x76,
+ 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x70, 0x6f, 0x6c, 0x69,
+ 0x63, 0x69, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x5a, 0x23, 0x2a, 0x21, 0x2f, 0x76, 0x31, 0x2f, 0x7b,
+ 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a,
+ 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x5a, 0x2f, 0x2a, 0x2d,
+ 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e,
+ 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f,
+ 0x2a, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x2a, 0x15, 0x2f,
+ 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65,
+ 0x73, 0x2f, 0x2a, 0x7d, 0x42, 0x11, 0x5a, 0x0f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65,
+ 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -2011,11 +1986,10 @@ var file_v1_org_policy_service_proto_goTypes = []interface{}{
(*MaskingExceptionPolicy_MaskingException)(nil), // 21: bytebase.v1.MaskingExceptionPolicy.MaskingException
(*MaskingRulePolicy_MaskingRule)(nil), // 22: bytebase.v1.MaskingRulePolicy.MaskingRule
(*fieldmaskpb.FieldMask)(nil), // 23: google.protobuf.FieldMask
- (*IamPolicy)(nil), // 24: bytebase.v1.IamPolicy
- (MaskingLevel)(0), // 25: bytebase.v1.MaskingLevel
- (Engine)(0), // 26: bytebase.v1.Engine
- (*expr.Expr)(nil), // 27: google.type.Expr
- (*emptypb.Empty)(nil), // 28: google.protobuf.Empty
+ (MaskingLevel)(0), // 24: bytebase.v1.MaskingLevel
+ (Engine)(0), // 25: bytebase.v1.Engine
+ (*expr.Expr)(nil), // 26: google.type.Expr
+ (*emptypb.Empty)(nil), // 27: google.protobuf.Empty
}
var file_v1_org_policy_service_proto_depIdxs = []int32{
10, // 0: bytebase.v1.CreatePolicyRequest.policy:type_name -> bytebase.v1.Policy
@@ -2025,43 +1999,42 @@ var file_v1_org_policy_service_proto_depIdxs = []int32{
0, // 4: bytebase.v1.ListPoliciesRequest.policy_type:type_name -> bytebase.v1.PolicyType
10, // 5: bytebase.v1.ListPoliciesResponse.policies:type_name -> bytebase.v1.Policy
0, // 6: bytebase.v1.Policy.type:type_name -> bytebase.v1.PolicyType
- 24, // 7: bytebase.v1.Policy.workspace_iam_policy:type_name -> bytebase.v1.IamPolicy
- 11, // 8: bytebase.v1.Policy.rollout_policy:type_name -> bytebase.v1.RolloutPolicy
- 14, // 9: bytebase.v1.Policy.masking_policy:type_name -> bytebase.v1.MaskingPolicy
- 16, // 10: bytebase.v1.Policy.sql_review_policy:type_name -> bytebase.v1.SQLReviewPolicy
- 12, // 11: bytebase.v1.Policy.slow_query_policy:type_name -> bytebase.v1.SlowQueryPolicy
- 13, // 12: bytebase.v1.Policy.disable_copy_data_policy:type_name -> bytebase.v1.DisableCopyDataPolicy
- 19, // 13: bytebase.v1.Policy.masking_rule_policy:type_name -> bytebase.v1.MaskingRulePolicy
- 18, // 14: bytebase.v1.Policy.masking_exception_policy:type_name -> bytebase.v1.MaskingExceptionPolicy
- 20, // 15: bytebase.v1.Policy.restrict_issue_creation_for_sql_review_policy:type_name -> bytebase.v1.RestrictIssueCreationForSQLReviewPolicy
- 1, // 16: bytebase.v1.Policy.resource_type:type_name -> bytebase.v1.PolicyResourceType
- 15, // 17: bytebase.v1.MaskingPolicy.mask_data:type_name -> bytebase.v1.MaskData
- 25, // 18: bytebase.v1.MaskData.masking_level:type_name -> bytebase.v1.MaskingLevel
- 17, // 19: bytebase.v1.SQLReviewPolicy.rules:type_name -> bytebase.v1.SQLReviewRule
- 2, // 20: bytebase.v1.SQLReviewRule.level:type_name -> bytebase.v1.SQLReviewRuleLevel
- 26, // 21: bytebase.v1.SQLReviewRule.engine:type_name -> bytebase.v1.Engine
- 21, // 22: bytebase.v1.MaskingExceptionPolicy.masking_exceptions:type_name -> bytebase.v1.MaskingExceptionPolicy.MaskingException
- 22, // 23: bytebase.v1.MaskingRulePolicy.rules:type_name -> bytebase.v1.MaskingRulePolicy.MaskingRule
- 3, // 24: bytebase.v1.MaskingExceptionPolicy.MaskingException.action:type_name -> bytebase.v1.MaskingExceptionPolicy.MaskingException.Action
- 25, // 25: bytebase.v1.MaskingExceptionPolicy.MaskingException.masking_level:type_name -> bytebase.v1.MaskingLevel
- 27, // 26: bytebase.v1.MaskingExceptionPolicy.MaskingException.condition:type_name -> google.type.Expr
- 27, // 27: bytebase.v1.MaskingRulePolicy.MaskingRule.condition:type_name -> google.type.Expr
- 25, // 28: bytebase.v1.MaskingRulePolicy.MaskingRule.masking_level:type_name -> bytebase.v1.MaskingLevel
- 7, // 29: bytebase.v1.OrgPolicyService.GetPolicy:input_type -> bytebase.v1.GetPolicyRequest
- 8, // 30: bytebase.v1.OrgPolicyService.ListPolicies:input_type -> bytebase.v1.ListPoliciesRequest
- 4, // 31: bytebase.v1.OrgPolicyService.CreatePolicy:input_type -> bytebase.v1.CreatePolicyRequest
- 5, // 32: bytebase.v1.OrgPolicyService.UpdatePolicy:input_type -> bytebase.v1.UpdatePolicyRequest
- 6, // 33: bytebase.v1.OrgPolicyService.DeletePolicy:input_type -> bytebase.v1.DeletePolicyRequest
- 10, // 34: bytebase.v1.OrgPolicyService.GetPolicy:output_type -> bytebase.v1.Policy
- 9, // 35: bytebase.v1.OrgPolicyService.ListPolicies:output_type -> bytebase.v1.ListPoliciesResponse
- 10, // 36: bytebase.v1.OrgPolicyService.CreatePolicy:output_type -> bytebase.v1.Policy
- 10, // 37: bytebase.v1.OrgPolicyService.UpdatePolicy:output_type -> bytebase.v1.Policy
- 28, // 38: bytebase.v1.OrgPolicyService.DeletePolicy:output_type -> google.protobuf.Empty
- 34, // [34:39] is the sub-list for method output_type
- 29, // [29:34] is the sub-list for method input_type
- 29, // [29:29] is the sub-list for extension type_name
- 29, // [29:29] is the sub-list for extension extendee
- 0, // [0:29] is the sub-list for field type_name
+ 11, // 7: bytebase.v1.Policy.rollout_policy:type_name -> bytebase.v1.RolloutPolicy
+ 14, // 8: bytebase.v1.Policy.masking_policy:type_name -> bytebase.v1.MaskingPolicy
+ 16, // 9: bytebase.v1.Policy.sql_review_policy:type_name -> bytebase.v1.SQLReviewPolicy
+ 12, // 10: bytebase.v1.Policy.slow_query_policy:type_name -> bytebase.v1.SlowQueryPolicy
+ 13, // 11: bytebase.v1.Policy.disable_copy_data_policy:type_name -> bytebase.v1.DisableCopyDataPolicy
+ 19, // 12: bytebase.v1.Policy.masking_rule_policy:type_name -> bytebase.v1.MaskingRulePolicy
+ 18, // 13: bytebase.v1.Policy.masking_exception_policy:type_name -> bytebase.v1.MaskingExceptionPolicy
+ 20, // 14: bytebase.v1.Policy.restrict_issue_creation_for_sql_review_policy:type_name -> bytebase.v1.RestrictIssueCreationForSQLReviewPolicy
+ 1, // 15: bytebase.v1.Policy.resource_type:type_name -> bytebase.v1.PolicyResourceType
+ 15, // 16: bytebase.v1.MaskingPolicy.mask_data:type_name -> bytebase.v1.MaskData
+ 24, // 17: bytebase.v1.MaskData.masking_level:type_name -> bytebase.v1.MaskingLevel
+ 17, // 18: bytebase.v1.SQLReviewPolicy.rules:type_name -> bytebase.v1.SQLReviewRule
+ 2, // 19: bytebase.v1.SQLReviewRule.level:type_name -> bytebase.v1.SQLReviewRuleLevel
+ 25, // 20: bytebase.v1.SQLReviewRule.engine:type_name -> bytebase.v1.Engine
+ 21, // 21: bytebase.v1.MaskingExceptionPolicy.masking_exceptions:type_name -> bytebase.v1.MaskingExceptionPolicy.MaskingException
+ 22, // 22: bytebase.v1.MaskingRulePolicy.rules:type_name -> bytebase.v1.MaskingRulePolicy.MaskingRule
+ 3, // 23: bytebase.v1.MaskingExceptionPolicy.MaskingException.action:type_name -> bytebase.v1.MaskingExceptionPolicy.MaskingException.Action
+ 24, // 24: bytebase.v1.MaskingExceptionPolicy.MaskingException.masking_level:type_name -> bytebase.v1.MaskingLevel
+ 26, // 25: bytebase.v1.MaskingExceptionPolicy.MaskingException.condition:type_name -> google.type.Expr
+ 26, // 26: bytebase.v1.MaskingRulePolicy.MaskingRule.condition:type_name -> google.type.Expr
+ 24, // 27: bytebase.v1.MaskingRulePolicy.MaskingRule.masking_level:type_name -> bytebase.v1.MaskingLevel
+ 7, // 28: bytebase.v1.OrgPolicyService.GetPolicy:input_type -> bytebase.v1.GetPolicyRequest
+ 8, // 29: bytebase.v1.OrgPolicyService.ListPolicies:input_type -> bytebase.v1.ListPoliciesRequest
+ 4, // 30: bytebase.v1.OrgPolicyService.CreatePolicy:input_type -> bytebase.v1.CreatePolicyRequest
+ 5, // 31: bytebase.v1.OrgPolicyService.UpdatePolicy:input_type -> bytebase.v1.UpdatePolicyRequest
+ 6, // 32: bytebase.v1.OrgPolicyService.DeletePolicy:input_type -> bytebase.v1.DeletePolicyRequest
+ 10, // 33: bytebase.v1.OrgPolicyService.GetPolicy:output_type -> bytebase.v1.Policy
+ 9, // 34: bytebase.v1.OrgPolicyService.ListPolicies:output_type -> bytebase.v1.ListPoliciesResponse
+ 10, // 35: bytebase.v1.OrgPolicyService.CreatePolicy:output_type -> bytebase.v1.Policy
+ 10, // 36: bytebase.v1.OrgPolicyService.UpdatePolicy:output_type -> bytebase.v1.Policy
+ 27, // 37: bytebase.v1.OrgPolicyService.DeletePolicy:output_type -> google.protobuf.Empty
+ 33, // [33:38] is the sub-list for method output_type
+ 28, // [28:33] is the sub-list for method input_type
+ 28, // [28:28] is the sub-list for extension type_name
+ 28, // [28:28] is the sub-list for extension extendee
+ 0, // [0:28] is the sub-list for field type_name
}
func init() { file_v1_org_policy_service_proto_init() }
@@ -2070,7 +2043,6 @@ func file_v1_org_policy_service_proto_init() {
return
}
file_v1_common_proto_init()
- file_v1_iam_policy_proto_init()
if !protoimpl.UnsafeEnabled {
file_v1_org_policy_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreatePolicyRequest); i {
@@ -2303,7 +2275,6 @@ func file_v1_org_policy_service_proto_init() {
}
file_v1_org_policy_service_proto_msgTypes[4].OneofWrappers = []interface{}{}
file_v1_org_policy_service_proto_msgTypes[6].OneofWrappers = []interface{}{
- (*Policy_WorkspaceIamPolicy)(nil),
(*Policy_RolloutPolicy)(nil),
(*Policy_MaskingPolicy)(nil),
(*Policy_SqlReviewPolicy)(nil),
diff --git a/proto/v1/org_policy_service.proto b/proto/v1/org_policy_service.proto
index 573ed7a068..4c4b49b8a6 100644
--- a/proto/v1/org_policy_service.proto
+++ b/proto/v1/org_policy_service.proto
@@ -9,7 +9,6 @@ import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/type/expr.proto";
import "v1/common.proto";
-import "v1/iam_policy.proto";
option go_package = "generated-go/v1";
@@ -202,7 +201,6 @@ message Policy {
PolicyType type = 5;
oneof policy {
- IamPolicy workspace_iam_policy = 6;
RolloutPolicy rollout_policy = 19;
MaskingPolicy masking_policy = 9;
SQLReviewPolicy sql_review_policy = 11;
@@ -226,7 +224,6 @@ enum PolicyType {
reserved 2, 6;
POLICY_TYPE_UNSPECIFIED = 0;
- WORKSPACE_IAM = 1;
ROLLOUT_POLICY = 11;
SQL_REVIEW = 4;
MASKING = 5;