-
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
pgwire: move the pre-serve logic into a separate file #92577
Merged
Merged
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
knz
changed the title
pgwire: lift the pre-serve logic into a closure
pgwire: move the pre-serve logic into a separate file
Nov 28, 2022
7 tasks
This was referenced Nov 28, 2022
knz
force-pushed
the
20221116-shared-sql-3
branch
from
November 28, 2022 18:26
3b3795f
to
9492997
Compare
knz
force-pushed
the
20221116-shared-sql-4
branch
from
November 28, 2022 18:27
5b2b3e8
to
8fe157c
Compare
knz
force-pushed
the
20221116-shared-sql-3
branch
from
November 29, 2022 14:58
9492997
to
521774a
Compare
knz
force-pushed
the
20221116-shared-sql-4
branch
from
November 29, 2022 14:59
8fe157c
to
e9ef67b
Compare
rafiss
approved these changes
Nov 29, 2022
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.
lgtm!
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @knz)
knz
force-pushed
the
20221116-shared-sql-3
branch
from
December 5, 2022 19:56
521774a
to
0402377
Compare
knz
force-pushed
the
20221116-shared-sql-4
branch
from
December 5, 2022 19:57
e9ef67b
to
ce66da4
Compare
knz
force-pushed
the
20221116-shared-sql-3
branch
from
December 5, 2022 20:24
0402377
to
57e2215
Compare
knz
force-pushed
the
20221116-shared-sql-4
branch
from
December 5, 2022 20:24
ce66da4
to
4b2e290
Compare
knz
force-pushed
the
20221116-shared-sql-3
branch
from
December 6, 2022 12:50
57e2215
to
f6d7823
Compare
knz
force-pushed
the
20221116-shared-sql-4
branch
from
December 6, 2022 12:51
4b2e290
to
1a14800
Compare
knz
force-pushed
the
20221116-shared-sql-3
branch
from
December 6, 2022 12:59
f6d7823
to
78cace3
Compare
knz
force-pushed
the
20221116-shared-sql-4
branch
from
December 6, 2022 13:01
1a14800
to
a346325
Compare
knz
force-pushed
the
20221116-shared-sql-3
branch
from
December 18, 2022 09:01
78cace3
to
5036b86
Compare
knz
force-pushed
the
20221116-shared-sql-4
branch
from
December 18, 2022 09:01
a346325
to
e598c3a
Compare
knz
force-pushed
the
20221116-shared-sql-3
branch
from
December 19, 2022 08:53
5036b86
to
818cae2
Compare
knz
force-pushed
the
20221116-shared-sql-4
branch
from
December 19, 2022 08:54
e598c3a
to
09fac3c
Compare
knz
force-pushed
the
20221116-shared-sql-3
branch
from
December 22, 2022 14:06
818cae2
to
29e2d32
Compare
knz
requested review from
a team,
herkolategan and
smg260
and removed request for
a team
January 8, 2023 19:51
knz
force-pushed
the
20221116-shared-sql-4
branch
from
January 8, 2023 19:51
0a84729
to
d22ad06
Compare
Prior to this patch, we were unconditionally applying a port offset for secondary tenant servers, even when the port allocation for the KV node was randomized. This resulted in the demo cluster trying to reuse arbitrary TCP ports which may be already in use elsewhere in the system. This patch fixes it by ensuring that tenant servers also use random allocation when the KV node ports were randomly allocated in the first place. It also adds demo networking tests that verify this via the `--sql-port` / `--http-port` flags. Release note: None
Some of the tests were not waiting for the prompt to start sending their input. This was causing the input to be lost in some cases. Release note: None
Release note: None
Release note: None
Release note: None
This commit introduces `PreServeConnHandler`, which will handle the preparation of a SQL connection prior to handing it off to a specific tenant server. Release note (ops changes): The count of network bytes sent to report re-authentication errors to a SQL client is now reported via the metric `sql.pre_serve.bytesout` (instead of `sql.bytesout` previously). The count of pre-authentication errors is now reported via the metric `sql.pre_serve.conn.failures` (instead of `sql.conn.failures` previously). Release note (ops changes): The count of new SQL connections is now also reported on `sql.pre_serve.new_conns`.
Release note (ops change): The bytes read from SQL clients prior to authentication are now reported via the metric `sql.pre_serve.bytesin` (instead of `sql.bytesin` previously).
Release note: None
We need the read/parse of the parameters to be tenant-independent, so the function cannot contain tenant-specific configuration. Release note: None
This commit extracts the memory reservation into a tenant-independent memory pool. Release note: None
knz
force-pushed
the
20221116-shared-sql-3
branch
from
January 8, 2023 22:17
dcbea65
to
c7dd014
Compare
This demonstrates that the logic is tenant-independent and makes it ready to move into the PreServe() function. Release note: None
Release note: None
Release note: None
Release note: None
Release note: None
knz
force-pushed
the
20221116-shared-sql-4
branch
from
January 8, 2023 22:17
d22ad06
to
317b426
Compare
9 tasks
craig bot
pushed a commit
that referenced
this pull request
Jan 9, 2023
92580: server,pgwire: use a single SQL listener for multiple tenants r=rafiss a=knz Parent PRs: - [x] #84608 - [x] #91739 - [x] #91744 - [x] #92574 - [x] #92575 - [x] #92576 - [x] #92577 - [x] #92578 - [x] #92579 - [ ] #94901 Fixes #84585. Informs #94310. Epic: CRDB-14537 This commit implements tenant routing using a single SQL network listener. The tenant name can be specified: - via the client status param `options`, e.g. `options=-ccrdb:tenant=hello` - via the database name, e.g. `crdb:tenant-hello.defaultdb`. Release note (backward-incompatible change): If a SQL database is created with a name that starts with `crdb:tenant-` (e.g. `CREATE DATABASE "crdb:tenant-foo"`, clients will no longer be able to connect to it directly. Co-authored-by: Raphael 'kena' Poss <knz@thaumogen.net>
This was referenced Jan 9, 2023
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.
Parent PRs:
This PR moves codes into the new file pre_serve.go, where the tenant-independent logic will live.
Epic: CRDB-14537