Skip to content
This repository was archived by the owner on Dec 16, 2022. It is now read-only.

Slack vitess 2018 10 29.r0#115

Merged
rafael merged 246 commits intomasterfrom
slack-vitess-2018-10-29.r0
Oct 29, 2018
Merged

Slack vitess 2018 10 29.r0#115
rafael merged 246 commits intomasterfrom
slack-vitess-2018-10-29.r0

Conversation

@rafael
Copy link
Copy Markdown

@rafael rafael commented Oct 29, 2018

Slack changes:

Risky/Important community PR's

Other Changes

  • We haven't synced in a while, so there are many other PR's. I think I already captured the most important ones, but if you find something that should be call out let me know.

Scott Lanning and others added 30 commits July 16, 2018 15:16
This keeps the count of connections per user.
Like MySQL, it also tracks whether the user is authenticated
or not yet ("unauthenticated user")
(that was suggested by Simon Mudd).

I'm not	sure if	it would be necessary to delete
users that go to 0 count (if there are many users),
and that isn't supported yet with vitess counters,
so I didn't bother with it.

(It looks simpler with `git diff -w`. I used an inline func/closure
to make a scope for defer connCountPerUser.Add(unauthenticatedUsername, -1)
which re-indented some code. The real changes
can mostly be seen by looking for connCountPerUser.)

Signed-off-by: Scott Lanning <scott.lanning@booking.com>
Ended up not putting "unauthenticated user" in with the others.
It's really simpler not to and, as Sougou mentioned, it can be computed.

I did add MysqlServerConnCountUnauthenticated as a NewGaugeFunc
so that it can show up in `/debug/vars`. We could also not have that
and do it from whatever reads `/debug/vars`.
I think that variable isn't reliable, since I didn't put
a mutex around all the user counts (seemed like a bad idea...).

Also added some tests. I ended up commenting out the last two,
which test the count after `c.Close()`, because they seemed to need
a little sleep and I didn't see how to test them without them
being flakey.
(I also have no idea how to test MysqlServerConnCountUnauthenticated ,
but for what it's worth verified that it shows up ephemerally
by running `curl ... /debug/vars` in a loop and throwing 1000 connections at it.)

Signed-off-by: Scott Lanning <scott.lanning@booking.com>
Signed-off-by: Michael Demmer <mdemmer@slack-corp.com>
Now when we get smaller than we want buffer from pool, we just put it
back and allocate a new one. This might be quite inefficient.
So, instead use multiple pools which always return buffers >= request
size.

Signed-off-by: Alexander Morozov <lk4d4math@gmail.com>
Just return whole query back as result

Signed-off-by: Alexander Morozov <lk4d4math@gmail.com>
[go/mysql] make query benchmarks more even to reads and writes
[go/mysql] use tiered pool for buffers to avoid false hits
Just use sync.Pool always

Signed-off-by: Alexander Morozov <lk4d4math@gmail.com>
[go/mysql] Avoid static buffer and use tiered pool in
Signed-off-by: Aaron Young <aaron.young@gmail.com>
Signed-off-by: David Weitzman <dweitzman@pinterest.com>
Kill vtctld commands that outlive the http request context
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Handling error from flush required me to pull it out of the wrapped
function, and this ended up making it unnecessary.

The flush is now called at the end of the block.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
FIELDS is now a valid alternative for SHOW COLUMNS

Signed-off-by: Dan Kozlowski <koz@planetscale.com>
Signed-off-by: Dan Kozlowski <koz@planetscale.com>
If there are write errors while writing responses, then
the handle function may return without flush getting called.
This change calls flush on the defer to make sure we return
the write buffer back to the pool.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
…TRA_MY_CNF's correctly

Signed-off-by: Dan Kozlowski <koz@planetscale.com>
Signed-off-by: Dan Kozlowski <koz@planetscale.com>
mysql: improve code structure for buffered vs unbuffered writes
Signed-off-by: Dan Kozlowski <koz@planetscale.com>
Updating from upstream
Old functions NewFromListener and NewListener preserve their behavior
(use buffered reader with connBufferSize buffer).
New function NewListenerWithConfig isn't used in vitess itself for now,
but it can be used to control buffer size (or to disable buffering).

