Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show vitess_tablets is incorrect after reparenting #6292

Closed
deepthi opened this issue Jun 9, 2020 · 1 comment · Fixed by #6293
Closed

show vitess_tablets is incorrect after reparenting #6292

deepthi opened this issue Jun 9, 2020 · 1 comment · Fixed by #6293
Milestone

Comments

@deepthi
Copy link
Member

deepthi commented Jun 9, 2020

Overview of the Issue

vtgate's show vitess_tablets command does not show the timestamp for a new master.

Reproduction Steps

Run local example (101_initial_cluster.sh). Connect to vtgate.

$ mysql
mysql> show vitess_tablets;
+-------+----------+-------+------------+---------+------------------+------------------+----------------------+
| Cell  | Keyspace | Shard | TabletType | State   | Alias            | Hostname         | MasterTermStartTime  |
+-------+----------+-------+------------+---------+------------------+------------------+----------------------+
| zone1 | commerce | 0     | MASTER     | SERVING | zone1-0000000100 |<hostname redacted>| 2020-06-09T18:08:09Z |
| zone1 | commerce | 0     | REPLICA    | SERVING | zone1-0000000101 |<hostname redacted>|                      |
| zone1 | commerce | 0     | RDONLY     | SERVING | zone1-0000000102 |<hostname redacted>|                      |
+-------+----------+-------+------------+---------+------------------+------------------+----------------------+
3 rows in set (0.00 sec)

From another shell, reparent to tablet 101

$ vtctlclient PlannedReparentShard -keyspace_shard=commerce/0 -new_master=zone1-0000000101
I0609 11:14:31.899712   25100 main.go:64] I0609 18:14:31.897724 reparent.go:559] Checking replication on master-elect zone1-0000000101
I0609 11:14:31.919441   25100 main.go:64] I0609 18:14:31.919056 reparent.go:594] demote current master cell:"zone1" uid:100 
I0609 11:14:32.780261   25100 main.go:64] I0609 18:14:32.779588 reparent.go:692] populating reparent journal on new master zone1-0000000101
I0609 11:14:32.780739   25100 main.go:64] I0609 18:14:32.779916 reparent.go:675] setting new master on replica zone1-0000000102
I0609 11:14:32.780794   25100 main.go:64] I0609 18:14:32.779966 reparent.go:675] setting new master on replica zone1-0000000100

Now look at tablet status again

mysql> show vitess_tablets;
+-------+----------+-------+------------+---------+------------------+------------------+----------------------+
| Cell  | Keyspace | Shard | TabletType | State   | Alias            | Hostname         | MasterTermStartTime  |
+-------+----------+-------+------------+---------+------------------+------------------+----------------------+
| zone1 | commerce | 0     | MASTER     | SERVING | zone1-0000000101 |<hostname redacted>|                      |
| zone1 | commerce | 0     | REPLICA    | SERVING | zone1-0000000100 |<hostname redacted>| 2020-06-09T18:08:09Z |
| zone1 | commerce | 0     | RDONLY     | SERVING | zone1-0000000102 |<hostname redacted>|                      |
+-------+----------+-------+------------+---------+------------------+------------------+----------------------+
3 rows in set (0.00 sec)

Notice that tablet 101 is now MASTER but it's MasterTermStartTime is still empty.

Binary version

$ vtgate --version
Version: 945e105aa (Git branch 'master') built on Tue Jun  9 12:35:29 PDT 2020 by <redacted> using go1.13.6 linux/amd64

Operating system and Environment details

$ uname -a
Linux <hostname redacted> 4.15.0-101-generic #102-Ubuntu SMP Mon May 11 10:07:26 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
@deepthi
Copy link
Member Author

deepthi commented Jun 9, 2020

Desired output:
Before reparenting:

mysql> show vitess_tablets;
+-------+----------+-------+------------+---------+------------------+------------------+---------------------------+
| Cell  | Keyspace | Shard | TabletType | State   | Alias            | Hostname         | MasterTermStartTime       |
+-------+----------+-------+------------+---------+------------------+------------------+---------------------------+
| zone1 | commerce | 0     | MASTER     | SERVING | zone1-0000000100 |<hostname redacted>| 2020-06-09T20:41:31Z     |
| zone1 | commerce | 0     | REPLICA    | SERVING | zone1-0000000101 |<hostname redacted>|                          |
| zone1 | commerce | 0     | RDONLY     | SERVING | zone1-0000000102 |<hostname redacted>|                          |
+-------+----------+-------+------------+---------+------------------+------------------+---------------------------+
3 rows in set (0.00 sec)

After reparenting:

mysql> show vitess_tablets;
+-------+----------+-------+------------+---------+------------------+------------------+---------------------------+
| Cell  | Keyspace | Shard | TabletType | State   | Alias            | Hostname         | MasterTermStartTime       |
+-------+----------+-------+------------+---------+------------------+------------------+---------------------------+
| zone1 | commerce | 0     | MASTER     | SERVING | zone1-0000000101 |<hostname redacted>| 2020-06-09T20:43:47Z     |
| zone1 | commerce | 0     | REPLICA    | SERVING | zone1-0000000100 |<hostname redacted>|                          |
| zone1 | commerce | 0     | RDONLY     | SERVING | zone1-0000000102 |<hostname redacted>|                          |
+-------+----------+-------+------------+---------+------------------+------------------+---------------------------+
3 rows in set (0.00 sec)

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 a pull request may close this issue.

1 participant