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
143 commits
Select commit Hold shift + click to select a range
5210ead
workflow: Defined structure to track status per tasks in workflowstat…
wangyipei01 Jan 31, 2017
0e1023a
workflow: Using ParallelRunner to implement horizontal resharding
wangyipei01 Feb 2, 2017
414b051
workflow: Implemented retry action in ParallelRunner. Created
wangyipei01 Feb 10, 2017
0361c8a
workflow: commit to rebase master branch.
wangyipei01 Feb 14, 2017
ff7f20c
Adding a tlstest library to generate test certs.
alainjobart Feb 15, 2017
f0053e6
Creating and using vttlstest.
alainjobart Feb 15, 2017
385633c
Adding SSL support in mysql server.
alainjobart Feb 16, 2017
93162ba
Adding TLS support in mysql client library.
alainjobart Feb 16, 2017
3a9aefe
workflow: resolve comments. save for pull request
wangyipei01 Feb 16, 2017
2fb92cf
rebuild vschema too
bbeaudreault Feb 17, 2017
15f8c81
typo
bbeaudreault Feb 17, 2017
7c80ce5
vtgate/buffer: Fix bug that keyspaces were not logged at startup.
michael-berlin Feb 22, 2017
17c7f02
Merge pull request #2573 from HubSpot/rebuild_vschema
alainjobart Feb 22, 2017
d3bb900
vterrors: introduce vtrpcpb.Code
sougou Feb 16, 2017
9855595
vterrors: use new vtrpcpb.Code everywhere
sougou Feb 16, 2017
f91a867
vterrors: misc
sougou Feb 16, 2017
f922cac
vterrors: changed tests to use new codes
sougou Feb 18, 2017
51f3fdb
vterrors: consolidate vtgate errors
sougou Feb 19, 2017
ae7b2be
vterrors: improve retry in gateways
sougou Feb 19, 2017
c002282
vterrors: abolish TabletError
sougou Feb 20, 2017
ceaddb1
vterrors: simplify API
sougou Feb 22, 2017
6410c44
Cipher must be a legal UTF8 string.
dcadevil Feb 23, 2017
11a9804
Merge pull request #2578 from michael-berlin/buffer_log_fix
michael-berlin Feb 23, 2017
b1b0a9a
workflow: clean the design for parallelrunner and
wangyipei01 Feb 23, 2017
a4f4256
Merge branch 'master' into workflow-control
wangyipei01 Feb 23, 2017
342cdf5
Merge pull request #2495 from wangyipei01/workflow-control
michael-berlin Feb 23, 2017
aa8634e
proto: Regenerate protobuf files.
michael-berlin Feb 23, 2017
5e6eb88
Merge pull request #2584 from michael-berlin/fix_up_proto
michael-berlin Feb 23, 2017
a8e2935
vendor: Pin the Protobuf Go generator to the latest version.
michael-berlin Feb 23, 2017
e3dbc31
Merge pull request #2583 from dcadevil/master
alainjobart Feb 23, 2017
dd4fe43
Merge pull request #2585 from michael-berlin/bump_protoc_go_gen
michael-berlin Feb 23, 2017
60e76d8
Add a TLS mysqlconn -> real MySQL test.
alainjobart Feb 23, 2017
be9568f
just skip any unparseable rbr events
bbeaudreault Feb 23, 2017
61f482f
fix test
bbeaudreault Feb 23, 2017
d315c82
Merge pull request #2587 from HubSpot/ignore_rbr_errors
alainjobart Feb 23, 2017
0bdc2d2
Moved creation of topo.Server outside of tx_throttler.
erzel Feb 16, 2017
2dfccb4
Added documentation for the replication-lag-based-throttler
erzel Feb 23, 2017
b11e9f9
Merge pull request #2568 from erzel/passing_topo_server_to_tx_throttler
erzel Feb 23, 2017
4202a2d
workflow: Remove RetryController object and simplify ParallelRunner
wangyipei01 Feb 24, 2017
e3eae98
Update node.go
wangyipei01 Feb 24, 2017
bac6783
tabletserver/txthrottler: Fix bug that config update error was not ch…
michael-berlin Feb 24, 2017
05becc5
Merge pull request #2589 from wangyipei01/modify-retry
wangyipei01 Feb 24, 2017
bc76b45
Merge pull request #2590 from michael-berlin/txthrottler_always_nil
michael-berlin Feb 24, 2017
e727955
Merge pull request #2567 from alainjobart/ssl
alainjobart Feb 24, 2017
69aaae9
workflow: Modify Factory.Init to pass Manager object.
wangyipei01 Feb 24, 2017
1ff6d01
Adding interface for custom auth plugin.
alainjobart Feb 24, 2017
99076a0
Merge pull request #2591 from wangyipei01/manager-init
wangyipei01 Feb 24, 2017
ae37ea0
Ignore any IDs generated by the DB (#2576)
tirsen Feb 24, 2017
0f843d4
Fixing etcd watch versions.
alainjobart Feb 24, 2017
81ee830
etcd2topo watch fix.
alainjobart Feb 24, 2017
1d672c3
Set and test conn.User{,Name}.
alainjobart Feb 24, 2017
a8faf92
Merge pull request #2592 from alainjobart/etcd
alainjobart Feb 24, 2017
4236de7
vterrors: addres review comments (#2593)
sougou Feb 24, 2017
d1b357c
Adding clear text auth support.
alainjobart Feb 25, 2017
1b5e470
Pass MoreExecutors.directExecutor to Futures.transformAsync.
dumbunny Feb 25, 2017
dfea354
Merge pull request #2597 from dumbunny/futures
dumbunny Feb 25, 2017
96660b8
Handling missing clear text auth plugin.
alainjobart Feb 25, 2017
ab84dc8
vtgate/buffer: Fix leakage of buffer pool slots due to canceled reque…
michael-berlin Feb 26, 2017
5705d03
Merge pull request #2599 from michael-berlin/fix_buffer_leak
michael-berlin Feb 26, 2017
2fd74dc
vterrors: handle special cases (#2600)
sougou Feb 27, 2017
d222e7a
Addressing review comments.
alainjobart Feb 27, 2017
2ee53b4
Adds decoding of strings and string-like blobs based on the charset r…
bbeaudreault Jan 19, 2017
16bc66f
Linking mysql connector user to callerid.
alainjobart Feb 27, 2017
1a6c068
review comments -- fix potential DivByZero, remove unnecessary throws…
bbeaudreault Feb 27, 2017
857089d
add comment as to why we diverge from mysql-connector-j on types for …
bbeaudreault Feb 27, 2017
b7597a9
Merge pull request #2581 from erzel/adding_replication_lag_based_thro…
erzel Feb 27, 2017
2cdce28
messager: Fix a deadlock bug (#2594)
sougou Feb 27, 2017
04326af
Merge pull request #2595 from alainjobart/auth
alainjobart Feb 27, 2017
a776530
workflow: Modify the workflow library API and
wangyipei01 Feb 27, 2017
5bd6a7f
Do not return OK error code for buffer errors.
michael-berlin Feb 27, 2017
3b4f863
Merge pull request #2601 from michael-berlin/export_buffer_nil_err
michael-berlin Feb 27, 2017
626eea1
workflow: Change methods' name based on go-readability reviewer's
wangyipei01 Feb 28, 2017
678ea9f
Add flags to kubernetes guestbook app. (#2605)
thompsonja Feb 28, 2017
7306290
Merge pull request #2596 from wangyipei01/resharding-utest-manager
wangyipei01 Mar 1, 2017
29e5356
vtgate/buffer: Remove redundant "reason" from constant name.
michael-berlin Mar 1, 2017
9245b2b
vtgate/buffer: Always initialize all stat variables.
michael-berlin Mar 1, 2017
ffe34d0
Sandbox reliability updates and cleanup. (#2604)
thompsonja Mar 1, 2017
55b9bc7
Merge pull request #2608 from michael-berlin/buffer_init_vars
michael-berlin Mar 1, 2017
fe7261d
Updating the example with New Vschema format
ashudeep-sharma-zz Mar 1, 2017
9d63dc4
Making VSchema changes in sharding-kubernetes.html
ashudeep-sharma-zz Mar 1, 2017
c97d97e
Add keyspace parameter to guestbook app. (#2612)
thompsonja Mar 1, 2017
0585ada
Updating the example with New Vschema format (#2610)
ashudeep-sharma Mar 1, 2017
7c5b91a
Making the Vschema Changes to the markdown files
ashudeep-sharma-zz Mar 2, 2017
7251e3b
publish site Wed Mar 1 21:10:22 PST 2017
michael-berlin Mar 2, 2017
b0edaac
Merge pull request #2615 from Flipkart/VschemaDocFix
michael-berlin Mar 2, 2017
0fdb0cb
Makefile: fix docker build mysql56 bug
c-wind Mar 2, 2017
38ad8b3
Merge pull request #2616 from c-wind/master
michael-berlin Mar 2, 2017
70c68d6
Review comment fixes
bbeaudreault Mar 2, 2017
3937b04
travis: Stop publishing coverage to coveralls.io.
michael-berlin Mar 2, 2017
26bbcd2
Merge pull request #2548 from HubSpot/jdbc_charsets
michael-berlin Mar 2, 2017
a405923
Removed the old unused query_splitter.go and related test
erzel Mar 2, 2017
825a065
test: vtgate_buffer.py: Ttest for the varz value and not just existence.
michael-berlin Mar 2, 2017
b6d1c59
Merge pull request #2617 from michael-berlin/remove_coveralls
michael-berlin Mar 2, 2017
cffcdd1
Merge pull request #2619 from michael-berlin/vtgate_buffer_fix_export
michael-berlin Mar 2, 2017
7b1eb30
Merge pull request #2618 from erzel/removing_query_splitter
erzel Mar 2, 2017
06ab24a
update success flag
alouane Mar 2, 2017
7d78803
Merge pull request #2622 from alouane/patch-1
michael-berlin Mar 2, 2017
104bee0
Add kubernetes api server config (#2603)
davygeek Mar 3, 2017
176336a
PHP client - ProtoUtils fix after last vterrors changes (#2621)
Rastusik Mar 3, 2017
bcfaabb
java/client: Use immutable instead of interface type.
michael-berlin Mar 3, 2017
d24a3e5
java/grpc-client: Remove unused import.
michael-berlin Mar 3, 2017
9c793e2
Merge pull request #2623 from michael-berlin/export_java_fix
michael-berlin Mar 3, 2017
b60da2f
Refactors JDBC driver to parse TLS options in VitessConnection class
steve-perkins Feb 3, 2017
45e8bf2
Merge pull request #2529 from BetterCloud/jdbc-refactor
michael-berlin Mar 3, 2017
e2f97f8
WIP -- Working to support migration-scoped queries from VTGate (#2606)
bbeaudreault Mar 4, 2017
980bd64
Kubernetes sandbox reliability updates.
thompsonja Mar 7, 2017
1b10471
Exporting internal changes back to open-source. (#2627)
sougou Mar 7, 2017
7c8fa8a
Replace logging.fatal with logging.error
thompsonja Mar 7, 2017
1bd0d3c
Address comments.
thompsonja Mar 7, 2017
ba31fb5
Fix vttablet UIDs generated for helm configs.
thompsonja Mar 7, 2017
635af5a
Only perform wait_for_mysql once, not per keyspace.
thompsonja Mar 7, 2017
e7d11ff
Merge pull request #2626 from thompsonja/sandbox_updates
thompsonja Mar 8, 2017
5ade30b
Remove unused sandbox test.
thompsonja Mar 8, 2017
f9b8c35
Merge pull request #2629 from thompsonja/sandbox_updates
thompsonja Mar 8, 2017
a9e9713
Suppress output when checking for python2 binaries.
michael-berlin Mar 8, 2017
f740814
Merge pull request #2630 from michael-berlin/stop_printing_python2_bi…
michael-berlin Mar 8, 2017
1f82f98
Add charset/snapshot_file to vttest. (#2611)
thompsonja Mar 10, 2017
64eaa20
Plumbing in the schema engine for binlog server.
alainjobart Mar 1, 2017
49ff3a6
Better support for more RBR types.
alainjobart Mar 1, 2017
606d68c
Moving eventtoken.Minimum to go/sqltypes.
alainjobart Mar 8, 2017
147336e
Consolidating two cell printing methods.
alainjobart Mar 8, 2017
ce72713
Merge pull request #2607 from alainjobart/rbr
alainjobart Mar 11, 2017
58f803d
tabletserver: simplify query_engine->planbuilder
sougou Mar 11, 2017
76c8fd8
tabletserver: strictMode check moved to QueryEngine
sougou Mar 11, 2017
b9a1b1f
tabletserver: move messager to its own package
sougou Mar 12, 2017
3a7454b
tabletserver: rename messager types
sougou Mar 12, 2017
794dd7c
tabletserver: move queryrules to separate package
sougou Mar 13, 2017
cee83c2
tabletserver: protect goroutines with recover.
sougou Mar 13, 2017
07b8471
tabletserver: the big move
sougou Mar 13, 2017
0e4edf3
tabletserver: fix data race in test
sougou Mar 13, 2017
0327cf4
Splitting RBR code into own files.
alainjobart Mar 11, 2017
2f46b73
Adding float/double support.
alainjobart Mar 11, 2017
e959ccc
Adding JSON, Enum, Set, String.
alainjobart Mar 11, 2017
f67cfc6
NewDecimal support.
alainjobart Mar 11, 2017
140e9e1
Blob support, fixing string.
alainjobart Mar 11, 2017
e2e4625
geometry support.
alainjobart Mar 11, 2017
145f4d4
Changing internal API for binlogs.
alainjobart Mar 13, 2017
d88e2e5
Adding support for inserts / deletes.
alainjobart Mar 13, 2017
925addf
workflow: Implement canary feature. (#2613)
wangyipei01 Mar 15, 2017
b7420b1
Actually plumbing schema engine.
alainjobart Mar 15, 2017
f4a97f6
Adding a rbr version of vertical_split.py.
alainjobart Mar 15, 2017
4008934
Merge pull request #2636 from alainjobart/rbr
alainjobart Mar 16, 2017
ca81fda
Changing the errors SplitQuery returns to be from the vterrors package.
erzel Mar 15, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 0 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,6 @@ before_script:
script:
# Log GOMAXPROCS (should be 2 as of 07/2015).
- go run travis/log_gomaxprocs.go
# Shard 0: Run unit tests and post coverage to coveralls.io (will show up on pull request).
- |
if [[ $TEST_MATRIX = *"-shard 0"* ]]; then
go run test.go $TEST_FLAGS goveralls
fi
- |
if [[ $TRAVIS_PULL_REQUEST = "false" ]]; then
go run test.go $TEST_FLAGS $TEST_MATRIX
Expand Down
7 changes: 1 addition & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ unit_test_cover: build
unit_test_race: build
tools/unit_test_race.sh

# Run coverage and upload to coveralls.io.
# Requires the secret COVERALLS_TOKEN env variable to be set.
unit_test_goveralls: build
travis/goveralls.sh

.ONESHELL:
SHELL = /bin/bash

Expand Down Expand Up @@ -176,7 +171,7 @@ docker_base:

docker_base_mysql56:
chmod -R o=g *
docker build -f Dockerfile.percona -t vitess/base:mysql56 .
docker build -f Dockerfile.mysql56 -t vitess/base:mysql56 .

docker_base_mariadb:
chmod -R o=g *
Expand Down
2 changes: 0 additions & 2 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,6 @@ gotools=" \
honnef.co/go/unused/cmd/unused \
"

# Tools for uploading code coverage to coveralls.io (used by Travis CI).
gotools+=" github.com/modocache/gover github.com/mattn/goveralls"
# The cover tool needs to be installed into the Go toolchain, so it will fail
# if Go is installed somewhere that requires root access.
source tools/shell_functions.inc
Expand Down
1 change: 1 addition & 0 deletions config/mycnf/rbr.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
binlog-format=row
27 changes: 26 additions & 1 deletion data/test/tabletserver/ddl_cases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
"Action": "drop", "TableName": "b"
}

"drop table b.c"
{
"Action": "drop", "TableName": "b.c"
}

"alter table c alter foo"
{
"Action": "alter", "TableName": "c", "NewTable": "c"
Expand All @@ -18,16 +23,31 @@
"Action": "alter", "TableName": "c", "NewTable": "c"
}

"alter table b.c comment 'aa'"
{
"Action": "alter", "TableName": "b.c", "NewTable": "b.c"
}

"drop index a on b"
{
"Action": "alter", "TableName": "b", "NewName": "b"
}

"drop index a on b.c"
{
"Action": "alter", "TableName": "b.c", "NewName": "b.c"
}

"rename table a to b"
{
"Action": "rename", "TableName": "a", "NewTable": "b"
}

"rename table c.a to c.b"
{
"Action": "rename", "TableName": "c.a", "NewTable": "c.b"
}

"alter table a rename b"
{
"Action": "rename", "TableName": "a", "NewTable": "b"
Expand All @@ -38,12 +58,17 @@
"Action": "rename", "TableName": "a", "NewTable": "b"
}

"alter table c.a rename to c.b"
{
"Action": "rename", "TableName": "c.a", "NewTable": "c.b"
}

"create view a asdasd"
{
"Action": "create", "NewName": "a"
}

"alter view c alter foo"
"alter view c as foo"
{
"Action": "alter", "TableName": "c", "NewTable": "c"
}
Expand Down
9 changes: 9 additions & 0 deletions data/test/vtgate/unsupported_cases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@
"create table a(id int)"
"unsupported construct"

"create table a.b(id int)"
"unsupported construct"

"alter table a ADD id int"
"unsupported construct"

"alter table a.b ADD id int"
"unsupported construct"

# DBA statements
"explain select * from user"
"unsupported construct"
Expand Down
6 changes: 3 additions & 3 deletions dev.env
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ export PYTHONPATH=$(prepend_path $PYTHONPATH $VTTOP/test)
export PYTHONPATH=$(prepend_path $PYTHONPATH $VTTOP/test/cluster/sandbox)

# Ensure bootstrap and install_grpc use python2 on systems which default to python3
command -v python2 && PYTHON=python2 || PYTHON=python
command -v python2 >/dev/null && PYTHON=python2 || PYTHON=python
export PYTHON
command -v pip2 && PIP=pip2 || PIP=pip
command -v pip2 >/dev/null && PIP=pip2 || PIP=pip
export PIP
command -v virtualenv2 && VIRTUALENV=virtualenv2 || VIRTUALENV=virtualenv
command -v virtualenv2 >/dev/null && VIRTUALENV=virtualenv2 || VIRTUALENV=virtualenv
export VIRTUALENV

selenium_dist=$VTROOT/dist/selenium
Expand Down
14 changes: 7 additions & 7 deletions doc/HorizontalReshardingGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@ We do this by providing a VSchema definition as follows:

``` json
{
"Sharded": true,
"Vindexes": {
"sharded": true,
"vindexes": {
"hash": {
"Type": "hash"
"type": "hash"
}
},
"Tables": {
"tables": {
"messages": {
"ColVindexes": [
"column_vindexes": [
{
"Col": "page",
"Name": "hash"
"column": "page",
"name": "hash"
}
]
}
Expand Down
42 changes: 42 additions & 0 deletions doc/ReplicatoinLagBasedThrottlingOfTransactions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Replication Lag Based Throttling of Transactions
Vitess supports throttling of transactions based on replication lag. When this
feature is turned on, each VTTablet master monitors the replication lag from
the replicas, and based on the observed replication lag tries to rate-limit the
received transactions to keep the replication lag under a configured limit.

The decision of whether to throttle a transaction is done in the "BEGIN"
statement rather than in the "COMMIT" statement to avoid having a transaction
perform a lot of work just to eventually be throttled and potentially
rolled-back if the open-transaction timeout is exceeded.

If a BEGIN statement is throttled the client receives the gRPC UNAVAILABLE
error code.

The following VTTablet command line flags control the replication-lag based
throttler:

* *enable-tx-throttler*

A boolean flag controling whether the replication-lag-based throttling is enabled.

* *tx-throttler-config*

A text-format representation of the [throttlerdata.Configuration](https://github.com/youtube/vitess/blob/master/proto/throttlerdata.proto) protocol buffer
that contains configuration options for the throttler.
The most important fields in that message are *target_replication_lag_sec* and
*max_replication_lag_sec* that specify the desired limits on the replication lag. See the comments in the protocol definition file for more details.
If this is not specified a [default](https://github.com/youtube/vitess/blob/master/go/vt/tabletserver/tabletenv/config.go) configuration will be used.

* *tx-throttler-healthcheck-cells*

A comma separated list of datacenter cells. The throttler will only monitor
the non-RDONLY replicas found in these cells for replication lag.

# Caveats and Known Issues
* The throttler keeps trying to explore the maximum rate possible while keeping
the replication lag under the desired limit; as such the desired replication
lag limit may occasionally be slightly violated.

* Transactions are considered homegenous. There is currently no support
for specifying how "expensive" a transaction is.

14 changes: 7 additions & 7 deletions doc/ShardingKubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@ We do this by providing a VSchema definition as follows:

``` json
{
"Sharded": true,
"Vindexes": {
"sharded": true,
"vindexes": {
"hash": {
"Type": "hash"
"type": "hash"
}
},
"Tables": {
"tables": {
"messages": {
"ColVindexes": [
"column_vindexes": [
{
"Col": "page",
"Name": "hash"
"column": "page",
"name": "hash"
}
]
}
Expand Down
14 changes: 7 additions & 7 deletions docs/sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,25 @@
<loc>http://vitess.io/user-guide/horizontal-sharding.html</loc>
</url>
<url>
<loc>http://vitess.io/overview/</loc>
<loc>http://vitess.io/about/</loc>
</url>
<url>
<loc>http://vitess.io/about/</loc>
<loc>http://vitess.io/search/</loc>
</url>
<url>
<loc>http://vitess.io/terms/</loc>
<loc>http://vitess.io/overview/</loc>
</url>
<url>
<loc>http://vitess.io/</loc>
<loc>http://vitess.io/getting-started/</loc>
</url>
<url>
<loc>http://vitess.io/search/</loc>
<loc>http://vitess.io/contributing/</loc>
</url>
<url>
<loc>http://vitess.io/getting-started/</loc>
<loc>http://vitess.io/terms/</loc>
</url>
<url>
<loc>http://vitess.io/contributing/</loc>
<loc>http://vitess.io/</loc>
</url>
<url>
<loc>http://vitess.io/user-guide/introduction.html</loc>
Expand Down
14 changes: 7 additions & 7 deletions docs/user-guide/horizontal-sharding.html
Original file line number Diff line number Diff line change
Expand Up @@ -319,18 +319,18 @@ <h2 id="configure-sharding-information">Configure sharding information</h2>
<p>The first step is to tell Vitess how we want to partition the data.
We do this by providing a VSchema definition as follows:</p>
<div class="highlight"><pre><code class="language-json" data-lang="json"><span class="p">{</span>
<span class="nt">&quot;Sharded&quot;</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span>
<span class="nt">&quot;Vindexes&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;sharded&quot;</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span>
<span class="nt">&quot;vindexes&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;hash&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;Type&quot;</span><span class="p">:</span> <span class="s2">&quot;hash&quot;</span>
<span class="nt">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;hash&quot;</span>
<span class="p">}</span>
<span class="p">},</span>
<span class="nt">&quot;Tables&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;tables&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;messages&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;ColVindexes&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="nt">&quot;column_vindexes&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="nt">&quot;Col&quot;</span><span class="p">:</span> <span class="s2">&quot;page&quot;</span><span class="p">,</span>
<span class="nt">&quot;Name&quot;</span><span class="p">:</span> <span class="s2">&quot;hash&quot;</span>
<span class="nt">&quot;column&quot;</span><span class="p">:</span> <span class="s2">&quot;page&quot;</span><span class="p">,</span>
<span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;hash&quot;</span>
<span class="p">}</span>
<span class="p">]</span>
<span class="p">}</span>
Expand Down
14 changes: 7 additions & 7 deletions docs/user-guide/sharding-kubernetes.html
Original file line number Diff line number Diff line change
Expand Up @@ -315,18 +315,18 @@ <h2 id="configure-sharding-information">Configure sharding information</h2>
<p>The first step is to tell Vitess how we want to partition the data.
We do this by providing a VSchema definition as follows:</p>
<div class="highlight"><pre><code class="language-json" data-lang="json"><span class="p">{</span>
<span class="nt">&quot;Sharded&quot;</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span>
<span class="nt">&quot;Vindexes&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;sharded&quot;</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span>
<span class="nt">&quot;vindexes&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;hash&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;Type&quot;</span><span class="p">:</span> <span class="s2">&quot;hash&quot;</span>
<span class="nt">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;hash&quot;</span>
<span class="p">}</span>
<span class="p">},</span>
<span class="nt">&quot;Tables&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;tables&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;messages&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;ColVindexes&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="nt">&quot;column_vindexes&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="nt">&quot;Col&quot;</span><span class="p">:</span> <span class="s2">&quot;page&quot;</span><span class="p">,</span>
<span class="nt">&quot;Name&quot;</span><span class="p">:</span> <span class="s2">&quot;hash&quot;</span>
<span class="nt">&quot;column&quot;</span><span class="p">:</span> <span class="s2">&quot;page&quot;</span><span class="p">,</span>
<span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;hash&quot;</span>
<span class="p">}</span>
<span class="p">]</span>
<span class="p">}</span>
Expand Down
16 changes: 12 additions & 4 deletions examples/kubernetes/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,17 @@
# use cases just need KUBECTL=kubectl, we'll make that the default.
KUBECTL=${KUBECTL:-kubectl}

# Kuberentes namespace for Vitess and components.
# Kubernetes api address for $KUBECTL
# The default value is 127.0.0.1:8080
# When the Kubernetes api server is not local, We can easily access the api by edit KUBERNETES_API_SERVER's value
KUBERNETES_API_SERVER=${KUBERNETES_API_SERVER:-'127.0.0.1:8080'}

# Kubernetes namespace for Vitess and components.
VITESS_NAME=${VITESS_NAME:-'default'}

# Kubernetes options config
KUBECTL_OPTIONS="--namespace=$VITESS_NAME --server=$KUBERNETES_API_SERVER"

# CELLS should be a comma separated list of cells
# the first cell listed will become local to vtctld.
CELLS=${CELLS:-'test'}
Expand All @@ -18,7 +26,7 @@ VTCTLD_PORT=${VTCTLD_PORT:-30001}

# Get the ExternalIP of any node.
get_node_ip() {
$KUBECTL get -o template --template '{{range (index .items 0).status.addresses}}{{if eq .type "ExternalIP" "LegacyHostIP"}}{{.address}}{{end}}{{end}}' nodes --namespace=$VITESS_NAME
$KUBECTL $KUBECTL_OPTIONS get -o template --template '{{range (index .items 0).status.addresses}}{{if eq .type "ExternalIP" "LegacyHostIP"}}{{.address}}{{end}}{{end}}' nodes
}

# Try to find vtctld address if not provided.
Expand All @@ -33,7 +41,7 @@ get_vtctld_addr() {

# Find the name of a vtctld pod.
get_vtctld_pod() {
$KUBECTL get -o template --template "{{if ge (len .items) 1 }}{{(index .items 0).metadata.name}}{{end}}" -l 'app=vitess,component=vtctld' pods --namespace=$VITESS_NAME
$KUBECTL $KUBECTL_OPTIONS get -o template --template "{{if ge (len .items) 1 }}{{(index .items 0).metadata.name}}{{end}}" -l 'app=vitess,component=vtctld' pods
}

start_vtctld_forward() {
Expand All @@ -44,7 +52,7 @@ start_vtctld_forward() {
fi

tmpfile=`mktemp`
$KUBECTL port-forward -p $pod 0:15999 --namespace=$VITESS_NAME &> $tmpfile &
$KUBECTL $KUBECTL_OPTIONS port-forward -p $pod 0:15999 &> $tmpfile &
vtctld_forward_pid=$!

until [[ `cat $tmpfile` =~ :([0-9]+)\ -\> ]]; do :; done
Expand Down
6 changes: 3 additions & 3 deletions examples/kubernetes/etcd-down.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ cells=`echo $CELLS | tr ',' ' '`
# Delete replication controllers
for cell in 'global' $cells; do
echo "Stopping etcd replicationcontroller for $cell cell..."
$KUBECTL delete replicationcontroller etcd-$cell --namespace=$VITESS_NAME
$KUBECTL $KUBECTL_OPTIONS delete replicationcontroller etcd-$cell

echo "Deleting etcd service for $cell cell..."
$KUBECTL delete service etcd-$cell --namespace=$VITESS_NAME
$KUBECTL delete service etcd-$cell-srv --namespace=$VITESS_NAME
$KUBECTL $KUBECTL_OPTIONS delete service etcd-$cell
$KUBECTL $KUBECTL_OPTIONS delete service etcd-$cell-srv
done

4 changes: 2 additions & 2 deletions examples/kubernetes/etcd-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ for cell in 'global' $cells; do
echo "Creating etcd service for $cell cell..."
cat etcd-service-template.yaml | \
sed -e "s/{{cell}}/$cell/g" | \
$KUBECTL create --namespace=$VITESS_NAME -f -
$KUBECTL $KUBECTL_OPTIONS create -f -

# Expand template variables
sed_script=""
Expand All @@ -31,6 +31,6 @@ for cell in 'global' $cells; do

# Create the replication controller.
echo "Creating etcd replicationcontroller for $cell cell..."
cat etcd-controller-template.yaml | sed -e "$sed_script" | $KUBECTL create --namespace=$VITESS_NAME -f -
cat etcd-controller-template.yaml | sed -e "$sed_script" | $KUBECTL $KUBECTL_OPTIONS create -f -
done

Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ spec:
limits:
memory: "128Mi"
cpu: "100m"
args: ["--port", "{{port}}", "--cell", "{{cell}}", "--keyspace", "{{keyspace}}", "--vtgate_port", "{{vtgate_port}}"]
Loading