Skip to content
This repository was archived by the owner on Dec 16, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
ccf9ef2
Do not reuse a consul lock
Nov 8, 2018
670647b
rework vtgate's vschema_manager to use topotools.RebuildVschema
demmer Nov 24, 2018
94cb4af
add a -dry_run flag to vtctl ApplyVschema
demmer Nov 24, 2018
6acad1d
move the vschema ddl implementation into a new topotools helper
demmer Nov 24, 2018
2682687
add vtctl support to alter vschema using sql statements
demmer Nov 24, 2018
1d274cf
set the sharded bit when creating the first vindex in a keyspace
demmer Nov 24, 2018
54f2192
fix vschema test expectations
demmer Nov 26, 2018
1b0db07
change parameter to -dry-run for consistency
demmer Nov 29, 2018
17af5ea
update doc strings as suggested in pr review
demmer Nov 29, 2018
ea1e126
rework and clean up the implementation as suggested in PR feedback
demmer Nov 29, 2018
e47bed0
revert change to use topotools.RebuildVSchema in the executor
demmer Dec 3, 2018
1a50a4d
config: rm secure_file_priv & innodb_support_xa
derekperkins Dec 4, 2018
9358393
stop using NFS for synced folders, put a comment explaining why
brirams Dec 5, 2018
fb8c46f
Merge pull request #4424 from tinyspeck/brirams/remote_nfs_from_vagra…
demmer Dec 6, 2018
3b2294b
Merge pull request #4385 from tinyspeck/vtctl-support-vschema-ddls
sougou Dec 6, 2018
5fba41f
adapt helm example to run locally
deepthi Dec 6, 2018
54299e3
adapt helm example to run locally
deepthi Dec 6, 2018
1b83bf3
remove unused scripts
deepthi Dec 6, 2018
f2118cc
Merge pull request #4427 from planetscale/ds-local-example
sougou Dec 6, 2018
e2ffdb2
add descriptive comments to scripts, add etcd option, set MYSQL_FLAVO…
deepthi Dec 6, 2018
c16933e
remove unused files, add sql scripts to show intermediate and final r…
deepthi Dec 7, 2018
66426a9
add back files required for test
deepthi Dec 7, 2018
8ea642d
change the vschema ddl syntax to use `alter vschema ...`
demmer Dec 1, 2018
ae79ffd
update the show syntax to match the vschema ddl changes
demmer Dec 1, 2018
b55d155
add vschema ddl syntax to add/remove tables from unsharded keyspaces
demmer Dec 3, 2018
06cb4f4
use auth=none for vtgate, move sql scripts to common location
deepthi Dec 7, 2018
2be922a
add mysql helper script to local example, remove calls to mysql from …
deepthi Dec 7, 2018
0ccc3b9
codeclimate fix
deepthi Dec 7, 2018
d97a194
shellcheck fixes
deepthi Dec 7, 2018
b3a9459
Calls Unlock explicitly after potetiantly losing it
Dec 7, 2018
dc2cbe0
Fix typo in comment
Dec 7, 2018
74c80dd
Add scope to oauth token for gcs backup storage client
Santiclause Dec 7, 2018
2a95023
Merge pull request #4429 from planetscale/ds-add-to-example
sougou Dec 8, 2018
eccf912
Merge pull request #4412 from tinyspeck/vschema-alter-syntax
sougou Dec 8, 2018
8e64c77
Merge pull request #4353 from tinyspeck/fix-for-consul-master-election
demmer Dec 8, 2018
ecb972f
Merge pull request #4433 from Santiclause/gcs-backup-scope
derekperkins Dec 8, 2018
841e07c
Adds removed vschema
Dec 8, 2018
8c567f7
Merge pull request #4419 from derekperkins/remove-mycnf
sougou Dec 9, 2018
73b3e4a
helm: add missing default
sougou Dec 9, 2018
43aa7e9
Merge pull request #4437 from planetscale/ss-default
sougou Dec 9, 2018
c009ca7
local example: fix typos
sougou Dec 9, 2018
7f0ee4c
Merge pull request #4434 from tinyspeck/add-vschema-local-examples
sougou Dec 9, 2018
4f192d1
Merge pull request #4438 from planetscale/ss-local-fix
sougou Dec 9, 2018
7ec016d
Allow subclasses of GrpcClientFactory to modify channel builder
Dec 9, 2018
be97451
Merge pull request #4439 from smourachov/grpc-java-allow-modify-chann…
demmer Dec 10, 2018
e508130
Parents the parent pom of the standard sonatype oss pom for better de…
mpawliszyn Dec 12, 2018
84a3524
Merge pull request #4447 from mpawliszyn/mikepaw.better-maven-defaults
mpawliszyn Dec 12, 2018
8d93fe9
java: Bump SNAPSHOT version to 3.1.0-SNAPSHOT after Vitess release 3.0.
mpawliszyn Dec 13, 2018
eb5a5e0
Merge pull request #4453 from mpawliszyn/mikepaw.update-snapshot
mpawliszyn Dec 13, 2018
55a4edd
Merge remote-tracking branch 'upstream/master' into setassociative-me…
Dec 14, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,13 @@ Vagrant.configure("2") do |config|
# Demo Appp
config.vm.network "forwarded_port", guest: 8000, host: 8000 # http