Signed-off-by: Alexander Morozov <lk4d4math@gmail.com>
[go/mysql] add ability to create server connection with unbuffered reads
Signed-off-by: Jon Tirsen <jontirsen@squareup.com>
* Add logging when using s3 for: StartBackup / ListBackups / RemoveBackup
* Added options to enable usage of an S3 appliance: Cloudian HyperStore:
      -s3_backup_aws_endpoint <host:port> (port is required)
      -s3_backup_force_path_style=true/false

  By default the s3 client will try to connect to
  <path>.<region>.amazonaws.com.  Adjusting the endpoint will allow this
  to be changed.

  Given the way the FQDN is configured the TLS certificate may not match the
  server's "base" (<region>.<end_point_address>) due to the leading <path>
  so setting -s3_backup_force_path_style=true will force the s3 client to
  connect to <region>.<endpoint> and then make a request using the full
  path within the http calls.

Signed-off-by: Simon Mudd <simon.mudd@booking.com>
Signed-off-by: Scott Lanning <scott.lanning@booking.com>
In case for some reason the SSL certificate is invalid...
this flag allows disabling the validity check.

Signed-off-by: Scott Lanning <scott.lanning@booking.com>
demmer and others added 23 commits October 27, 2018 16:18
The wire protocol supports sending a warning count at the end of each
query to signal to the client if there were any non-fatal warnings.

Add the approrpriate support to the mysql server and client implementations
to convey a warning count, and add a WarningCount method to the handler
interface so that specific server implementations can track warnings.

Along the way fix a bug in the client implementation -- when the
ClientDeprecateEOF option is enabled, it parsed the final EOF packet
incorrectly as an EOF packet but it should really have been parsed as
an OK packet with the EOF type. This could result in misinterpreting
the statusFlags, which could confuse the multi-query support.

Signed-off-by: Michael Demmer <mdemmer@slack-corp.com>
Signed-off-by: Michael Demmer <mdemmer@slack-corp.com>
Signed-off-by: Michael Demmer <mdemmer@slack-corp.com>
Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com>
Signed-off-by: Derek Perkins <derek@derekperkins.com>
docker/helm: update orchestrator to v3.0.13
…warning-counts

mysql: support warning counts
This includes adding a new RecordWarnings() method to the vcursor
interface so that primitives can store warnings in the session.

Also add support to the route primitive to record warnings when the
SCATTER_ERRORS_AS_WARNINGS query directive is set.

Signed-off-by: Michael Demmer <mdemmer@slack-corp.com>
Signed-off-by: Michael Demmer <mdemmer@slack-corp.com>
To support the semantics of mysql warnings, clear them for all
"non-diagnostic" statements, which in this case can be reasoned
to be every statement other than SHOW.

Signed-off-by: Michael Demmer <mdemmer@slack-corp.com>
Signed-off-by: Michael Demmer <mdemmer@slack-corp.com>
Signed-off-by: Michael Demmer <mdemmer@slack-corp.com>
Remove the hard-coded vitess-specific error code for a shard error
and instead extract the error code from the underlying error object
like we do for regular mysql protocol errors.

Signed-off-by: Michael Demmer <mdemmer@slack-corp.com>
Bump Go versions and use '.x' to always get latest minor versions
Need to call NewSQLErrorFromError to parse the errno out of the
message since it isn't necessarily a SQLError.

Signed-off-by: Michael Demmer <mdemmer@slack-corp.com>
Signed-off-by: Michael Demmer <mdemmer@slack-corp.com>
Signed-off-by: Michael Demmer <mdemmer@slack-corp.com>
after @sougou's feedback in PR 4309

(An alternative way to make things work was to comment out
the check for negative values in sqltypes.ToUint64
but I thought that might be too low-level to mess with.)

Signed-off-by: Scott Lanning <scott.lanning@booking.com>
Signed-off-by: Michael Demmer <mdemmer@slack-corp.com>
allow `hash` vindexes to support signed ints
@rafael rafael requested a review from demmer October 29, 2018 19:56
Signed-off-by: Rafael Chacon <rafael@slack-corp.com>
@rafael rafael force-pushed the slack-vitess-2018-10-29.r0 branch from 2c9e48e to 131fc36 Compare October 29, 2018 20:06
@demmer
Copy link
Copy Markdown
Collaborator

demmer commented Oct 29, 2018

I just confirmed this is a clean sync to upstream:

# git diff upstream/master origin/slack-vitess-2018-10-29.r0

@rafael rafael merged commit 47de436 into master Oct 29, 2018
@rafael rafael deleted the slack-vitess-2018-10-29.r0 branch October 29, 2018 21:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.