This repository was archived by the owner on Dec 16, 2022. It is now read-only.
Conversation
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>
…null Allow updating fields to null
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>
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
vtgate support warnings
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>
ignore .vscode files
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
…warnings Partial scatter with warnings
Signed-off-by: Rafael Chacon <rafael@slack-corp.com>
2c9e48e to
131fc36
Compare
Collaborator
|
I just confirmed this is a clean sync to upstream: |
demmer
approved these changes
Oct 29, 2018
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Slack changes:
Risky/Important community PR's
Other Changes