You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am doing the Vitess tutorial and I am at the MoveTable part. I am surprised to see that the VSchema is not updated after the completion of the MoveTable, and this makes the query select count(*) from customer ambiguous. I would expect all queries working before the MoveTable to also work after the MoveTable, which is the case, until I clear the routing rules. For that, I would expect the DropSources called in 205_clean_commerce.sh to update the VSchema. The steps to reproduce can be found below. Thanks for looking into this.
I am using vitess-8.0.0-7e09d0c.tar.gz.
I start the tutorial in local by running this:
mkdir ~/my-vitess-example
cd ~/my-vitess-example
. ./env
./101_initial_cluster.sh
./200_insert_commerce_data.sh
At this point, I can select-count on the three tables in the tutorial:
$ for t in product customer corder; do mysql -N -e "select count(*) from $t"; done
+---+
| 2 |
+---+
+---+
| 5 |
+---+
+---+
| 5 |
+---+
Than, I do the MoveTable, and the queries still work (I am skipping the queries in below):
But I do not like having "magic-routing", so I remove it:
$ vtctlclient GetRoutingRules
{
"rules": [
{
"fromTable": "corder",
"toTables": [
"customer.corder"
]
},
{
"fromTable": "commerce.corder",
"toTables": [
"customer.corder"
]
},
{
"fromTable": "commerce.customer",
"toTables": [
"customer.customer"
]
},
{
"fromTable": "customer",
"toTables": [
"customer.customer"
]
}
]
}
$ vtctlclient ApplyRoutingRules -rules "{}"
New RoutingRules object:
{
}
If this is not what you expected, check the input data (as JSON parsing will skip unexpected fields).
But now, two of the queries are failing:
$ for t in product customer corder; do mysql -N -e "select count(*) from $t"; done
+---+
| 2 |
+---+
ERROR 1105 (HY000) at line 1: vtgate: http://ip-172-31-40-211.us-east-2.compute.internal:15001/: ambiguous table reference: customer
ERROR 1105 (HY000) at line 1: vtgate: http://ip-172-31-40-211.us-east-2.compute.internal:15001/: ambiguous table reference: corder
I narrowed this down to the VSchemas where I think the commerce keyspace should not have tables corder and customer because they have been moved to the customer keyspace:
If I "fix" the commerce VSchema, the queries work again:
$ vtctlclient ApplyVSchema -vschema '{ "tables": { "product" : {} } }' commerce
New VSchema object:
{
"tables": {
"product": {
}
}
}
If this is not what you expected, check the input data (as JSON parsing will skip unexpected fields).
$ for t in product customer corder; do mysql -N -e "select count(*) from $t"; done
+---+
| 2 |
+---+
+---+
| 5 |
+---+
+---+
| 5 |
+---+
I would expect not needing to "fix" the VSchema of the commerce keyspace after a MoveTable.
Thanks again for looking into this.
The text was updated successfully, but these errors were encountered:
I am doing the Vitess tutorial and I am at the MoveTable part. I am surprised to see that the VSchema is not updated after the completion of the MoveTable, and this makes the query
select count(*) from customer
ambiguous. I would expect all queries working before the MoveTable to also work after the MoveTable, which is the case, until I clear the routing rules. For that, I would expect theDropSources
called in205_clean_commerce.sh
to update the VSchema. The steps to reproduce can be found below. Thanks for looking into this.I am using
vitess-8.0.0-7e09d0c.tar.gz
.I start the tutorial in local by running this:
At this point, I can select-count on the three tables in the tutorial:
Than, I do the MoveTable, and the queries still work (I am skipping the queries in below):
But I do not like having "magic-routing", so I remove it:
But now, two of the queries are failing:
I narrowed this down to the VSchemas where I think the commerce keyspace should not have tables corder and customer because they have been moved to the customer keyspace:
If I "fix" the commerce VSchema, the queries work again:
I would expect not needing to "fix" the VSchema of the commerce keyspace after a MoveTable.
Thanks again for looking into this.
The text was updated successfully, but these errors were encountered: