-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
release-2.1: sql,pgwire: fix a host of pgwire/sql interaction bugs + perf fixes #31021
Merged
knz
merged 8 commits into
cockroachdb:release-2.1
from
knz:backport2.1-30508-30813-30702
Oct 7, 2018
Merged
release-2.1: sql,pgwire: fix a host of pgwire/sql interaction bugs + perf fixes #31021
knz
merged 8 commits into
cockroachdb:release-2.1
from
knz:backport2.1-30508-30813-30702
Oct 7, 2018
Conversation
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
Release note: None
... and comments around the SessionRegistry. Release note: None
Before this patch, `cancel session <foo>` would cause a connExecutor's context to be canceled. This patch switches it to cancel the pgwire connection's ctx instead (which was a parent of the connExecutor's ctx; now the two are the same), as nature intended. For example, reading from the network connection should stop ASAP after `cancel session`. It also opens to door to guaranteeing that the client using the respective session is unblocked in a timely manner (by the server closing the network connection), although that is not currently implemented (pgwire will still wait for the connExecutor to react to cancelation and finish its task before closing the net.Conn). This patch also eliminates what I presume to have been a crash when someone tries to cancel a "session" created by the InternalExecutor. It will now be a no-op. This patch also moves a cancelation callback out of connExecutor.ctxHolder. I'm trying to get rid of that guy, which is how this patch came to be. I've also added a TODO with some thoughts on a better design for session cancelation, originally expressed in cockroachdb#23861 (comment). FWIW, I've tried to be the change, but gave up for the moment. Release note: None
Release note: None
Release note: None
Release note (bug fix): CockroachDB now properly ignores non-alphanumeric characters in encoding names passed to `convert_from()`, `client_encoding`, etc., for compatibility with PostgreSQL.
Prior to this patch, CockroachDB: - incorrectly ignored the `extra_float_digits` client parameter. - improperly reported `ISO` as default value for server status parameter and session var `DateStyle` (the pg default is `ISO, MDY`. - failed to report `TimeZone`, `is_superuser` and `session_authorization` in the server status parameters. - failed to report the correct (and client-provided) value of `application_name` in the server status parameters. - did not report the correct defaults in `pg_catalog.pg_settings`. This patch corrects these various bugs by: - keeping the client-provided parameters as session defaults, to be picked up by RESET and pg_settings. (Prior to this patch, the client parameters were discarded after setting up the session initially.) - extending the handling of session variables to support reporting their current value during connection intiialization. This way the server status parameter can report the session variables that were just initialized from the client-provided defaults. - eliminating the ad-hoc constant list of "statusServerParams" maintained in pgwire/conn.go, which could dangerously go out of sync with the session variable defaults without anyone noticing. - adding the missing reports for `is_superuser` and `session_authorization`. Because CockroachDB now properly honors the value of extra_float_digits provided by the client, any test that uses lib/pq must now account for the fact that lib/pq automatically sets this parameter to 2. The logic_test code is modified accordingly. Because CockroachDB now properly reports the current TimeZone parameter to the client during connection initialization, any test that uses lib/pq must now account for the fact that lib/pq will load that zone name into any parsed timestamp value coming from the server. The tests that print out timestamps have been modified accordingly. As a side effect of this fix, it is now possible to set arbitrary session variables in the client connection URL. This has another benefit reported in the release notes below. Release note (bug fix): CockroachDB now properly recognizes the value of `extra_float_digits` provided by clients as a connection parameter. Release note (bug fix): CockroachDB now properly recognizes two-part values for the session variable and connection parameter `DateStyle`, for compatibility with PostgreSQL. Release note (bug fix): CockroachDB now reports all server status parameters supported by PostgreSQL when setting up a session. This is expected to improve compatibility with some drivers. Release note (bug fix): CockroachDB now properly uses the client-provided default values when using the RESET statement (or SET ... = DEFAULT). Release note (bug fix): CockroachDB now properly fills the columns `boot_val` and `reset_val` in `pg_catalog.pg_settings` for better compatibility with PostgreSQL. Release note (cli change): It is now possible to provide initial/default values for any customizable session variable in the client connection URL. Release note (sql change): CockroachDB now supports more customizations from PostgreSQL client drivers when initially setting up the client connection.
benesch
approved these changes
Oct 5, 2018
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.
The commits I reviewed originally look good!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Backport:
Please see individual PRs for details.
/cc @cockroachdb/release