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

Inclusive Naming: fix aya example and orc_test.sh #8941

Merged
merged 2 commits into from
Oct 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 8 additions & 10 deletions examples/are-you-alive/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ This client application:
1. Measures all the important things:
- Client connection errors
- Write latency
- Read latency from masters
- Read latency from primaries
- Read latency from replicas
- Write errors
- Read errors on masters
- Read errors on primaries
- Write errors on replicas
- Errors in other operations on masters and replicas (e.g. COUNT)
- Latency on other operations on masters and replicas (e.g. COUNT)
- Errors in other operations on primaries and replicas (e.g. COUNT)
- Latency on other operations on primaries and replicas (e.g. COUNT)
- Data loss (by writing predictable data and testing for that)
1. Reports all these metrics to Prometheus.

Expand All @@ -35,8 +35,8 @@ That's it!

First, [initialize your database with the correct schemas](schemas/README.md).

Run `are-you-alive --help` for usage. You can us the command line flags to
control the dataset size, whether to target reads at masters and replicas, your
Run `are-you-alive --help` for usage. You can use the command line flags to
control the dataset size, whether to target reads at primaries and replicas, your
mysql connection string, and the rate at which to send requests.

Example:
Expand Down Expand Up @@ -75,10 +75,8 @@ exported.

## Test Specific Tablet Types

See [this vitess
documentation](https://vitess.io/docs/user-guides/faq/#how-do-i-choose-between-master-vs-replica-for-queries)
for how to target specific tablet types. In the configuration file you'll want
to, for example, put "@master" or "@replica" on the ends of your connection
Queries can target specific tablet types. In the configuration file you simply
need to, for example, put "@primary" or "@replica" on the ends of your connection
strings.

## Push to Registry
Expand Down
2 changes: 1 addition & 1 deletion examples/are-you-alive/cmd/are-you-alive/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ var (
prometheusMetricsAddress = flag.String(
"prometheus_metrics_address", ":8080", "Address on which to serve prometheus metrics")
debug = flag.Bool("debug", false, "Enable debug logging")
useVtgate = flag.Bool("vtgate", false, "Using vtgate (for @master and @replica)")
useVtgate = flag.Bool("vtgate", false, "Using vtgate (for @primary and @replica)")
initialize = flag.Bool("initialize", false, "Initialize database (for testing)")
datasetSize = flag.Int("dataset_size", 10, "Number of total records in database")
endpointsConfigFilename = flag.String("endpoints_config", "", "Endpoint and load configuration.")
Expand Down
1 change: 1 addition & 0 deletions examples/are-you-alive/pkg/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ func ParseDBName(connectionString string) string {
// See https://vitess.io/docs/faq/queries/ for where these come from.
func ParseTabletType(connectionString string) string {
databaseName := ParseDBName(connectionString)
// for backwards compatibility
if strings.HasSuffix(databaseName, "@master") {
return "primary"
} else if strings.HasSuffix(databaseName, "@primary") {
Expand Down
3 changes: 0 additions & 3 deletions examples/local/orc_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ for i in 110 111; do
CELL=zone2 KEYSPACE=commerce TABLET_UID=$i ./scripts/ovttablet-up.sh
done

# set one of the replicas to primary
#vtctlclient InitShardMaster -force commerce/0 zone1-100
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be replaced with a (commented-out 😂) InitShardPrimary call?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't think it was necessary since vtorc is supposed to automatically elect a primary.


# create the schema
#vtctlclient ApplySchema -sql-file create_commerce_schema.sql commerce

Expand Down