topotools

package
v0.0.0-...-4754828 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2014 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

topotools contains high level functions based on vt/topo and vt/actionnode.

Index

Constants

This section is empty.

Variables

View Source
var UseSrvShardLocks = flag.Bool("use_srv_shard_locks", false, "If true, takes the SrvShard lock for each shard being rebuilt")

UseSrvShardLocks is a temporary flag. Once tested and rolled out, it will be defaulted to true, and removed.

Functions

func ChangeType

func ChangeType(ts topo.Server, tabletAlias topo.TabletAlias, newType topo.TabletType, health map[string]string, runHooks bool) error

ChangeType changes the type of the tablet and possibly also updates the health informaton for it. Make this external, since these transitions need to be forced from time to time.

- if health is nil, we don't touch the Tablet's Health record. - if health is an empty map, we clear the Tablet's Health record. - if health has values, we overwrite the Tablet's Health record.

func ConfigureTabletHook

func ConfigureTabletHook(hk *hook.Hook, tabletAlias topo.TabletAlias)

ConfigureTabletHook configures the right parameters for a hook running locally on a tablet.

func RebuildShard

func RebuildShard(ts topo.Server, keyspace, shard string, options RebuildShardOptions, timeout time.Duration, interrupted chan struct{}) error

Update shard file with new master, replicas, etc.

Re-read from TopologyServer to make sure we are using the side effects of all actions.

This function should only be used with an action lock on the shard - otherwise the consistency of the serving graph data can't be guaranteed.

func Scrap

func Scrap(ts topo.Server, tabletAlias topo.TabletAlias, force bool) error

Scrap will update the tablet type to 'Scrap', and remove it from the serving graph.

'force' means we are not on the tablet being scrapped, so it is probably dead. So if 'force' is true, we will also remove pending remote actions. And if 'force' is false, we also run an optional hook.

Types

type RebuildShardOptions

type RebuildShardOptions struct {
	// Cells that should be rebuilt. If nil, rebuild in all cells.
	Cells []string
	// It is OK to ignore ErrPartialResult (which may mean
	// that some cell is unavailable).
	IgnorePartialResult bool
}

RebuildShardOptions are options for rebuildShard

Jump to

Keyboard shortcuts

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