-
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
server: split the tenant server creation into 3 stages #90384
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
This was referenced Oct 23, 2022
knz
force-pushed
the
20221020-split-tenant-init
branch
4 times, most recently
from
October 23, 2022 19:32
91e9deb
to
0b969a6
Compare
knz
requested review from
herkolategan and
smg260
and removed request for
a team
October 23, 2022 19:33
@jeffswenson @dhartunian I'd like to invite you both to review this, with different focus:
cc @andreimatei. |
This was referenced Oct 25, 2022
Merged
craig bot
pushed a commit
that referenced
this pull request
Oct 25, 2022
90523: server: start purging web_sessions in secondary tenants r=aadityasondhi,stevendanna a=knz Fixes #90522. The next PR #90384 will ensure this code lands in the right place. 90595: catalog/descs: fix memory allocation when resolving many descriptors r=ajwerner a=ajwerner In some cases we resolve many descriptors and the fast int map is a bad fit. We just really wanted to optimize the N=1 case. Epic: CRDB-20865 Release note: None Co-authored-by: Raphael 'kena' Poss <[email protected]> Co-authored-by: Andrew Werner <[email protected]>
knz
force-pushed
the
20221020-split-tenant-init
branch
from
October 26, 2022 18:12
a4a0b98
to
637f28c
Compare
Release note: None
Release note: None
Release note: None
Release note: None
Release note: None
Release note: None
Release note: None
Release note: None
The `go.scheduler_latency` metric was not being measured. This commit fixes that. Release note: None
Release note: None
Release note: None
Release note: None
The Graphite metric reporting was never enabled, even when configured. This commit fixes that. Release note: None
Release note: None
The Sentry context enhancement (to report cluster ID, etc) was missing. This commit fixes that. Release note: None
Release note: None
Release note: None
Release note: None
Release note: None
The original motivation (and ultimate goal) for this commit is to split the tenant server initialization into three phases: `New()`, `PreStart()`, `AcceptClients()`, so as to reuse a common process startup logic in a separate (later) commit. To achieve this goal, this commit re-orders the initialization steps in `server.NewTenantServer` (previously known as `server.StartTenant`), and extracts many of them into a new method `(*SQLServerWrapper).PreStart()`. The specific order of the code in `NewTenantServer()` and `(*SQLServerWrapper).PreStart()` was chosen to mirror the order of things in `NewServer()` and `(*Server).PreStart()`. Reasons for using the same order: - it makes the review of this change easier: the reviewer can pull `server.go` and `tenant.go` and read them side-by-side, to satisfy themselves that the two implementations of `NewServer`/`NewTenantServer` and `PreStart` are equivalent. - it will make it easier for future maintainers to keep them in sync. - it helps us discover the fact that both sides share a lot of code. This opens an opportunity to merge them to a common implementation at a later stage. While doing this work, care was also taken to discover which steps of `(*Server).PreStart()` were *missing* from the tenant server initialization. We found the following: - the Sentry context enhancement (to report cluster ID, etc) was missing. This commit fixes that. - several log entries that report the server configuration to the OPS channel were not emitted. This commit fixes that. - the Graphite metric reporting was never enabled, even when configured. This commit fixes that. - the Obs Service testing knobs (TestingKnobs.EventExporter) were not configured on the ObsServer instance. This commit fixes that. - the `go.scheduler_latency` metric was not being measured. This commit fixes that. Additionally, two followup issues were filed for the following missing steps: - missing support for the special file that blocks background jobs. (cockroachdb#90524) - missing support for the system.eventlog cleanup loop. (cockroachdb#90521) Release note: None
knz
force-pushed
the
20221020-split-tenant-init
branch
from
October 26, 2022 19:48
637f28c
to
616c822
Compare
TFYR bors r=dhartunian |
Build succeeded: |
This was referenced Oct 27, 2022
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.
Needed as prerequisite to #90176, towards fixing #89974.
First two commits from #90523.
The original motivation (and ultimate goal) for this PR is to
split the tenant server initialization into three phases:
New()
,PreStart()
,AcceptClients()
, so as to reuse a common process startuplogic in a separate PR (#90176).
To achieve this goal, this PR re-orders the initialization steps
in
server.NewTenantServer
(previously known asserver.StartTenant
), and extracts many of them into a new method(*SQLServerWrapper).PreStart()
.The specific order of the code in
NewTenantServer()
and(*SQLServerWrapper).PreStart()
was chosen to mirror the order ofthings in
NewServer()
and(*Server).PreStart()
.Reason for using the same order:
it makes the review of this change easier: the reviewer can pull
server.go
andtenant.go
and read them side-by-side, to satisfythemselves that the two implementations of
NewServer
/NewTenantServer
andPreStart
are equivalent.it will make it easier for future maintainers to keep them in sync.
it helps us discover the fact that both sides share a lot of code.
This opens an opportunity to merge them to a common implementation
at a later stage.
While doing this work, care was also taken to discover which steps of
(*Server).PreStart()
were missing from the tenant serverinitialization. We found the following:
the Sentry context enhancement (to report cluster ID, etc)
was missing. This commit fixes that.
several log entries that report the server configuration
to the OPS channel were not emitted. This commit fixes that.
the Graphite metric reporting was never enabled, even when
configured. This commit fixes that.
the Obs Service testing knobs (TestingKnobs.EventExporter) were
not configured on the ObsServer instance. This commit fixes that.
the
go.scheduler_latency
metric was not being measured.This commit fixes that.
Additionally, two followup issues were filed for the following
missing steps:
Epic: CRDB-14537