# If possible, use nfs, this gives a good boost to IO operations in the VM.
# if you run into with nfs, just remove this from the synced folder

config.vm.synced_folder ".", "/vagrant/src/vitess.io/vitess", type: "nfs"
# N.B. It's possible to use NFS to help speed up IO operations in the VM but
# some OSX users have reported issues running govendor with it enabled.
# Additional details in https://github.com/vitessio/vitess/issues/4396
#
# To enable, use:
# config.vm.synced_folder ".", "/vagrant/src/vitess.io/vitess", type: "nfs"
config.vm.synced_folder ".", "/vagrant/src/vitess.io/vitess"

config.vm.provider :virtualbox do |vb|
vb.name = "vitess"
Expand Down
2 changes: 0 additions & 2 deletions config/mycnf/master_mysql56.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ gtid_mode = ON
log_bin
log_slave_updates
enforce_gtid_consistency
secure_file_priv = NULL
innodb_support_xa = 0

# Crash-safe replication settings.
master_info_repository = TABLE
Expand Down
3 changes: 3 additions & 0 deletions doc/vtctlReference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1119,8 +1119,11 @@ Applies the VTGate routing schema to the provided keyspace. Shows the result aft
| :-------- | :--------- | :--------- |
| cells | string | If specified, limits the rebuild to the cells, after upload. Ignored if skipRebuild is set. |
| skip_rebuild | Boolean | If set, do no rebuild the SrvSchema objects. |
| dry-run | Boolean | Shows the proposed change without executing it |
| vschema | string | Identifies the VTGate routing schema |
| vschema_file | string | Identifies the VTGate routing schema file |
| sql | string | Identifies a VSchema DDL SQL statement |
| sql_file | string | Identifies a VSchema DDL SQL statement |


