kvtenant: move kv tenant connector out of ccl#98203
kvtenant: move kv tenant connector out of ccl#98203craig[bot] merged 1 commit intocockroachdb:masterfrom
Conversation
ed01a6a to
a523e3d
Compare
a523e3d to
e5d304f
Compare
58ee2a7 to
831d839
Compare
831d839 to
526b708
Compare
4d67b32 to
39863b1
Compare
knz
left a comment
There was a problem hiding this comment.
Excellent, thanks. I have only a few comments. Let's rebase this and have a look at CI before this can merge.
Reviewed 25 of 41 files at r1, 2 of 7 files at r2, 1 of 1 files at r4, 4 of 11 files at r5, 15 of 15 files at r6, all commit messages.
Reviewable status:complete! 0 of 0 LGTMs obtained (waiting on @herkolategan)
pkg/kv/kvclient/kvtenant/connector.go line 139 at r6 (raw file):
// connector mediates the communication of cluster-wide state to sandboxed // SQL-only tenant processes through a restricted interface.
through this comment and the other comments below replace "process" by "server".
pkg/kv/kvclient/kvtenant/connector.go line 143 at r6 (raw file):
// A connector is instantiated inside a tenant's SQL process and is seeded with // a set of one or more network addresses that reference existing KV nodes in // the host cluster (or a load-balancer which fans out to some/all KV nodes). On
s/host/storage, here and below
pkg/kv/kvclient/kvtenant/connector.go line 148 at r6 (raw file):
// communication. // // The connector communicates with the host cluster through the roachpb.Internal
s/host/storage
pkg/kv/kvclient/kvtenant/connector.go line 191 at r6 (raw file):
// connector is capable of providing information on each of the KV nodes in the // cluster in the form of NodeDescriptors. This obviates the need for SQL-only
replace "SQL-only tenant processes" to "tenant SQL servers", here and below.
pkg/kv/kvclient/kvtenant/connector_factory.go line 36 at r6 (raw file):
} type KVAddressConfig struct {
I think this needs a docstring.
This change moves the kv tenant connector out of `kvtenantccl` to enable wider test coverage of multi-tenant outside `ccl`. There are now two versions of the kv tenant connector factory, one that provides a connector that only connects clients to a loopback address, and another that will allow both loopback and remote addresses. If the loopback version is used in the wrong context an error will be returned explaining license requirements. To assist with testing, utilities have been added to instantiate the required kv connector factory. Tests requiring a kv connector that can connect to remote nodes can use a testing only factory that is available outside `ccl`. Existing tests that fell into this category, and depended on `ccl`, have been updated to use the appropriate utility and connector. This change does not yet remove the license check for maybe starting a tenant when a test server is started, since this will most likely break various existing tests and will require a larger change to fix, it will be done separately. Additionally, there are a few other places where `TenantKVAddrs` is populated with a loopback address, and we can rather favour the new `TenantLoopbackAddr` to better let the connector factory know that it's only making a loopback connection and choose the correct logic accordingly. This will be implemented as part of the test changes mentioned above. Resolves: cockroachdb#98226 Epic: CRDB-16091
39863b1 to
29edf81
Compare
herkolategan
left a comment
There was a problem hiding this comment.
@knz Thanks for the excellent review! Addressing the comments and doing a rebase. During the rebase I saw that there are two new ccl packages that added tests under kvtenantccl. I have decided to leave those there, unless instructed otherwise.
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @knz)
pkg/kv/kvclient/kvtenant/connector.go line 139 at r6 (raw file):
Previously, knz (Raphael 'kena' Poss) wrote…
through this comment and the other comments below replace "process" by "server".
Done.
pkg/kv/kvclient/kvtenant/connector.go line 143 at r6 (raw file):
Previously, knz (Raphael 'kena' Poss) wrote…
s/host/storage, here and below
Done.
pkg/kv/kvclient/kvtenant/connector.go line 148 at r6 (raw file):
Previously, knz (Raphael 'kena' Poss) wrote…
s/host/storage
Done.
pkg/kv/kvclient/kvtenant/connector.go line 191 at r6 (raw file):
Previously, knz (Raphael 'kena' Poss) wrote…
replace "SQL-only tenant processes" to "tenant SQL servers", here and below.
Done.
pkg/kv/kvclient/kvtenant/connector_factory.go line 36 at r6 (raw file):
Previously, knz (Raphael 'kena' Poss) wrote…
I think this needs a docstring.
True, adding.
knz
left a comment
There was a problem hiding this comment.
Thank you.
We can move tests in a later PR.
Reviewed 27 of 27 files at r7, all commit messages.
Reviewable status:complete! 0 of 0 LGTMs obtained
|
bors r=knz |
1 similar comment
|
bors r=knz |
|
Timed out. |
|
bors r+ |
|
Timed out. |
|
bors r+ |
|
Build failed: |
|
bors r+ |
|
Build succeeded: |
|
Encountered an error creating backports. Some common things that can go wrong:
You might need to create your backport manually using the backport tool. error creating merge commit from 29edf81 to blathers/backport-release-23.1-98203: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict [] you may need to manually resolve merge conflicts with the backport tool. Backport to branch 23.1.x failed. See errors above. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
|
@herkolategan I think you will need to issue the backport manually? |
|
@knz yip, seems like this one needs to be done manually, I'll get on that. |
This change moves the kv tenant connector out of
kvtenantcclto enable widertest coverage of multi-tenant outside
ccl. There are now two versions of thekv tenant connector factory, one that provides a connector that only connects
clients to a loopback address, and another that will allow both loopback and
remote addresses. If the loopback version is used in the wrong context an error
will be returned explaining license requirements.
To assist with testing, utilities have been added to instantiate the required kv
connector factory. Tests requiring a kv connector that can connect to remote
nodes can use a testing only factory that is available outside
ccl. Existingtests that fell into this category, and depended on
ccl, have been updated touse the appropriate utility and connector.
This change does not yet remove the license check for maybe starting a tenant
when a test server is started, since this will most likely break various
existing tests and will require a larger change to fix, it will be done
separately.
Additionally, there are a few other places where
TenantKVAddrsis populatedwith a loopback address, and we can rather favour the new
TenantLoopbackAddrto better let the connector factory know that it's only making a loopback
connection and choose the correct logic accordingly. This will be implemented as
part of the test changes mentioned above.
Resolves: #98226
Epic: CRDB-16091