Skip to content

Commit c72f5ce

Browse files
craig[bot]arulajmaniyuzefovichceliala
committed
155540: kvserver: add split trigger support to TestReplicaLifecycleDataDriven r=pav-kv a=arulajmani This patch adds a few directives to construct and evaluate split triggers. We then use these directives to demonstrate that leases are correctly copied over from the LHS to the RHS. The interesting case is around leader leases, where if the LHS has a leader lease, the RHS gets an expiration based lease. For the other two lease types, the RHS's lease type stays the same. Epic: none Release note: None 156112: sql/rowexec: enable tests under secondary tenants r=yuzefovich a=yuzefovich Given the modifications in recent commits, this mostly required plumbing the right codec into `eval.Context`. Additionally, a few tests needed some extra adjustments for the tenant prefix present in the spans. Only `TestWriteResumeSpan` is still skipped since it wasn't immediately clear what's wrong there. Epic: CRDB-48945 Release note: None 156119: revert "sql: store bundle when TestStreamerTightBudget fails" r=yuzefovich a=yuzefovich This reverts commit 48f11d2. The test hasn't failed in like year and a half and the captured stmt bundle didn't actually give any more insight into why it rarely failed. Informs: #119675. Release note: None 156225: clusterversion: move to 26.1 version r=fqazi a=celiala ### Commit 1 (7cded94): clusterversion: move to 26.1 version This change advances the current release series version on master from 25.4 to 26.1, following the standard M.1 process after forking the release-25.4 branch. This allows the addition of new upgrade gates for version 26.1 and prepares master for the next development cycle. Changes implemented following the M.1 checklist from pkg/clusterversion/README.md: - Added version key constant V26_1 (=Latest) and final version V25_4 - Added start version V26_1_Start (version 25.4-2) with first upgrade - Updated SystemDatabaseSchemaBootstrapVersion to V26_1_Start - Updated roachpb.successorSeries map (25.4 -> 26.1) - Updated pkg/build/version.txt to v26.1.0-alpha.00000000 - Copied scplan rules from current to release_25_4 - Updated package names and version references in scplan rules - Updated rulesForReleases in scplan/plan.go - Regenerated test outputs for scplan and TestDeclarativeRules - Updated releases file (25.4 entries removed as expected) - Regenerated bootstrap test data with updated hash values Note: PreviousRelease is NOT updated in this change - this only happens in M.3 after the first 25.4 RC is published. ### Commit 2 (8970893): sql: sort rulesForRelease versions in descending order This fix was caught in a previous draft via: https://github.com/cockroachdb/cockroach/actions/runs/18817950946 - Issue: `rulesForReleases` array values were incorrectly in ascending order. - Fix: fix was to put them in descending order. Analysis Verification: I verified that this analysis was correct by looking at the original PR that added this array, which indeed sorts these in descending order: - https://github.com/cockroachdb/cockroach/pull/97213/files?diff=unified Release note (bug fix): Fix rulesForReleases ordering Epic: None 🤖 Generated with [Claude Code](https://claude.com/claude-code) 156309: *: miscellaneous test-tenant-related improvements r=yuzefovich a=yuzefovich Fixes: #142797. Fixes: #142801. Fixes: #142802. Fixes: #142804. Fixes: #142805. Co-authored-by: Arul Ajmani <[email protected]> Co-authored-by: Yahor Yuzefovich <[email protected]> Co-authored-by: Celia La <[email protected]>
6 parents 529ffb8 + 22b383e + 0418e87 + 6bd3146 + 29c435e + 0a475f8 commit c72f5ce

File tree

105 files changed

+15930
-1018
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+15930
-1018
lines changed

docs/generated/settings/settings-for-tenants.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,4 +426,4 @@ trace.zipkin.collector string the address of a Zipkin instance to receive trace
426426
ui.database_locality_metadata.enabled boolean true if enabled shows extended locality data about databases and tables in DB Console which can be expensive to compute application
427427
ui.default_timezone string the default timezone used to format timestamps in the ui application
428428
ui.display_timezone enumeration etc/utc the timezone used to format timestamps in the ui. This setting is deprecatedand will be removed in a future version. Use the 'ui.default_timezone' setting instead. 'ui.default_timezone' takes precedence over this setting. [etc/utc = 0, america/new_york = 1] application
429-
version version 1000025.3-upgrading-to-1000025.4-step-014 set the active cluster version in the format '<major>.<minor>' application
429+
version version 1000025.4-upgrading-to-1000026.1-step-002 set the active cluster version in the format '<major>.<minor>' application

docs/generated/settings/settings.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,6 @@
385385
<tr><td><div id="setting-ui-database-locality-metadata-enabled" class="anchored"><code>ui.database_locality_metadata.enabled</code></div></td><td>boolean</td><td><code>true</code></td><td>if enabled shows extended locality data about databases and tables in DB Console which can be expensive to compute</td><td>Basic/Standard/Advanced/Self-Hosted</td></tr>
386386
<tr><td><div id="setting-ui-default-timezone" class="anchored"><code>ui.default_timezone</code></div></td><td>string</td><td><code></code></td><td>the default timezone used to format timestamps in the ui</td><td>Basic/Standard/Advanced/Self-Hosted</td></tr>
387387
<tr><td><div id="setting-ui-display-timezone" class="anchored"><code>ui.display_timezone</code></div></td><td>enumeration</td><td><code>etc/utc</code></td><td>the timezone used to format timestamps in the ui. This setting is deprecatedand will be removed in a future version. Use the &#39;ui.default_timezone&#39; setting instead. &#39;ui.default_timezone&#39; takes precedence over this setting. [etc/utc = 0, america/new_york = 1]</td><td>Basic/Standard/Advanced/Self-Hosted</td></tr>
388-
<tr><td><div id="setting-version" class="anchored"><code>version</code></div></td><td>version</td><td><code>1000025.3-upgrading-to-1000025.4-step-014</code></td><td>set the active cluster version in the format &#39;&lt;major&gt;.&lt;minor&gt;&#39;</td><td>Basic/Standard/Advanced/Self-Hosted</td></tr>
388+
<tr><td><div id="setting-version" class="anchored"><code>version</code></div></td><td>version</td><td><code>1000025.4-upgrading-to-1000026.1-step-002</code></td><td>set the active cluster version in the format &#39;&lt;major&gt;.&lt;minor&gt;&#39;</td><td>Basic/Standard/Advanced/Self-Hosted</td></tr>
389389
</tbody>
390390
</table>

pkg/BUILD.bazel

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,7 @@ ALL_TESTS = [
610610
"//pkg/sql/schemachanger/scplan/internal/rules/current:current_test",
611611
"//pkg/sql/schemachanger/scplan/internal/rules/release_25_2:release_25_2_test",
612612
"//pkg/sql/schemachanger/scplan/internal/rules/release_25_3:release_25_3_test",
613+
"//pkg/sql/schemachanger/scplan/internal/rules/release_25_4:release_25_4_test",
613614
"//pkg/sql/schemachanger/scplan/internal/scgraph:scgraph_test",
614615
"//pkg/sql/schemachanger/scplan:scplan_test",
615616
"//pkg/sql/schemachanger/screl:screl_test",
@@ -2289,6 +2290,8 @@ GO_TARGETS = [
22892290
"//pkg/sql/schemachanger/scplan/internal/rules/release_25_2:release_25_2_test",
22902291
"//pkg/sql/schemachanger/scplan/internal/rules/release_25_3:release_25_3",
22912292
"//pkg/sql/schemachanger/scplan/internal/rules/release_25_3:release_25_3_test",
2293+
"//pkg/sql/schemachanger/scplan/internal/rules/release_25_4:release_25_4",
2294+
"//pkg/sql/schemachanger/scplan/internal/rules/release_25_4:release_25_4_test",
22922295
"//pkg/sql/schemachanger/scplan/internal/rules:rules",
22932296
"//pkg/sql/schemachanger/scplan/internal/scgraph:scgraph",
22942297
"//pkg/sql/schemachanger/scplan/internal/scgraph:scgraph_test",

pkg/build/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v25.4.0-alpha.2
1+
v26.1.0-alpha.00000000

pkg/ccl/logictestccl/testdata/logic_test/crdb_internal_tenant

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ select crdb_internal.get_vmodule()
304304
query T
305305
SELECT crdb_internal.release_series(crdb_internal.node_executable_version())
306306
----
307-
25.4
307+
26.1
308308

309309
query ITTT colnames,rowsort
310310
select node_id, component, field, regexp_replace(regexp_replace(value, '^\d+$', '<port>'), e':\\d+', ':<port>') as value from crdb_internal.node_runtime_info
@@ -392,7 +392,7 @@ select * from crdb_internal.gossip_alerts
392392
query T
393393
SELECT crdb_internal.release_series(crdb_internal.node_executable_version())
394394
----
395-
25.4
395+
26.1
396396

397397
user root
398398

pkg/ccl/multiregionccl/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ go_test(
105105
"//pkg/testutils/skip",
106106
"//pkg/testutils/sqlutils",
107107
"//pkg/testutils/testcluster",
108-
"//pkg/util",
109108
"//pkg/util/ctxgroup",
110109
"//pkg/util/encoding",
111110
"//pkg/util/leaktest",

pkg/ccl/multiregionccl/cold_start_latency_test.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
"github.com/cockroachdb/cockroach/pkg/rpc"
2121
"github.com/cockroachdb/cockroach/pkg/rpc/rpcbase"
2222
"github.com/cockroachdb/cockroach/pkg/server"
23-
"github.com/cockroachdb/cockroach/pkg/settings/cluster"
2423
"github.com/cockroachdb/cockroach/pkg/spanconfig"
2524
"github.com/cockroachdb/cockroach/pkg/testutils"
2625
"github.com/cockroachdb/cockroach/pkg/testutils/pgurlutils"
@@ -117,13 +116,11 @@ func TestColdStartLatency(t *testing.T) {
117116
args.Knobs.Server = serverKnobs
118117
perServerArgs[i] = args
119118
}
120-
cs := cluster.MakeTestingClusterSettings()
121119
tc := testcluster.NewTestCluster(t, numNodes, base.TestClusterArgs{
122120
ParallelStart: true,
123121
ServerArgsPerNode: perServerArgs,
124122
ServerArgs: base.TestServerArgs{
125-
DefaultTestTenant: base.TODOTestTenantDisabled,
126-
Settings: cs,
123+
DefaultTestTenant: base.TestControlsTenantsExplicitly,
127124
},
128125
})
129126
go func() {
@@ -261,7 +258,6 @@ COMMIT;`}
261258
const password = "asdf"
262259
{
263260
tenant, tenantDB := serverutils.StartTenant(t, tc.Server(0), base.TestTenantArgs{
264-
Settings: cs,
265261
TenantID: serverutils.TestTenantID(),
266262
TestingKnobs: base.TestingKnobs{
267263
Server: tenantServerKnobs(0),
@@ -310,7 +306,6 @@ COMMIT;`}
310306
start := timeutil.Now()
311307
sn := tenantServerKnobs(i)
312308
tenant, err := tc.Server(i).TenantController().StartTenant(ctx, base.TestTenantArgs{
313-
Settings: cs,
314309
TenantID: serverutils.TestTenantID(),
315310
DisableCreateTenant: true,
316311
SkipTenantCheck: true,

pkg/ccl/multiregionccl/datadriven_test.go

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -208,20 +208,12 @@ func testMultiRegionDataDriven(t *testing.T, testPath string) {
208208
tc := testcluster.StartTestCluster(t, numServers, base.TestClusterArgs{
209209
ServerArgsPerNode: serverArgs,
210210
ServerArgs: base.TestServerArgs{
211-
// We need to disable the default test tenant here
212-
// because it appears as though operations like
213-
// "wait-for-zone-config-changes" only work correctly
214-
// when called from the system tenant. More
215-
// investigation is required (tracked with #76378).
216-
DefaultTestTenant: base.TODOTestTenantDisabled,
211+
DefaultTestTenant: base.TestDoesNotWorkWithSecondaryTenantsButWeDontKnowWhyYet(156305),
217212
},
218213
})
219214
ds.tc = tc
220215

221-
sqlConn, err := ds.getSQLConn(0)
222-
if err != nil {
223-
return err.Error()
224-
}
216+
sysConn := tc.SystemLayer(0).SQLConn(t)
225217
// Speed up closing of timestamps, in order to sleep less below before
226218
// we can use follower_read_timestamp(). follower_read_timestamp() uses
227219
// sum of the following settings. Also, disable all kvserver lease
@@ -237,7 +229,7 @@ SET CLUSTER SETTING kv.allocator.load_based_lease_rebalancing.enabled = false;
237229
SET CLUSTER SETTING kv.allocator.min_lease_transfer_interval = '5m'
238230
`,
239231
";") {
240-
_, err = sqlConn.Exec(stmt)
232+
_, err := sysConn.Exec(stmt)
241233
if err != nil {
242234
return err.Error()
243235
}
@@ -341,8 +333,9 @@ SET CLUSTER SETTING kv.allocator.min_lease_transfer_interval = '5m'
341333
if err != nil {
342334
return err.Error()
343335
}
344-
cache := ds.tc.Server(idx).DistSenderI().(*kvcoord.DistSender).RangeDescriptorCache()
345-
tablePrefix := keys.MustAddr(keys.SystemSQLCodec.TablePrefix(tableID))
336+
s := ds.tc.ApplicationLayer(idx)
337+
cache := s.DistSenderI().(*kvcoord.DistSender).RangeDescriptorCache()
338+
tablePrefix := keys.MustAddr(s.Codec().TablePrefix(tableID))
346339
entry, err := cache.TestingGetCached(ctx, tablePrefix, false, roachpb.LAG_BY_CLUSTER_SETTING)
347340
if err != nil {
348341
return err.Error()
@@ -738,22 +731,22 @@ func (r *replicaPlacement) satisfiesExpectedPlacement(expected *replicaPlacement
738731
continue
739732
} else {
740733
return errors.Newf(
741-
"expected node %s to not be present but had replica type %s",
734+
"expected node %d to not be present but had replica type %s",
742735
node,
743736
actualRt.String())
744737
}
745738
}
746739

747740
if !found {
748741
return errors.Newf(
749-
"expected node %s to have replica type %s but was not found",
742+
"expected node %d to have replica type %s but was not found",
750743
node,
751744
expectedRt.String())
752745
}
753746

754747
if expectedRt != actualRt {
755748
return errors.Newf(
756-
"expected node %s to have replica type %s but was %s",
749+
"expected node %d to have replica type %s but was %s",
757750
node,
758751
expectedRt.String(),
759752
actualRt.String())
@@ -793,15 +786,16 @@ func getRangeKeyForInput(
793786
var db string
794787
d.ScanArgs(t, dbName, &db)
795788

796-
execCfg := tc.Server(0).ExecutorConfig().(sql.ExecutorConfig)
789+
s := tc.ApplicationLayer(0)
790+
execCfg := s.ExecutorConfig().(sql.ExecutorConfig)
797791

798792
tableDesc, err := lookupTable(&execCfg, db, tbName)
799793
if err != nil {
800794
return nil, err
801795
}
802796

803797
if !d.HasArg(partitionName) {
804-
return tableDesc.TableSpan(keys.SystemSQLCodec).Key, nil
798+
return tableDesc.TableSpan(s.Codec()).Key, nil
805799
}
806800

807801
var partition string
@@ -831,7 +825,7 @@ func getRangeKeyForInput(
831825

832826
_, keyPrefix, err := rowenc.DecodePartitionTuple(
833827
&tree.DatumAlloc{},
834-
keys.SystemSQLCodec,
828+
s.Codec(),
835829
tableDesc,
836830
primaryInd,
837831
part,

pkg/ccl/multiregionccl/multiregionccltestutils/testutils.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ func TestingCreateMultiRegionClusterWithRegionList(
135135
// is used to create the MR cluster for all test cases. For
136136
// bonus points, the code to re-enable this should also provide more
137137
// flexibility in disabling the default test tenant by callers of this
138-
// function. Re-enablement is tracked with #76378.
139-
DefaultTestTenant: base.TODOTestTenantDisabled,
138+
// function.
139+
DefaultTestTenant: base.TestDoesNotWorkWithSecondaryTenantsButWeDontKnowWhyYet(156308),
140140
},
141141
})
142142

pkg/ccl/multiregionccl/region_test.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@ import (
2828
"github.com/stretchr/testify/require"
2929
)
3030

31-
// startTestCluster starts a 3 node cluster.
32-
//
33-
// Note, if a testfeed depends on particular testing knobs, those may
34-
// need to be applied to each of the servers in the test cluster
35-
// returned from this function.
3631
func TestMultiRegionDatabaseStats(t *testing.T) {
3732
defer leaktest.AfterTest(t)()
3833
defer log.Scope(t).Close(t)

0 commit comments

Comments
 (0)