Skip to content
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

rpc,server: use node certs for shared-process tenant RPCs #96553

Merged
merged 9 commits into from
Feb 7, 2023

Conversation

knz
Copy link
Contributor

@knz knz commented Feb 5, 2023

TLDR: This PR makes it possible to use regular node certs with shared-process multi-tenancy (i.e. skip creating client tenant certs). I think this will help @aadityasondhi 's work on debug zip.

Fixes #96215.
Epic: CRDB-23559

The PR also contains a few cleanup commits; it's a short change away from fixing #87141 and #77173, which I intend to do in a separate PR.

knz added 4 commits February 5, 2023 01:25
Goroutine / heap / profile dump generation is non-deterministic.
The reference test output should not include them.

Release note: None
This will protect against programming errors.

Release note: None
Release note: None
@knz knz requested review from stevendanna and dhartunian February 5, 2023 00:28
@knz knz requested review from a team as code owners February 5, 2023 00:28
@knz knz requested a review from a team February 5, 2023 00:28
@knz knz requested review from a team as code owners February 5, 2023 00:28
@knz knz requested a review from a team February 5, 2023 00:28
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@knz knz requested a review from aadityasondhi February 5, 2023 00:29
@knz knz force-pushed the 20230204-rpc-client branch 2 times, most recently from e8048d7 to f5dfd09 Compare February 5, 2023 01:02
@knz knz added the A-multitenancy Related to multi-tenancy label Feb 5, 2023
knz added 5 commits February 5, 2023 10:09
The security package was using pre-go 1.13 error types. This was
crufty and also caused the error payloads to be unduly redacted in
logs. This patch fixes it.

Release note: None
This constructor makes an object that contains a mutex lock. We have
linters that find it illegal to copy an object that contains a lock.
So this patch fixes that by ensuring that struct is instantiated on
the heap.

Release note: None
Prior to this patch, `GetClientTLSConfig()` was used both
to obtain a TLS config suitable for a standalone/CLI RPC client
and also for the TLS config inside a KV server.

This was confusing and error prone. We really have two cases
and they are quite different:

- a standalone RPC client (e.g. a CLI tool) connecting
  to a remote RPC server, under some non-node identity.
  This is what `GetClientTLSConfig()` is for.

- a RPC server for a KV node that's also RPC client of another KV
  node. In that case, this server can know it has server (node) certs to
  work with. This is the new `GetNodeClientTLSConfig()`

- a RPC server for a secondary tenant server that's also RPC client to
  something else (either another server for the secondary tenant, or a
  KV node). This is what `GetTenantTLSConfig()` is for.

Release note: None
When a tenant server running in the same process as a KV node makes an
outgoing RPC, it can use the same node certs as the KV node.
This has two advantages:

- it is simpler to orchestrate; this way we do not need to provision
  the tenant client certs manually;
- it paves the road for using a single RPC server for all tenants
  on a server (future work).

Release note: None
Now that the RPC code is able to perform tenant-to-tenant RPCs without
tenant client certs, we can demonstrate this by disabling the
auto-generation of a tenant client cert when shared-process servers
are used.

Release note: None
@knz knz force-pushed the 20230204-rpc-client branch from f5dfd09 to fb76cc9 Compare February 5, 2023 09:11
Copy link
Collaborator

@stevendanna stevendanna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pushing this forward.

@knz
Copy link
Contributor Author

knz commented Feb 7, 2023

thank you!

bors r=stevendanna

@craig
Copy link
Contributor

craig bot commented Feb 7, 2023

Build failed:

@knz
Copy link
Contributor Author

knz commented Feb 7, 2023

bors r=stevendanna

@craig craig bot merged commit 75eb88d into cockroachdb:master Feb 7, 2023
@craig
Copy link
Contributor

craig bot commented Feb 7, 2023

Build succeeded:

@knz knz deleted the 20230204-rpc-client branch February 7, 2023 17:01
aadityasondhi added a commit to aadityasondhi/cockroach that referenced this pull request Mar 16, 2023
This patch unskips and re-records the datadriven `TestTenantZip` as it
was fixed in cockroachdb#96553, but was not unskipped or recorded. The test was run
locally using `--stress` and did not flake:
```
101 runs so far, 0 failures, over 5m0s
```

Fixes cockroachdb#87141

Release note: None
aadityasondhi added a commit to aadityasondhi/cockroach that referenced this pull request Mar 20, 2023
This patch unskips and re-records the datadriven `TestTenantZip` as it
was fixed in cockroachdb#96553, but was not unskipped or recorded. The test was run
locally using `--stress` and did not flake:
```
101 runs so far, 0 failures, over 5m0s
```

Fixes cockroachdb#87141

Release note: None
craig bot pushed a commit that referenced this pull request Mar 21, 2023
97677: tsearch: add stemming and stopword elimination for several languages r=jordanlewis a=jordanlewis

Updates: #41288
Epic: CRDB-22357
First commit is #92966.

    This commit adds stopword elimination for text search. The languages
    supported are the same ones that Postgres does. The stopword lists were
    copied from Postgres commit e757080e041214cf6983e3e77ef01e83f1371d72.

    Also, add snowball stemming provided by the blevesearch snowball
    stemming library.

    Release note (sql change): add stemming and stopword eliminating text
    search configurations for English, Danish, Dutch, Finnish, French,
    German, Hungarian, Italian, Norwegian, Portuguese, Russian, Spanish,
    Swedish, and Turkish.

98778: cli: unskip test tenant zip test r=dhartunian a=aadityasondhi

This patch unskips and re-records the datadriven `TestTenantZip` as it was fixed in #96553, but was not unskipped or recorded. The test was run locally using `--stress` and did not flake:
```
101 runs so far, 0 failures, over 5m0s
```

Fixes #87141

Release note: None

98830: sqlinstance: add `binary_version` column to instances table r=knz,JeffSwenson a=healthy-pod

This code change adds a `binary_version` column to the instances table.

This is done by adding the column to the bootstrap schema for system.sql_instances,
and piggy-backing on the existing code for the V23_1_SystemRbrReadNew migration
that overwrites the live schema for this table by the bootstrap copy.

This redefinition of the meaning of the V23_1_SystemRbrReadNew is backward-incompatible
and is only possible because this commit is merged before the v23.1 branch is cut.

Release note: None
Epic: [CRDB-20860](https://cockroachlabs.atlassian.net/browse/CRDB-20860)

99100: kvserver: skip `TestReplicateQueueExpirationLeasesOnly` under deadlock r=erikgrinaker a=erikgrinaker

I give up.

Resolves #99015.

Epic: none
Release note: None

99106: server: avoid some log spam r=erikgrinaker a=knz

This change removes the following log spam:
```
could not run claimed job 102: no resumer is available for AUTO CONFIG RUNNER
```

Epic: CRDB-23559
Release note: None

Co-authored-by: Jordan Lewis <[email protected]>
Co-authored-by: Aaditya Sondhi <[email protected]>
Co-authored-by: healthy-pod <[email protected]>
Co-authored-by: Erik Grinaker <[email protected]>
Co-authored-by: Raphael 'kena' Poss <[email protected]>
abarganier pushed a commit to abarganier/cockroach that referenced this pull request Sep 20, 2023
This patch unskips and re-records the datadriven `TestTenantZip` as it
was fixed in cockroachdb#96553, but was not unskipped or recorded. The test was run
locally using `--stress` and did not flake:
```
101 runs so far, 0 failures, over 5m0s
```

Fixes cockroachdb#87141

Release note: None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-multitenancy Related to multi-tenancy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

server: make shared-process tenant servers use node certs for outgoing RPC connections
3 participants