-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
orc: more changes #6714
Merged
Merged
orc: more changes #6714
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
431687d
orc: durability pluging initial cut
sougou cb926e9
orc: durability plugin: monitor settings
sougou 26c2dd3
orc: cross_cell durability
sougou 0863c2e
orc: improved shard locking
sougou 1059d46
orc: improved SwitchMaster
sougou f2f7b26
orc: operator support
sougou 93d7efe
orc: address review comments
sougou File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,9 +19,6 @@ | |
# Use a temporary layer for the build stage. | ||
FROM vitess/bootstrap:mariadb103 AS builder | ||
|
||
# Allows some docker builds to disable CGO | ||
ARG CGO_ENABLED=0 | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
# Allows docker builds to set the BUILD_NUMBER | ||
ARG BUILD_NUMBER | ||
|
||
|
@@ -51,6 +48,7 @@ ENV MYSQL_FLAVOR MariaDB103 | |
|
||
# Copy artifacts from builder layer. | ||
COPY --from=builder --chown=vitess:vitess /vt/install /vt | ||
COPY --from=builder --chown=vitess:vitess /vt/src/vitess.io/vitess/web/orchestrator /vt/web/orchestrator | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
|
||
# Create mount point for actual data (e.g. MySQL data dir) | ||
VOLUME /vt/vtdataroot | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2020 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. | ||
|
||
source ./env.sh | ||
|
||
# start topo server | ||
if [ "${TOPO}" = "zk2" ]; then | ||
CELL=zone1 ./scripts/zk-up.sh | ||
elif [ "${TOPO}" = "k8s" ]; then | ||
CELL=zone1 ./scripts/k3s-up.sh | ||
else | ||
CELL=zone1 ./scripts/etcd-up.sh | ||
fi | ||
|
||
# start vtctld | ||
CELL=zone1 ./scripts/vtctld-up.sh | ||
|
||
vtctlclient AddCellInfo -root /vitess/zone2 -server_address "${ETCD_SERVER}" zone2 | ||
|
||
# start vttablets for keyspace commerce | ||
for i in 100 101 102; do | ||
CELL=zone1 TABLET_UID=$i ./scripts/mysqlctl-up.sh | ||
CELL=zone1 KEYSPACE=commerce TABLET_UID=$i ./scripts/ovttablet-up.sh | ||
done | ||
|
||
for i in 110 111; do | ||
CELL=zone2 TABLET_UID=$i ./scripts/mysqlctl-up.sh | ||
CELL=zone2 KEYSPACE=commerce TABLET_UID=$i ./scripts/ovttablet-up.sh | ||
done | ||
|
||
# set one of the replicas to master | ||
#vtctlclient InitShardMaster -force commerce/0 zone1-100 | ||
|
||
# create the schema | ||
#vtctlclient ApplySchema -sql-file create_commerce_schema.sql commerce | ||
|
||
# create the vschema | ||
#vtctlclient ApplyVSchema -vschema_file vschema_commerce_initial.json commerce | ||
|
||
# start vtgate | ||
CELL=zone1 ./scripts/vtgate-up.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#!/bin/bash | ||
shlomi-noach marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# Copyright 2020 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. | ||
|
||
source ./env.sh | ||
|
||
cell=${CELL:-'test'} | ||
keyspace=${KEYSPACE:-'test_keyspace'} | ||
shard=${SHARD:-'0'} | ||
uid=$TABLET_UID | ||
mysql_port=$[17000 + $uid] | ||
port=$[15000 + $uid] | ||
grpc_port=$[16000 + $uid] | ||
printf -v alias '%s-%010d' $cell $uid | ||
printf -v tablet_dir 'vt_%010d' $uid | ||
tablet_hostname='' | ||
printf -v tablet_logfile 'vttablet_%010d_querylog.txt' $uid | ||
|
||
tablet_type=replica | ||
if [[ "${uid: -1}" -gt 1 ]]; then | ||
tablet_type=rdonly | ||
fi | ||
|
||
echo "Starting vttablet for $alias..." | ||
# shellcheck disable=SC2086 | ||
vttablet \ | ||
$TOPOLOGY_FLAGS \ | ||
-log_dir $VTDATAROOT/tmp \ | ||
-log_queries_to_file $VTDATAROOT/tmp/$tablet_logfile \ | ||
-tablet-path $alias \ | ||
-tablet_hostname "$tablet_hostname" \ | ||
-init_keyspace $keyspace \ | ||
-init_shard $shard \ | ||
-init_tablet_type $tablet_type \ | ||
-health_check_interval 5s \ | ||
-enable_replication_reporter \ | ||
-backup_storage_implementation file \ | ||
-file_backup_storage_root $VTDATAROOT/backups \ | ||
-restore_from_backup \ | ||
-port $port \ | ||
-grpc_port $grpc_port \ | ||
-service_map 'grpc-queryservice,grpc-tabletmanager,grpc-updatestream' \ | ||
-pid_file $VTDATAROOT/$tablet_dir/vttablet.pid \ | ||
-vtctld_addr http://$hostname:$vtctld_web_port/ \ | ||
-disable_active_reparents \ | ||
> $VTDATAROOT/$tablet_dir/vttablet.out 2>&1 & | ||
|
||
# Block waiting for the tablet to be listening | ||
# Not the same as healthy | ||
|
||
for i in $(seq 0 300); do | ||
curl -I "http://$hostname:$port/debug/status" >/dev/null 2>&1 && break | ||
sleep 0.1 | ||
done | ||
|
||
# check one last time | ||
curl -I "http://$hostname:$port/debug/status" || fail "tablet could not be started!" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