Skip to content

Fixes vttestserver to work with sharded keyspaces#7617

Merged
deepthi merged 3 commits intovitessio:masterfrom
planetscale:fix-vttestserver
Mar 5, 2021
Merged

Fixes vttestserver to work with sharded keyspaces#7617
deepthi merged 3 commits intovitessio:masterfrom
planetscale:fix-vttestserver

Conversation

@GuptaManan100
Copy link
Contributor

@GuptaManan100 GuptaManan100 commented Mar 5, 2021

Description

Adds vschema to the vttestserver image so that it works correcly for the sharded keyspaces too. It also authorizes all users for ddl commands

  • we need vschema_ddl_authorized_users flag to run vschema commands
  • Earlier we could setup the number of shards via num_shards flag, but we weren’t setting up the vschema which led to a wierd problem. When I ran create table t1 I got the error Keyspace does not have exactly one shard: [0xc000513100 0xc000513120] This happened because the vschema was not setup and the vtgate assumed that the keyspace was unsharded. This PR fixes it by setting up a minimalistic vschema whenever the number of shards are more than 1.

Related Issue(s)

Checklist

  • Should this PR be backported?
  • Tests were added or are not required Not Required
  • Documentation was added or is not required Not Required

Impacted Areas in Vitess

Components that this PR will affect:

  • Query Serving
  • VReplication
  • Cluster Management
  • Build/CI
  • VTAdmin

…ddl commands

Signed-off-by: GuptaManan100 <manan@planetscale.com>
Copy link
Collaborator

@deepthi deepthi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you feel about writing a CI test for this that runs in docker?
Right now we have a unit test (in go/cmd/vttestserver) and an endtoend test (vttest_sample). Neither of them runs in docker.

Signed-off-by: GuptaManan100 <manan@planetscale.com>
@GuptaManan100
Copy link
Contributor Author

@deepthi I can add the CI test as part of a separate PR. Could we merge this for now?

@deepthi
Copy link
Collaborator

deepthi commented Mar 5, 2021

@deepthi I can add the CI test as part of a separate PR. Could we merge this for now?

That is acceptable.

Signed-off-by: GuptaManan100 <manan@planetscale.com>
Copy link
Collaborator

@deepthi deepthi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@deepthi deepthi merged commit 61ce374 into vitessio:master Mar 5, 2021
@deepthi deepthi deleted the fix-vttestserver branch March 5, 2021 18:28
@askdba askdba added this to the v10.0 milestone Mar 10, 2021
@GuptaManan100
Copy link
Contributor Author

@deepthi Added end to end tests for the docker image in #8210

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: Build/CI Type: Enhancement Logical improvement (somewhere between a bug and feature)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants