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
172 commits
Select commit Hold shift + click to select a range
4eea157
Keep track of QueryStats in the QueryEngine instead of the TabletPlan…
zmagg Jul 9, 2018
ef35d38
golint
zmagg Jul 19, 2018
3bd111e
silently ignore certain unsupported metric types
demmer May 5, 2018
86de973
change the unsupported metric type case to log.Fatalf
demmer May 7, 2018
4648ded
tweak log message as per PR suggestion
demmer May 9, 2018
f29adf4
remove the unused JSONFunc stat type
demmer Jul 26, 2018
a59931c
update docs to use new proxy url in k8s example
Jul 26, 2018
03472f5
remove the unused Float stat type
demmer Jul 26, 2018
67144fc
remove the unused StringMap stat type
demmer Jul 26, 2018
a11b481
[MySQL][Conn] Recyle write buffers if allocated
Aug 4, 2018
81c29c6
restore the deprecated user-specific "dbname" flags
demmer Aug 6, 2018
eb34603
move FormatBindVariables into sqltypes
demmer Aug 5, 2018
725c40a
rework query log formatter interface to pass in io.Writer
demmer Aug 5, 2018
c4299ae
fix typo and use DeprecatedDBName properly
demmer Aug 6, 2018
f9020f0
OSX getting started docs
deepthi Aug 6, 2018
4155423
update vtexplain docs
demmer Aug 6, 2018
8b73b9c
add prometheus exporter support for FloatFunc
demmer Jul 26, 2018
fe8cbf4
Make SplitDiff parallel
Aug 8, 2018
c97f720
Adds optimistic lock when trying to find a worker during SplitDiff
Aug 9, 2018
93ca028
Reword comment for clariry
Aug 9, 2018
adeacf5
[Sqlparser] SET TRANSACTION has special semantics
Aug 9, 2018
64b6430
Address PR comments
Aug 9, 2018
a5dd722
Set the keepalive server-side enforcement policy min time, so that
zmagg Aug 10, 2018
f08a394
Change the flag name to respond to code review.
zmagg Aug 10, 2018
d563f17
Use the new variable name.
zmagg Aug 10, 2018
650d17b
Merge pull request #4120 from danieltahara/recycle-write
sougou Aug 12, 2018
aa1d579
Merge pull request #4121 from tinyspeck/restore-deprecated-dbname-flag
sougou Aug 12, 2018
1ff8c32
Merge pull request #4122 from tinyspeck/improve-query-logging-efficiency
sougou Aug 12, 2018
cd0af94
Merge pull request #4123 from planetscale/ds-update-osx-getting-start…
sougou Aug 12, 2018
57bd460
Merge pull request #4124 from vitessio/fix-vtexplain-docs
sougou Aug 12, 2018
6b4da9f
Merge pull request #4130 from tinyspeck/fix-grpcserver-ka-enforcement…
sougou Aug 12, 2018
84c1c80
Merge pull request #4128 from danieltahara/extract-set
sougou Aug 12, 2018
a1d5a98
Merge pull request #4126 from tinyspeck/make-split-diff-parallel
sougou Aug 12, 2018
0a2cf17
vreplication: change to use new _vt.vreplication
sougou Jun 18, 2018
7735ff1
vreplication: additional fields in vreplication
sougou Jun 19, 2018
1ba9dbf
vreplication: TabletManager.VReplicationCreate
sougou Jun 22, 2018
90cceaf
vreplication: try the Exec approach
sougou Jun 23, 2018
29cd0b9
vreplication: planbuilder
sougou Jun 24, 2018
1a357c6
vreplication: controller and tabletPicker
sougou Jun 25, 2018
a6d657c
vreplication: engine: Exec function
sougou Jun 26, 2018
369b1df
vreplication: binlog_player updates final state
sougou Jun 28, 2018
f63e56a
vreplication: WaitForPos functionality
sougou Jun 29, 2018
da48d56
vreplication: VReplicationWaitForPos rpc wiring
sougou Jun 29, 2018
e651c75
vreplication: start replication on Open
sougou Jun 30, 2018
4776a2c
vreplication: stats functionality
sougou Jun 30, 2018
3ebc0a0
vreplication: use new system phase 1
sougou Jul 3, 2018
2d42ee4
vreplication: address intermediate comments
sougou Jul 4, 2018
fa31ef4
vreplication: resharding tests are passing
sougou Jul 6, 2018
3fe8fa1
vreplication: tests are fixed now
sougou Jul 8, 2018
7dc5481
vreplication: more tests
sougou Jul 9, 2018
5a88777
vreplication: remove deprecated Blp code
sougou Jul 9, 2018
ffba80f
vreplication: add vtctld VReplicationExec cmd
sougou Jul 10, 2018
219cc43
vreplication: simplify MigrateServedTypes code
sougou Jul 10, 2018
0d4a929
vreplication: add polish
sougou Jul 11, 2018
6eb60f6
vreplication: fix after rebase
sougou Jul 28, 2018
7be100f
vreplication: fix review comments
sougou Aug 13, 2018
1347656
Respond to @demmer's IRL feedback to use a different locking strategy
zmagg Aug 14, 2018
202066d
Use the per-stat mutex on getters as well.
zmagg Aug 14, 2018
ac0f65f
Key QueryStats including the sql query string, to power
zmagg Aug 14, 2018
8b57180
Fix data race by acquiring read lock on the QueryStats datastructure.
zmagg Aug 14, 2018
630fbbf
vtgate planbuilder: verify same vindex
sougou Aug 14, 2018
9ab49ce
vschema: allow pins in vschema
sougou Aug 14, 2018
5f3aaae
Get the query string correctly.
zmagg Aug 14, 2018
83d309e
Merge pull request #4132 from sougou/vindex
sougou Aug 14, 2018
f825425
Add back in the query stats information to the TabletPlan.
zmagg Aug 15, 2018
125c9fe
Exclude insertId 0 from batchUpsert generatedKeys
Aug 15, 2018
b195f30
Add test case for upsert insertId 0 fix
Aug 15, 2018
76f9c60
Reuse local insertId
Aug 15, 2018
7cf87c2
Fix issue where different workflows incorrectly get flags from a diff…
Aug 15, 2018
dbc6e47
sqlparser: parse ON DELETE CASCADE and friends
dt Aug 15, 2018
6279e0e
Allow planned reparenting to work without master/avoid master flags
Aug 15, 2018
db88ff5
Do not check the obvious
Aug 15, 2018
92cc571
Merge pull request #4034 from sougou/resharding
sougou Aug 16, 2018
c3159d9
Merge pull request #4134 from sougou/pin
sougou Aug 16, 2018
52d3d14
Merge pull request #4135 from dt/ondelete
sougou Aug 16, 2018
5f69bd2
Add new property for delayed closure
Aug 10, 2018
88feb55
Close connections with delay on a timer
Aug 10, 2018
3d87627
Expose channel logId in toString
Aug 10, 2018
925bed1
Improve logged message
Aug 10, 2018
f0517ca
Fix test cases
Aug 16, 2018
e0f8b5b
Modify horizontal workflow to require explicit source and destination…
Aug 16, 2018
279d18c
[Resource Pool] Shorten critical section for register/unregister
Aug 16, 2018
c1154cf
Exporting internal changes back to open-source.
alainjobart Aug 17, 2018
228bfe8
Adds keyspace resharding workflow
Aug 17, 2018
f58872e
Merge pull request #4142 from alainjobart/export_internal_changes
michael-berlin Aug 17, 2018
e195641
Update compose example for new db users, as well as fixing up README
eeSeeGee Aug 17, 2018
99d97fb
fix errors in protobuf python generated code by regenerating
deepthi Aug 18, 2018
c17ab98
Merge pull request #4140 from danieltahara/numbered-pool
sougou Aug 19, 2018
6f79d72
Merge pull request #4143 from eeSeeGee/young.20180817.update_example
sougou Aug 19, 2018
c941a35
Merge pull request #4144 from planetscale/master
sougou Aug 19, 2018
d84e043
Code refactor, renaming for better readability
Aug 20, 2018
cce6501
Merge pull request #4137 from tinyspeck/improvements-to-workflows
sougou Aug 20, 2018
9d7888e
Merge pull request #3901 from tinyspeck/minor-prom-fixes
demmer Aug 22, 2018
620e05c
Merge pull request #4141 from HubSpot/delay-channel-closure
sougou Aug 22, 2018
eb31dd7
Allow user to enable approvals for a specific phase, not the whole pr…
Aug 22, 2018
4659a01
add support for vtexplain to override the dbname target
demmer Aug 16, 2018
78a5a74
rework the grpc callinfo to include the peer remote address
demmer Aug 23, 2018
d0ff5a9
add a callinfo implementation for the mysql server protocol
demmer Aug 23, 2018
1a3777a
[Sqlparser] Normalizer should skip TableName and ColName
Aug 23, 2018
b718782
Add new options to workflow UI
Aug 23, 2018
6d80ca8
Do not require enable approvals for workflow test
Aug 23, 2018
f57e338
Merge branch 'upstream-master' into improvements-to-workflows-v2
Aug 23, 2018
d9f7390
Merge pull request #4150 from tinyspeck/vtexplain-set-dbname
sougou Aug 24, 2018
2c7bdd4
Merge pull request #4151 from tinyspeck/grpc-peer-callinfo
sougou Aug 24, 2018
6a80713
Merge pull request #4153 from tinyspeck/mysql-server-callinfo
sougou Aug 24, 2018
24d253e
Merge pull request #4156 from danieltahara/walk-optimize
sougou Aug 24, 2018
0206024
Refactor new workflow name for clarity
Aug 24, 2018
63f9d50
Cleanup javascript and fix typo in workflow name
Aug 25, 2018
49c9d7a
Update vtctld to register new workflow correctly
Aug 25, 2018
8b99e7a
Update workflow to include CreateTime
Aug 25, 2018
abac3c7
Updates assets with latest changes
Aug 25, 2018
ad057d8
Issue #4145: fix handling of bit type to conform to mysql bit literals
deepthi Aug 25, 2018
9c1137c
Allow the option of using null values in vindex fields
eeSeeGee Aug 17, 2018
8ff0d4b
Paren around boolean statement for clarity
Aug 27, 2018
2b94401
fix expected values for rbr test
deepthi Aug 27, 2018
2f8b0a8
Add validation to assert that source/dest shards have valid input
Aug 27, 2018
b4037fc
Issue #4145: fix testcase so that problems with bit fields don't fail…
deepthi Aug 27, 2018
c7fe14d
Reshuffle things a bit for clarity
Aug 27, 2018
89ca39a
Fix per code climate
Aug 27, 2018
4eb8712
More code climate fixes
Aug 27, 2018
5a44d60
Codeclimate fixes
Aug 27, 2018
99b8939
Fix tests expected output
Aug 27, 2018
4365f6c
Improve comments and naming
Aug 28, 2018
b04e4f1
Fix potential issue with return
Aug 28, 2018
ee29a13
fix queries_test failure with new bit value handling
deepthi Aug 28, 2018
aeab657
fix queries_test failure with new bit value handling
deepthi Aug 28, 2018
7d7716d
Put back the buildAuthorized method where it used to be
zmagg Aug 28, 2018
f953193
BitValue handling in ast and analyzer
deepthi Aug 29, 2018
5660b4e
add a SIGHUP handler for reloading vttablet's table ACL file
Aug 29, 2018
9e62fd3
[go/mysql] refactor query benchmark to use RunParallel
LK4D4 Aug 29, 2018
12fd0ce
#4145 backwards compatible ascii encoding for bit literals
deepthi Aug 29, 2018
6df8b0f
improve error if topo server is not specified
demmer Aug 30, 2018
6c37b47
Better error message when topology implementation is not found
Aug 30, 2018
fc5f4de
Get rid of helper function.
zmagg Aug 30, 2018
3dde1f3
Add missing factory name in command to be executed UI log
Aug 30, 2018
86d69cc
Adds the TabletAlias to the vars page json.
mpawliszyn Aug 31, 2018
659d934
Merge pull request #4171 from mpawliszyn/mikepaw.add-tablet-alias-var
demmer Aug 31, 2018
7b67852
Merge pull request #4170 from systay/better-error-message
demmer Aug 31, 2018
16c5dd5
Merge pull request #4169 from tinyspeck/topo-server-better-error
demmer Aug 31, 2018
8a5f811
Fix error introduced in previous commit where I missed the right params
zmagg Aug 31, 2018
a000403
s/table/tableName
zmagg Aug 31, 2018
99ddf99
Fixes regression in parser
Aug 31, 2018
8ed53d3
Updates per code review
Aug 31, 2018
faa1a87
Merge pull request #4093 from tinyspeck/fix-query-counts-spikiness-mo…
sougou Sep 1, 2018
e55032e
Merge pull request #4136 from HubSpot/fix-batch-upsert-noinsert
sougou Sep 1, 2018
bac6cc7
Merge pull request #4139 from tinyspeck/planned_reparenting_tweaks
sougou Sep 1, 2018
fca9d15
Merge pull request #4157 from tinyspeck/improvements-to-workflows-v2
sougou Sep 1, 2018
9565d22
Merge pull request #4164 from slanning/vttablet_reload_acl
sougou Sep 1, 2018
02e95a8
Merge pull request #4165 from LK4D4/refactor_benchmark
sougou Sep 1, 2018
99d7f9e
Merge pull request #4172 from tinyspeck/fix-regresion-in-parser
sougou Sep 1, 2018
834412d
sqlparser: allow () following CURRENT_TIMESTAMP in column defs
dt Aug 29, 2018
333b862
sqlparser: make index names optional
dt Aug 29, 2018
3c4723b
Merge pull request #4168 from dt/current-ts-parens
sougou Sep 2, 2018
ecd4cc7
Merge pull request #4166 from dt/name-opt
sougou Sep 2, 2018
2195bd3
Fixing PID file creation and deletion
Sep 4, 2018
7c98f01
moving the check to a safer place
Sep 4, 2018
3732474
[Sqlparser] Pool the yyParserImpls
Sep 3, 2018
f70d969
Flush binary logs while reparenting
Sep 4, 2018
22d47a7
[go/mysql] use sync.Pool for write buffers
LK4D4 Aug 28, 2018
39cabb2
#4145 changes based on review
deepthi Sep 4, 2018
c7d7743
Fix unit tests
eeSeeGee Aug 29, 2018
7112454
[go/mysql] add benchmark for random query sizes
LK4D4 Sep 5, 2018
e4d51cf
Merge pull request #4162 from LK4D4/pool_write_buffers
sougou Sep 5, 2018
d273b85
Merge pull request #4179 from tinyspeck/flush-binlogs-reparent-v3
sougou Sep 5, 2018
6f8bf2b
Merge pull request #4167 from planetscale/ds-filtered-replication-bit…
sougou Sep 5, 2018
28a97fc
Merge pull request #4175 from danieltahara/parser-pool
sougou Sep 5, 2018
fd435b5
Merge pull request #4177 from github/pid-file-fix
sougou Sep 5, 2018
032dd80
Merge pull request #4146 from eeSeeGee/young.20180820.use_null_lookup
sougou Sep 5, 2018
9dd7fac
Merge pull request #4180 from LK4D4/add_random_query
sougou Sep 5, 2018
b416c1f
Merge pull request #4107 from gbird3/update-k8s-docs
sougou Sep 5, 2018
be6fe4f
#4145 changes based on review
deepthi Sep 5, 2018
791cb0c
Merge pull request #4184 from planetscale/ds-filtered-replication-bit…
sougou Sep 6, 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
2 changes: 1 addition & 1 deletion data/test/vtexplain/multi-output/options-output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ select * from user where id in (1,2,3,4,5,6,7,8)
1 ks_sharded/c0-: select * from user where id in (4, 6, 7, 8) limit 10001

----------------------------------------------------------------------
insert into user (id, name) values(2, 'bob')
insert into user (id, name) values (2, 'bob')

1 ks_sharded/c0-: begin
1 ks_sharded/c0-: insert into name_user_map(name, user_id) values ('bob', 2) /* _stream name_user_map (name user_id ) ('Ym9i' 2 ); */ /* vtgate:: keyspace_id:da8a82595aa28154c17717955ffeed8b */
Expand Down
18 changes: 18 additions & 0 deletions data/test/vtexplain/multi-output/target-output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
----------------------------------------------------------------------
select * from user where email='null@void.com'

1 ks_sharded/40-80: select * from user where email = 'null@void.com' limit 10001

----------------------------------------------------------------------
select * from user where id in (1,2,3,4,5,6,7,8)

1 ks_sharded/40-80: select * from user where id in (1, 2, 3, 4, 5, 6, 7, 8) limit 10001

----------------------------------------------------------------------
insert into user (id, name) values (2, 'bob')

1 ks_sharded/40-80: begin
1 ks_sharded/40-80: insert into user(id, name) values (2, 'bob')/* vtgate:: filtered_replication_unfriendly */
2 ks_sharded/40-80: commit

----------------------------------------------------------------------
2 changes: 1 addition & 1 deletion data/test/vtexplain/options-queries.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
select * from user where email='null@void.com';
select * from user where id in (1,2,3,4,5,6,7,8);
insert into user (id, name) values(2, 'bob');
insert into user (id, name) values (2, 'bob');
8 changes: 8 additions & 0 deletions data/test/vtexplain/target-queries.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* These are the same set of queries from "options-queries.sql" but
* are run with an explicit shard target of ks_sharded/40-80 which
* bypasses the normal v3 routing.
*/
select * from user where email='null@void.com';
select * from user where id in (1,2,3,4,5,6,7,8);
insert into user (id, name) values (2, 'bob');
2 changes: 1 addition & 1 deletion data/test/vtgate/filter_cases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -766,4 +766,4 @@
# but they refer to different things. The first reference is to the outermost query,
# and the second reference is to the the innermost 'from' subquery.
"select id2 from user uu where id in (select id from user where id = uu.id and user.col in (select col from (select id from user_extra where user_id = 5) uu where uu.user_id = uu.id))"
"unsupported: subquery and parent route to different shards"
"unsupported: UNION or subquery on different shards: vindex values are different"
5 changes: 4 additions & 1 deletion data/test/vtgate/schema_test.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"owner": "multicolvin"
},
"user_md5_index": {
"type": "hash_test"
"type": "unicode_loose_md5"
},
"music_user_map": {
"type": "lookup_test",
Expand Down Expand Up @@ -156,6 +156,9 @@
}
]
},
"pin_test": {
"pinned": "80"
},
"weird`name": {
"column_vindexes": [
{
Expand Down
20 changes: 20 additions & 0 deletions data/test/vtgate/select_cases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,26 @@
}
}

# select from pinned table
"select * from pin_test"
{
"Original": "select * from pin_test",
"Instructions": {
"Opcode": "SelectEqualUnique",
"Keyspace": {
"Name": "user",
"Sharded": true
},
"Query": "select * from pin_test",
"FieldQuery": "select * from pin_test where 1 != 1",
"Vindex": "binary",
"Values": [
"\ufffd"
]
}
}


# select from dual on sharded keyspace
"select @@session.auto_increment_increment from user.dual"
{
Expand Down
24 changes: 14 additions & 10 deletions data/test/vtgate/unsupported_cases.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Unions
"select * from user union select * from user_extra"
"unsupported: UNION on multi-shard queries"
"unsupported: UNION or subquery containing multi-shard queries"

# SET
"set a=1"
Expand Down Expand Up @@ -29,11 +29,11 @@

# union operations in subqueries (FROM)
"select * from (select * from user union all select * from user_extra) as t"
"unsupported: UNION on multi-shard queries"
"unsupported: UNION or subquery containing multi-shard queries"

# union operations in subqueries (expressions)
"select * from user where id in (select * from user union select * from user_extra)"
"unsupported: UNION on multi-shard queries"
"unsupported: UNION or subquery containing multi-shard queries"

# subquery with join primitive (expressions)
"select * from user where id in (select user.id from user join user_extra)"
Expand Down Expand Up @@ -77,11 +77,11 @@

# subquery does not depend on unique vindex of outer query
"select id from user where id in (select user_id from user_extra where user_extra.user_id = user.col)"
"unsupported: subquery does not depend on scatter outer query"
"unsupported: UNION or subquery containing multi-shard queries"

# subquery does not depend on scatter outer query
"select id from user where id in (select user_id from user_extra where user_extra.user_id = 4)"
"unsupported: subquery does not depend on scatter outer query"
"unsupported: UNION or subquery containing multi-shard queries"

# subquery depends on a cross-shard subquery
"select id from (select user.id, user.col from user join user_extra) as t where id in (select t.col from user)"
Expand All @@ -105,7 +105,7 @@

# subquery and outer query route to different shards
"select id from user where id = 5 and id in (select user_id from user_extra where user_extra.user_id = 4)"
"unsupported: subquery and parent route to different shards"
"unsupported: UNION or subquery on different shards: vindex values are different"

# last_insert_id for sharded keyspace
"select last_insert_id() from user"
Expand Down Expand Up @@ -433,7 +433,7 @@

# multi-shard union
"(select id from user union select id from music) union select 1 from dual"
"unsupported: UNION on multi-shard queries"
"unsupported: UNION or subquery containing multi-shard queries"

# multi-shard union
"select 1 from music union (select id from user union all select name from unsharded)"
Expand All @@ -445,15 +445,19 @@

# multi-shard union
"select id from user union all select id from music"
"unsupported: UNION on multi-shard queries"
"unsupported: UNION or subquery containing multi-shard queries"

# union with the same target shard because of vindex
"select * from music where id = 1 union select * from user where id = 1"
"unsupported: UNION or subquery on different shards: vindexes are different"

# union with different target shards
"select 1 from music where id = 1 union select 1 from music where id = 2"
"unsupported: UNION queries with different target shards"
"unsupported: UNION or subquery on different shards: vindex values are different"

# Union all
"select col1, col2 from user union all select col1, col2 from user_extra"
"unsupported: UNION on multi-shard queries"
"unsupported: UNION or subquery containing multi-shard queries"

"(select user.id, user.name from user join user_extra where user_extra.extra = 'asdf') union select 'b','c' from user"
"unsupported construct: SELECT of UNION is non-trivial"
Expand Down
55 changes: 18 additions & 37 deletions doc/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,45 +179,24 @@ In addition, Vitess requires the software and libraries listed below.
5. Run the following commands:

``` sh
brew install go automake libtool python git bison curl wget homebrew/versions/mysql56
brew install go automake libtool python git bison curl wget mysql56
pip install --upgrade pip setuptools
pip install virtualenv
pip install MySQL-python
pip install tox

```

6. Install Java runtime from this URL: https://support.apple.com/kb/dl1572?locale=en_US
Apple only supports Java 6. If you need to install a newer version, this link might be helpful:
[http://osxdaily.com/2015/10/17/how-to-install-java-in-os-x-el-capitan/](http://osxdaily.com/2015/10/17/how-to-install-java-in-os-x-el-capitan/)

7. The Vitess bootstrap script makes some checks for the go runtime, so it is recommended to have the following
commands in your ~/.profile or ~/.bashrc or ~/.zshrc:
6. The Vitess bootstrap script makes some checks for the go runtime, so it is recommended to have the following
commands in your ~/.profile or ~/.bashrc or ~/.zshrc or ~/.bash_profile:

``` sh
export PATH=/usr/local/opt/go/libexec/bin:$PATH
export GOROOT=/usr/local/opt/go/libexec
```

8. There is a problem with installing the enum34 Python package using pip, so the following file has to be edited:
```
/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/distutils.cfg
```

and this line:

```
prefix=/usr/local
export PATH="/usr/local/opt/mysql@5.6/bin:$PATH"
export PATH=/usr/local/go/bin:$PATH
export GOROOT=/usr/local/go
```

has to be commented out:

```
# prefix=/usr/local
```

After running the ./bootstrap.sh script from the next step, you can revert the change.

9. For the Vitess hostname resolving functions to work correctly, a new entry has to be added into the /etc/hosts file
7. For the Vitess hostname resolving functions to work correctly, a new entry has to be added into the /etc/hosts file
with the current LAN IP address of the computer (preferably IPv4) and the current hostname, which you get by
typing the 'hostname' command in the terminal.

Expand All @@ -232,38 +211,40 @@ In addition, Vitess requires the software and libraries listed below.

1. Navigate to the directory where you want to download the Vitess
source code and clone the Vitess Github repo. After doing so,
navigate to the `src/vitess.io/vitess` directory.
navigate to the `src/vitess.io/vitess` directory. For go to work
correctly, you should create a symbolic link to this inide your ${HOME}/go/src

``` sh
cd $WORKSPACE
git clone https://github.com/vitessio/vitess.git \
src/vitess.io/vitess
cd src/vitess.io/vitess
ln -s src/vitess.io ${HOME}/go/src/vitess.io
cd ${HOME}/go/src/vitess.io/vitess
```

1. Set the `MYSQL_FLAVOR` environment variable. Choose the appropriate
value for your database. This value is case-sensitive.

``` sh
export MYSQL_FLAVOR=MariaDB
# export MYSQL_FLAVOR=MariaDB
# or (mandatory for OS X)
# export MYSQL_FLAVOR=MySQL56
export MYSQL_FLAVOR=MySQL56
```

1. If your selected database installed in a location other than `/usr/bin`,
set the `VT_MYSQL_ROOT` variable to the root directory of your
MariaDB installation. For example, if MariaDB is installed in
MariaDB installation. For example, if mysql is installed in
`/usr/local/mysql`, run the following command.

``` sh
export VT_MYSQL_ROOT=/usr/local/mysql
# export VT_MYSQL_ROOT=/usr/local/mysql

# on OS X, this is the correct value:
# export VT_MYSQL_ROOT=/usr/local/opt/mysql56
export VT_MYSQL_ROOT=/usr/local/opt/mysql@5.6
```

Note that the command indicates that the `mysql` executable should
be found at `/usr/local/mysql/bin/mysql`.
be found at `/usr/local/opt/mysql@5.6/bin/mysql`.

1. Run `mysqld --version` and confirm that you
are running the correct version of MariaDB or MySQL. The value should
Expand Down
8 changes: 4 additions & 4 deletions doc/GettingStartedKubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ $ export KUBECTL=/example/path/to/google-cloud-sdk/bin/kubectl
1. **Access vtctld web UI**

To access vtctld from outside Kubernetes, use [kubectl proxy]
(http://kubernetes.io/v1.1/docs/user-guide/kubectl/kubectl_proxy.html)
(https://kubernetes.io/docs/tasks/access-kubernetes-api/http-proxy-access-api/)
to create an authenticated tunnel on your workstation:

**Note:** The proxy command runs in the foreground,
Expand All @@ -292,13 +292,13 @@ $ export KUBECTL=/example/path/to/google-cloud-sdk/bin/kubectl

You can then load the vtctld web UI on `localhost`:

http://localhost:8001/api/v1/proxy/namespaces/default/services/vtctld:web/
http://localhost:8001/api/v1/namespaces/default/services/vtctld:web/proxy

You can also use this proxy to access the [Kubernetes Dashboard]
(http://kubernetes.io/v1.1/docs/user-guide/ui.html),
(https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/),
where you can monitor nodes, pods, and services:

http://localhost:8001/ui
http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/.

1. **Use vtctlclient to send commands to vtctld**

Expand Down
48 changes: 28 additions & 20 deletions doc/VtExplain.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,42 +94,50 @@ vtexplain -shards 8 -vschema-file /tmp/vschema.json -schema-file /tmp/schema.sql
----------------------------------------------------------------------
SELECT * from users

[mainkeyspace/c0-]:
select * from users limit 10001
1 mainkeyspace/-20: select * from users limit 10001
1 mainkeyspace/20-40: select * from users limit 10001
1 mainkeyspace/40-60: select * from users limit 10001
1 mainkeyspace/60-80: select * from users limit 10001
1 mainkeyspace/80-a0: select * from users limit 10001
1 mainkeyspace/a0-c0: select * from users limit 10001
1 mainkeyspace/c0-e0: select * from users limit 10001
1 mainkeyspace/e0-: select * from users limit 10001

[mainkeyspace/-40]:
select * from users limit 10001
----------------------------------------------------------------------
```

[mainkeyspace/40-80]:
select * from users limit 10001
The output shows the sequence of queries run.

[mainkeyspace/80-c0]:
select * from users limit 10001
In this case, the query planner is a scatter query to all shards, and each line shows:

----------------------------------------------------------------------
```
(a) the logical sequence of the query
(b) the keyspace/shard
(c) the query that was executed

The fact that each query runs at time `1` shows that vitess executes these in parallel, and the `limit 10001` is automatically added as a protection against large results.

**Insert:**

```bash
vtexplain -shards 1024 -vschema-file /tmp/vschema.json -schema-file /tmp/schema.sql -replication-mode "ROW" -output-mode text -sql "INSERT INTO users (user_id, name) VALUES(1, 'john')"
vtexplain -shards 128 -vschema-file /tmp/vschema.json -schema-file /tmp/schema.sql -replication-mode "ROW" -output-mode text -sql "INSERT INTO users (user_id, name) VALUES(1, 'john')"

----------------------------------------------------------------------
INSERT INTO users (user_id, name) VALUES(1, 'john')

[mainkeyspace/22c0-2300]:
begin
insert into users_name_idx(name, user_id) values ('john', 1)
commit

[mainkeyspace/1640-1680]:
begin
insert into users(user_id, name) values (1, 'john')
commit
1 mainkeyspace/22-24: begin
1 mainkeyspace/22-24: insert into users_name_idx(name, user_id) values ('john', 1) /* vtgate:: keyspace_id:22c0c31d7a0b489a16332a5b32b028bc */
2 mainkeyspace/16-18: begin
2 mainkeyspace/16-18: insert into users(user_id, name) values (1, 'john') /* vtgate:: keyspace_id:166b40b44aba4bd6 */
3 mainkeyspace/22-24: commit
4 mainkeyspace/16-18: commit

----------------------------------------------------------------------
```

This example shows how Vitess handles an insert into a table with a secondary lookup vindex.

First, at time `1`, a transaction is opened on one shard to insert the row into the `users_name_idx` table. Then at time `2` a second transaction is opened on another shard with the actual insert into the `users` table, and finally each transaction is committed at time `3` and `4`.

**Configuration Options**

The `--shards` option specifies the number of shards to simulate. vtexplain will always allocate an evenly divided key range to each.
Expand Down
7 changes: 7 additions & 0 deletions examples/compose/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,20 @@ To start Consul(which saves the topology config), vtctld, vtgate and a few vttab
```
vitess/examples/compose$ docker-compose up -d
```
Note that the vtgate container will likely fail to start.

### Load the schema
We need to create a few tables into our new cluster. To do that, we can run the `ApplySchema` command.
```
vitess/examples/compose$ ./lvtctl.sh ApplySchema -sql "$(cat create_test_table.sql)" test_keyspace
```

### Complete starting the cluster
Now that schema has been loaded a second start will bring vtgate up as well.
```
vitess/examples/compose$ docker-compose up -d
```

### Run the client to insert and read some data
This will build and run the `client.go` file. It will insert and read data from the master and from the replica.
```
Expand Down
Loading