Documentation ¶
Overview ¶
topotools contains high level functions based on vt/topo and vt/actionnode.
Index ¶
- Variables
- func ChangeType(ts topo.Server, tabletAlias topo.TabletAlias, newType topo.TabletType, ...) error
- func ConfigureTabletHook(hk *hook.Hook, tabletAlias topo.TabletAlias)
- func RebuildShard(ts topo.Server, keyspace, shard string, options RebuildShardOptions, ...) error
- func Scrap(ts topo.Server, tabletAlias topo.TabletAlias, force bool) error
- type RebuildShardOptions
Constants ¶
This section is empty.
Variables ¶
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.
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