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

Fixes vttestserver to work with sharded keyspaces #7617

Merged
merged 3 commits into from
Mar 5, 2021

Conversation

GuptaManan100
Copy link
Member

@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

Copy link
Member

@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.

docker/vttestserver/setupVschemaFolder.sh Outdated Show resolved Hide resolved
docker/vttestserver/Dockerfile.mysql57 Outdated Show resolved Hide resolved
docker/vttestserver/Dockerfile.mysql80 Outdated Show resolved Hide resolved
Signed-off-by: GuptaManan100 <[email protected]>
@GuptaManan100
Copy link
Member Author

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

@deepthi
Copy link
Member

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.

Copy link
Member

@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
Member 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