Skip to content

Fix for refreshing schema after update#3574

Merged
sougou merged 2 commits intovitessio:masterfrom
tinyspeck:fix-for-topo
Jan 23, 2018
Merged

Fix for refreshing schema after update#3574
sougou merged 2 commits intovitessio:masterfrom
tinyspeck:fix-for-topo

Conversation

@rafael
Copy link
Copy Markdown
Member

@rafael rafael commented Jan 23, 2018

Description

I think there was a bug introduced in 3539 where after updating a vschema, vtgate is not properly updating it's version of it.

Steps to reproduce

  1. Add a new table schema to a keyspace with:
vtctlclient ApplyVSchema -vschema_file schema-file keyspace
  1. Updated schema is not shown in /debug/vschema and vtgate can't issue queries to that table.

After some debugging, I noticed that the callback was always passing nil in the changes and the vschema doesn't get updated.

This PR fixes this and seems to be working as expected. However, not sure if I'm missing something and nil here is needed.

@derekperkins
Copy link
Copy Markdown
Member

This is likely the cause of #3567

@alainjobart
Copy link
Copy Markdown
Contributor

Ouch I'm sorry about that...

Looking at the test, we have a test case for this, except the test is broken: can you also change resilient_server_test.go line 239 from 'ks1' to 'ks2', so the value we try to update is actually different? With that test change, it fails, and with your fix, it passes as it should... Thanks!

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.

6 participants