vitessio / vitess

Vitess is a database clustering system for horizontal scaling of MySQL.
http://vitess.io
Apache License 2.0
18.18k stars 2.06k forks source link

Bug Report: VTCombo does not create VSchema in topo #16088

Open brendar opened 3 weeks ago

brendar commented 3 weeks ago

Overview of the Issue

After starting a keyspace with vtcombo/vttestserver I would expect to be able to get the VSchema for that keyspace, but attempting to do so will result in a node doesn't exist error.

Reproduction Steps

Terminal 1

vttestserver --keyspaces "foo" --num_shards 1

Terminal 2:

vtctldclient --server 127.0.0.1:11151 GetVSchema foo
E0610 13:30:19.281856   86894 main.go:56] rpc error: code = Unknown desc = node doesn't exist: keyspaces/foo/VSchema

Binary Version

Impacts main and previous releases

Operating System and Environment details

n/a

Log Fragments

No response

mattlord commented 3 days ago

Confirmed on main:

❯ make build
Tue Jul 2 14:25:24 EDT 2024: Building source tree

❯ vttestserver --keyspaces "foo" --num_shards 1
...
{"bind_address":"localhost","grpc_port":20902,"mysql":20903,"port":20901,"socket":"/opt/vtdataroot/vttest143063516/vt_0000000001/mysql.sock","vtcombo_mysql_port":20904}

❯ vtctldclient --server localhost:20902 GetVSchema foo
E0702 14:30:00.733294   76503 main.go:56] rpc error: code = Unknown desc = node doesn't exist: keyspaces/foo/VSchema

❯ vtctldclient --server localhost:20902 ApplyVSchema --vschema="{}" foo
New VSchema object:
{
  "sharded": false,
  "vindexes": {},
  "tables": {},
  "require_explicit_routing": false,
  "foreign_key_mode": "unspecified",
  "multi_tenant_spec": null
}
If this is not what you expected, check the input data (as JSON parsing will skip unexpected fields).

❯ vtctldclient --server localhost:20902 GetVSchema foo
{
  "sharded": false,
  "vindexes": {},
  "tables": {},
  "require_explicit_routing": false,
  "foreign_key_mode": "unspecified",
  "multi_tenant_spec": null
}
brendar commented 2 days ago

Thanks for confirming @mattlord. There's a PR here if you get a chance to look at it: https://github.com/vitessio/vitess/pull/16094