Skip to content

print MasterTermStartTime in ListAllTablets and show vitess_tablets#6135

Merged
deepthi merged 3 commits intovitessio:masterfrom
planetscale:ds-listtablets
May 1, 2020
Merged

print MasterTermStartTime in ListAllTablets and show vitess_tablets#6135
deepthi merged 3 commits intovitessio:masterfrom
planetscale:ds-listtablets

Conversation

@deepthi
Copy link
Copy Markdown
Collaborator

@deepthi deepthi commented Apr 30, 2020

Sample output:

$ vtctlclient ... ListAllTablets
zone1-0000000100 commerce 0 master localhost:15100 localhost:17100 [] 2020-04-30T20:30:47Z
zone1-0000000101 commerce 0 replica localhost:15101 localhost:17101 [] <null>
zone1-0000000102 commerce 0 rdonly localhost:15102 localhost:17102 [] <null>
zone1-0000000100 commerce 0 unknown localhost:15100 localhost:17100 [] 2020-05-01T04:35:35Z
zone1-0000000101 commerce 0 master localhost:15101 localhost:17101 [] 2020-05-01T04:36:47Z
zone1-0000000102 commerce 0 rdonly localhost:15102 localhost:17102 [] <null>
mysql> show vitess_tablets;
+-------+----------+-------+------------+---------+------------------+------------------+----------------------+
| Cell  | Keyspace | Shard | TabletType | State   | Alias            | Hostname         | MasterTermStartTime  |
+-------+----------+-------+------------+---------+------------------+------------------+----------------------+
| zone1 | commerce | 0     | MASTER     | SERVING | zone1-0000000100 | deepthi-ThinkPad | 2020-04-30T20:53:23Z |
| zone1 | commerce | 0     | REPLICA    | SERVING | zone1-0000000101 | deepthi-ThinkPad |                      |
| zone1 | commerce | 0     | RDONLY     | SERVING | zone1-0000000102 | deepthi-ThinkPad |                      |
+-------+----------+-------+------------+---------+------------------+------------------+----------------------+

Signed-off-by: deepthi deepthi@planetscale.com

@deepthi deepthi requested a review from sougou as a code owner April 30, 2020 20:29
@deepthi deepthi changed the title print MasterTermStartTime in ListAllTablets print MasterTermStartTime in ListAllTablets and show vitess_tablets Apr 30, 2020
@enisoc
Copy link
Copy Markdown
Member

enisoc commented May 1, 2020

I think a lot of people may have scripts that awk the output of ListAllTablets, since it's specifically documented as being "awk-friendly" and the format has been stable for many years. If we change existing columns like this, we should make sure to surface this as an "action required" release note, if not a breaking change.

Alternatively, if we add new info as additional columns at the end, it should be backwards-compatible. Is there a reason we didn't want to do that?

@deepthi
Copy link
Copy Markdown
Collaborator Author

deepthi commented May 1, 2020

I think a lot of people may have scripts that awk the output of ListAllTablets, since it's specifically documented as being "awk-friendly" and the format has been stable for many years. If we change existing columns like this, we should make sure to surface this as an "action required" release note, if not a breaking change.

Alternatively, if we add new info as additional columns at the end, it should be backwards-compatible. Is there a reason we didn't want to do that?

Good point. The only reason for the chosen format was to keep the timestamp close to the tablet_type. We can change it and move it to the end.

ListShardTablets. In case of an old master, we replace the timestamp
displayed with "defunct".
Also show MasterTermStartTime in output of "show vitess_tablets" from
vtgate.

Signed-off-by: deepthi <deepthi@planetscale.com>
deepthi added 2 commits April 30, 2020 21:41
… output

Signed-off-by: deepthi <deepthi@planetscale.com>
Signed-off-by: deepthi <deepthi@planetscale.com>
@deepthi deepthi merged commit 9fe7fd3 into vitessio:master May 1, 2020
@deepthi deepthi deleted the ds-listtablets branch May 1, 2020 15:20
@deepthi deepthi added this to the v7.0 milestone Jul 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants