sql: add an example distsql tenant logic test with split ranges#82844
sql: add an example distsql tenant logic test with split ranges#82844craig[bot] merged 1 commit intocockroachdb:masterfrom
Conversation
b47b90f to
da266e4
Compare
da266e4 to
6e54e49
Compare
6e54e49 to
2e97c11
Compare
|
The remaining test failures relevant to this change are fixed now. Ready for a look. |
yuzefovich
left a comment
There was a problem hiding this comment.
Reviewed 24 of 26 files at r1, 5 of 5 files at r2, all commit messages.
Reviewable status:complete! 0 of 0 LGTMs obtained (waiting on @cucaroach and @rharding6373)
pkg/sql/logictest/logic.go line 2258 at r2 (raw file):
// config list. var blockedConfigNames []string switch blockedConfig {
nit: maybe introduce a helper function for this switch? I think we now have it in three places.
pkg/sql/logictest/logic.go line 4408 at r2 (raw file):
!cfg.useTenant && cfg.numNodes <= 5 { // We also cannot parallelise tests that use tenant servers
nit: Oliver wouldn't not approve of this change :D
pkg/sql/logictest/testdata/logic_test/distsql_tenant line 1 at r2 (raw file):
# LogicTest: 3node-tenant 3node-tenant-multiregion
nit: use 3node-tenant-default-configs?
pkg/sql/logictest/testdata/logic_test/distsql_tenant_locality line 35 at r2 (raw file):
user root # TODO(harding): Once locality-aware distribution is implemented, this should
We already can execute the query in a distributed fashion, right? What's stopping us from testing that here?
pkg/sql/logictest/testdata/logic_test/distsql_tenant_locality line 39 at r2 (raw file):
# only utilize the gateway instance. query T EXPLAIN (DISTSQL) SELECT * FROM t WHERE v = 1 OR v = 2 OR v = 3
nit: is the goal of this test is to verify the physical planning? If so, it should go into the execbuilder tests. If - when the TODO is addressed - we want to also actually run the query, then that should stay in the main logic test folder.
2e97c11 to
6f5dcb4
Compare
rharding6373
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @cucaroach and @yuzefovich)
pkg/sql/logictest/logic.go line 2258 at r2 (raw file):
Previously, yuzefovich (Yahor Yuzefovich) wrote…
nit: maybe introduce a helper function for this switch? I think we now have it in three places.
Good idea. Cleaned this up a bit.
pkg/sql/logictest/logic.go line 4408 at r2 (raw file):
Previously, yuzefovich (Yahor Yuzefovich) wrote…
nit: Oliver wouldn't not approve of this change :D
Sigh...fine, I can be more open to alternate spellings. I've been spending lots of time lately in this file and it's been buggering (:-O) me, that's all.
In my defen[s|c]e, this is the only usage of this particular spelling outside of pkg/ui.
pkg/sql/logictest/testdata/logic_test/distsql_tenant_locality line 35 at r2 (raw file):
Previously, yuzefovich (Yahor Yuzefovich) wrote…
We already can execute the query in a distributed fashion, right? What's stopping us from testing that here?
The query currently only uses a single span, so it won't be distributed.
pkg/sql/logictest/testdata/logic_test/distsql_tenant_locality line 39 at r2 (raw file):
Previously, yuzefovich (Yahor Yuzefovich) wrote…
nit: is the goal of this test is to verify the physical planning? If so, it should go into the execbuilder tests. If - when the TODO is addressed - we want to also actually run the query, then that should stay in the main logic test folder.
I only included it as an example placeholder. The purpose of the test as a whole is to demonstrate how to set up the distribution for future testing. I removed the query altogether and just left a TODO, since it doesn't fulfill any real purpose in this PR.
yuzefovich
left a comment
There was a problem hiding this comment.
Reviewed 3 of 3 files at r3, all commit messages.
Reviewable status:complete! 1 of 0 LGTMs obtained (waiting on @cucaroach and @rharding6373)
pkg/sql/logictest/testdata/logic_test/distsql_tenant_locality line 39 at r2 (raw file):
Previously, rharding6373 (Rachael Harding) wrote…
I only included it as an example placeholder. The purpose of the test as a whole is to demonstrate how to set up the distribution for future testing. I removed the query altogether and just left a TODO, since it doesn't fulfill any real purpose in this PR.
Got it, thanks.
6f5dcb4 to
badd066
Compare
|
TFTR! bors r+ |
|
bors r- |
|
Canceled. |
|
bors r+ |
|
Build failed: |
|
bors r- |
badd066 to
a068d9b
Compare
|
The extra tenant logic test config was causing a test timeout in bors. The new config wasn't adding much value as a default test config, so I provided an option in the logic test infrastructure to provide a config that could be run only if it was included in a test directive. |
yuzefovich
left a comment
There was a problem hiding this comment.
Reviewed 4 of 4 files at r4, all commit messages.
Reviewable status:complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @cucaroach and @rharding6373)
pkg/sql/logictest/logic.go line 21 at r4 (raw file):
"flag" "fmt" "github.com/cockroachdb/cockroach/pkg/build/bazel"
nit: the order is off.
This PR adds an example distsql logic test, `distsql_tenant_locality`, that splits ranges and assigns them to spcific leaseholders, for future use in testing locality-aware distsql changes. This PR also introduces the following logic test improvements: * A new logic test config for multi-tenant multi-region testing, `3node-tenant-multiregion`. * Blocklists in logic tests can now include default config lists. * Skip directives in logic tests can now include default config lists. * A default config list for multi-tenant configurations that include `3node-tenant` and `3node-tenant-multi-region`. * `TestTenantLogic` and `TestTenantExecBuild` now run the 3 node tenant configuration by default and any logic/exec builder tests that have the 3 node tenant multiregion directive. Release note: None
a068d9b to
fec5fb5
Compare
rharding6373
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @cucaroach and @yuzefovich)
pkg/sql/logictest/logic.go line 21 at r4 (raw file):
Previously, yuzefovich (Yahor Yuzefovich) wrote…
nit: the order is off.
Fixed.
|
TFTR! bors r+ |
|
Build succeeded: |
This PR adds an example distsql logic test,
distsql_tenant_locality,that splits ranges and assigns them to spcific leaseholders, for future
use in testing locality-aware distsql changes.
This PR also introduces the following logic test improvements:
3node-tenant-multiregion.3node-tenantand3node-tenant-multi-region.TestTenantLogicandTestTenantExecBuildnow run the 3 nodetenant configuration by default and any logic/exec builder tests
that have the 3 node tenant multiregion directive.
Release note: None