schematools

package
v0.19.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareSchemas

func CompareSchemas(
	ctx context.Context,
	ts *topo.Server,
	tmc tmclient.TabletManagerClient,
	source *topodatapb.TabletAlias,
	dest *topodatapb.TabletAlias,
	tables []string,
	excludeTables []string,
	includeViews bool,
) (diffs []string, err error)

CompareSchemas returns (nil, nil) if the schema of the two tablets match. If there are diffs, they are returned as (diffs []string, nil).

If fetching the schema for either tablet fails, a non-nil error is returned.

func GetSchema

GetSchema makes an RPC to get the schema from a remote tablet, after verifying a tablet with that alias exists in the topo.

func ParseSchemaMigrationStatus added in v0.18.0

func ParseSchemaMigrationStatus(name string) (vtctldatapb.SchemaMigration_Status, error)

ParseSchemaMigrationStatus parses the given status into the underlying enum type.

func ParseSchemaMigrationStrategy added in v0.18.0

func ParseSchemaMigrationStrategy(name string) (vtctldatapb.SchemaMigration_Strategy, error)

ParseSchemaMigrationStrategy parses the given strategy into the underlying enum type.

func ReloadShard

func ReloadShard(ctx context.Context, ts *topo.Server, tmc tmclient.TabletManagerClient, logger logutil.Logger, keyspace, shard, replicationPos string, concurrency *semaphore.Weighted, includePrimary bool) (isPartial bool, ok bool)

ReloadShard reloads the schema for all replica tablets in a shard, after they reach a given replication position (empty pos means immediate).

In general, we don't always expect all replicas to be ready to reload, and the periodic schema reload makes them self-healing anyway. So we do this on a best-effort basis, and log warnings for any tablets that fail to reload within the context deadline.

func SchemaMigrationStatusName added in v0.18.0

func SchemaMigrationStatusName(status vtctldatapb.SchemaMigration_Status) string

SchemaMigrationStatusName returns the text-based form of the status.

func SchemaMigrationStrategyName added in v0.18.0

func SchemaMigrationStrategyName(strategy vtctldatapb.SchemaMigration_Strategy) string

SchemaMigrationStrategyName returns the text-based form of the strategy.

Types

type MarshallableSchemaMigration added in v0.18.0

type MarshallableSchemaMigration vtctldatapb.SchemaMigration

func (*MarshallableSchemaMigration) MarshalResult added in v0.18.0

func (t *MarshallableSchemaMigration) MarshalResult() (*sqltypes.Result, error)

type MarshallableSchemaMigrations added in v0.18.0

type MarshallableSchemaMigrations []*vtctldatapb.SchemaMigration

func (MarshallableSchemaMigrations) MarshalResult added in v0.18.0

func (ts MarshallableSchemaMigrations) MarshalResult() (*sqltypes.Result, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL