Skip to content

Commit

Permalink
Removing SCHEMA_UPDATE tablet type, unusued. Re-ordering existing
Browse files Browse the repository at this point in the history
types in proto3.
  • Loading branch information
alainjobart committed Oct 23, 2015
1 parent 9ab82ad commit cff02b5
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 90 deletions.
4 changes: 2 additions & 2 deletions go/cmd/vtctld/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func TestAPI(t *testing.T) {
"keyspace": "ks1",
"shard": "-80",
"key_range": {"end": "gA=="},
"type": 3
"type": 2
}`},
{"POST", "tablets/cell1-100?action=TestTabletAction", `{
"Name": "TestTabletAction",
Expand All @@ -141,7 +141,7 @@ func TestAPI(t *testing.T) {
}`},

// EndPoints
{"GET", "endpoints/cell1/ks1/-80/", `[3]`},
{"GET", "endpoints/cell1/ks1/-80/", `[2]`},
{"GET", "endpoints/cell1/ks1/-80/replica", `{
"entries": [{
"uid": 100,
Expand Down
61 changes: 29 additions & 32 deletions go/vt/proto/topodata/topodata.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 2 additions & 7 deletions go/vt/topo/tablet.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,6 @@ const (
// a potential master and don't worry about lag when reparenting.
TYPE_EXPERIMENTAL = TabletType("experimental")

// a slaved copy of the data that was serving but is now applying
// a schema change. Will go bak to its serving type after the
// upgrade
TYPE_SCHEMA_UPGRADE = TabletType("schema_apply")

// a slaved copy of the data, but offline to queries other than backup
// replication sql thread may be stopped
TYPE_BACKUP = TabletType("backup")
Expand All @@ -90,9 +85,9 @@ const (
// without changes to the replication graph
func IsTrivialTypeChange(oldTabletType, newTabletType pb.TabletType) bool {
switch oldTabletType {
case pb.TabletType_REPLICA, pb.TabletType_RDONLY, pb.TabletType_SPARE, pb.TabletType_BACKUP, pb.TabletType_EXPERIMENTAL, pb.TabletType_SCHEMA_UPGRADE, pb.TabletType_WORKER:
case pb.TabletType_REPLICA, pb.TabletType_RDONLY, pb.TabletType_SPARE, pb.TabletType_BACKUP, pb.TabletType_EXPERIMENTAL, pb.TabletType_WORKER:
switch newTabletType {
case pb.TabletType_REPLICA, pb.TabletType_RDONLY, pb.TabletType_SPARE, pb.TabletType_BACKUP, pb.TabletType_EXPERIMENTAL, pb.TabletType_SCHEMA_UPGRADE, pb.TabletType_WORKER:
case pb.TabletType_REPLICA, pb.TabletType_RDONLY, pb.TabletType_SPARE, pb.TabletType_BACKUP, pb.TabletType_EXPERIMENTAL, pb.TabletType_WORKER:
return true
}
case pb.TabletType_RESTORE:
Expand Down
2 changes: 0 additions & 2 deletions go/vt/topo/topoproto/tablet.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ var AllTabletTypes = []pb.TabletType{
pb.TabletType_BATCH,
pb.TabletType_SPARE,
pb.TabletType_EXPERIMENTAL,
pb.TabletType_SCHEMA_UPGRADE,
pb.TabletType_BACKUP,
pb.TabletType_RESTORE,
pb.TabletType_WORKER,
Expand All @@ -124,7 +123,6 @@ var SlaveTabletTypes = []pb.TabletType{
pb.TabletType_BATCH,
pb.TabletType_SPARE,
pb.TabletType_EXPERIMENTAL,
pb.TabletType_SCHEMA_UPGRADE,
pb.TabletType_BACKUP,
pb.TabletType_RESTORE,
pb.TabletType_WORKER,
Expand Down
19 changes: 9 additions & 10 deletions proto/topodata.proto
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,15 @@ message TabletAlias {
enum TabletType {
option allow_alias = true; // so we can have RDONLY and BATCH co-exist
UNKNOWN = 0; // not a valid value
MASTER = 2;
REPLICA = 3;
RDONLY = 4;
BATCH = 4;
SPARE = 5;
EXPERIMENTAL = 6;
SCHEMA_UPGRADE = 7;
BACKUP = 8;
RESTORE = 9;
WORKER = 10;
MASTER = 1;
REPLICA = 2;
RDONLY = 3;
BATCH = 3;
SPARE = 4;
EXPERIMENTAL = 5;
BACKUP = 6;
RESTORE = 7;
WORKER = 8;
}

// Tablet represents information about a running instance of vttablet.
Expand Down
45 changes: 20 additions & 25 deletions py/vtproto/topodata_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 9 additions & 10 deletions test/tablet.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,15 @@ class Tablet(object):
# this will eventually be coming from the proto3
tablet_type_value = {
'UNKNOWN': 0,
'MASTER': 2,
'REPLICA': 3,
'RDONLY': 4,
'BATCH': 4,
'SPARE': 5,
'EXPERIMENTAL': 6,
'SCHEMA_UPGRADE': 7,
'BACKUP': 8,
'RESTORE': 9,
'WORKER': 10,
'MASTER': 1,
'REPLICA': 2,
'RDONLY': 3,
'BATCH': 3,
'SPARE': 4,
'EXPERIMENTAL': 5,
'BACKUP': 6,
'RESTORE': 7,
'WORKER': 8,
}

def __init__(self, tablet_uid=None, port=None, mysql_port=None, cell=None,
Expand Down
2 changes: 0 additions & 2 deletions web/vtctld/shard.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ app.controller('ShardCtrl', function($scope, $routeParams, $timeout, $route,
{name: 'RefreshState', title: 'Refresh State', confirm: 'This will tell the tablet to re-read its topology record and adjust its state accordingly.'},
{name: 'ReloadSchema', title: 'Reload Schema', confirm: 'This will tell the tablet to refresh its schema cache by querying mysqld.'},

{name: 'ScrapTablet', title: 'Scrap', confirm: 'This will tell the tablet to remove itself from serving.'},
{name: 'ScrapTabletForce', title: 'Scrap (force)', confirm: 'This will externally remove the tablet from serving, without telling the tablet.'},
{name: 'DeleteTablet', title: 'Delete', confirm: 'This will delete the tablet record from topology.'},
];

Expand Down

0 comments on commit cff02b5

Please sign in to comment.