#### Arguments
Expand Down
12 changes: 12 additions & 0 deletions examples/common/insert_commerce_data.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
insert into customer(email) values('alice@domain.com');
insert into customer(email) values('bob@domain.com');
insert into customer(email) values('charlie@domain.com');
insert into customer(email) values('dan@domain.com');
insert into customer(email) values('eve@domain.com');
insert into product(sku, description, price) values('SKU-1001', 'Monitor', 100);
insert into product(sku, description, price) values('SKU-1002', 'Keyboard', 30);
insert into corder(customer_id, sku, price) values(1, 'SKU-1001', 100);
insert into corder(customer_id, sku, price) values(2, 'SKU-1002', 30);
insert into corder(customer_id, sku, price) values(3, 'SKU-1002', 30);
insert into corder(customer_id, sku, price) values(4, 'SKU-1002', 30);
insert into corder(customer_id, sku, price) values(5, 'SKU-1002', 30);
8 changes: 8 additions & 0 deletions examples/common/select_commerce_data.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
\! echo 'Using commerce/0'
use commerce/0;
\! echo 'Customer'
select * from customer;
\! echo 'Product'
select * from product;
\! echo 'COrder'
select * from corder;
6 changes: 6 additions & 0 deletions examples/common/select_customer-80_data.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
\! echo 'Using customer/-80'
use customer/-80;
\! echo 'Customer'
select * from customer;
\! echo 'COrder'
select * from corder;
6 changes: 6 additions & 0 deletions examples/common/select_customer0_data.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
\! echo 'Using customer/0'
use customer/0;
\! echo 'Customer'
select * from customer;
\! echo 'COrder'
select * from corder;
6 changes: 6 additions & 0 deletions examples/common/select_customer80-_data.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
\! echo 'Using customer/80-'
use customer/80-;
\! echo 'Customer'
select * from customer;
\! echo 'COrder'
select * from corder;
51 changes: 51 additions & 0 deletions examples/local/101_initial_cluster.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/bin/bash

# Copyright 2018 The Vitess Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# this script brings up zookeeper and all the vitess components
# required for a single shard deployment.

set -e

# shellcheck disable=SC2128
script_root=$(dirname "${BASH_SOURCE}")

# start topo server
if [ "${TOPO}" = "etcd2" ]; then
CELL=zone1 "$script_root/etcd-up.sh"
else
CELL=zone1 "$script_root/zk-up.sh"
fi

# start vtctld
CELL=zone1 "$script_root/vtctld-up.sh"

# start vttablets for keyspace commerce
CELL=zone1 KEYSPACE=commerce UID_BASE=100 "$script_root/vttablet-up.sh"
sleep 15

# set one of the replicas to master
./lvtctl.sh InitShardMaster -force commerce/0 zone1-100

# create the schema
./lvtctl.sh ApplySchema -sql-file create_commerce_schema.sql commerce

# create the vschema
./lvtctl.sh ApplyVSchema -vschema_file vschema_commerce_initial.json commerce

# start vtgate
CELL=zone1 "$script_root/vtgate-up.sh"

disown -a
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Copyright 2017 Google Inc.
# Copyright 2018 The Vitess Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -14,11 +14,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# This is an example script that stops the mysqld and vttablet instances
# created by sharded-vttablet-up.sh
# this script creates a new keyspace in preparation for vertical resharding

script_root=`dirname "${BASH_SOURCE}"`
set -e

UID_BASE=200 $script_root/vttablet-down.sh "$@"
UID_BASE=300 $script_root/vttablet-down.sh "$@"
./lvtctl.sh CreateKeyspace -served_from='master:commerce,replica:commerce,rdonly:commerce' customer

disown -a
33 changes: 33 additions & 0 deletions examples/local/202_customer_tablets.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

# Copyright 2018 The Vitess Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# this script creates the tablets and initializes them for vertical
# resharding it also splits the vschema between the two keyspaces
# old (commerce) and new (customer)

set -e

# shellcheck disable=SC2128
script_root=$(dirname "${BASH_SOURCE}")

CELL=zone1 KEYSPACE=customer UID_BASE=200 "$script_root/vttablet-up.sh"
sleep 15
./lvtctl.sh InitShardMaster -force customer/0 zone1-200
./lvtctl.sh CopySchemaShard -tables customer,corder commerce/0 customer/0
./lvtctl.sh ApplyVSchema -vschema_file vschema_commerce_vsplit.json commerce
./lvtctl.sh ApplyVSchema -vschema_file vschema_customer_vsplit.json customer

disown -a
38 changes: 38 additions & 0 deletions examples/local/203_vertical_split.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

# Copyright 2018 The Vitess Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# this script copies over all the data from commerce keyspace to
# customer keyspace for the customer and corder tables

set -e

# shellcheck disable=SC2128
script_root=$(dirname "${BASH_SOURCE}")

# shellcheck source=./env.sh
# shellcheck disable=SC1091
source "$script_root/env.sh"

# shellcheck disable=SC2086
"$VTROOT"/bin/vtworker \
$TOPOLOGY_FLAGS \
-cell zone1 \
-log_dir "$VTDATAROOT"/tmp \
-alsologtostderr \
-use_v3_resharding_mode \
VerticalSplitClone -min_healthy_rdonly_tablets=1 -tables=customer,corder customer/0

disown -a
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Copyright 2017 Google Inc.
# Copyright 2018 The Vitess Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -14,16 +14,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# This is an example script that creates a sharded vttablet deployment.
# this script migrates traffic for the new customer keyspace to the new
# tablets of types rdonly and replica

set -e

script_root=`dirname "${BASH_SOURCE}"`

# Shard -80 contains all entries whose keyspace ID has a first byte < 0x80.
# See: http://vitess.io/overview/concepts/#keyspace-id
SHARD=-80 UID_BASE=200 $script_root/vttablet-up.sh "$@"

# Shard 80- contains all entries whose keyspace ID has a first byte >= 0x80.
SHARD=80- UID_BASE=300 $script_root/vttablet-up.sh "$@"
./lvtctl.sh MigrateServedFrom customer/0 rdonly
./lvtctl.sh MigrateServedFrom customer/0 replica

disown -a
24 changes: 24 additions & 0 deletions examples/local/205_vertical_migrate_master.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

# Copyright 2018 The Vitess Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# this script migrates master traffic for the customer keyspace to the
# new master tablet

set -e

./lvtctl.sh MigrateServedFrom customer/0 master

disown -a
27 changes: 27 additions & 0 deletions examples/local/206_clean_commerce.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

# Copyright 2018 The Vitess Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# this script removes the customer and corder tables from the commerce
# keyspace

set -e

./lvtctl.sh ApplySchema -sql-file drop_commerce_tables.sql commerce
./lvtctl.sh SetShardTabletControl -blacklisted_tables=customer,corder -remove commerce/0 rdonly
./lvtctl.sh SetShardTabletControl -blacklisted_tables=customer,corder -remove commerce/0 replica
./lvtctl.sh SetShardTabletControl -blacklisted_tables=customer,corder -remove commerce/0 master

disown -a
30 changes: 30 additions & 0 deletions examples/local/301_customer_sharded.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

# Copyright 2018 The Vitess Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# this script creates vitess sequences for the auto_increment fields
# and alters the fields to no longer be auto_increment in preparation
# for horizontal sharding
# it also changes the customer vschema from unsharded to sharded and
# sets up the necessary vindexes

set -e

./lvtctl.sh ApplySchema -sql-file create_commerce_seq.sql commerce
./lvtctl.sh ApplyVSchema -vschema_file vschema_commerce_seq.json commerce
./lvtctl.sh ApplySchema -sql-file create_customer_sharded.sql customer
./lvtctl.sh ApplyVSchema -vschema_file vschema_customer_sharded.json customer

disown -a
33 changes: 33 additions & 0 deletions examples/local/302_new_shards.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

# Copyright 2018 The Vitess Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# this script brings up new tablets for the two new shards that we will
# be creating in the customer keyspace and copies the schema

set -e

# shellcheck disable=SC2128
script_root=$(dirname "${BASH_SOURCE}")

SHARD=-80 CELL=zone1 KEYSPACE=customer UID_BASE=300 "$script_root/vttablet-up.sh"
SHARD=80- CELL=zone1 KEYSPACE=customer UID_BASE=400 "$script_root/vttablet-up.sh"
sleep 15
./lvtctl.sh InitShardMaster -force customer/-80 zone1-300
./lvtctl.sh InitShardMaster -force customer/80- zone1-400
./lvtctl.sh CopySchemaShard customer/0 customer/-80
./lvtctl.sh CopySchemaShard customer/0 customer/80-

disown -a
Loading