Skip to content

Commit 9cf523c

Browse files
upgrades: add 25.3 migration for hot range logging job
In #143775, we added a hot range logging job which is meant to run on multi-tenant clusters. Here we add the requisite migrations, to versions 25.3 and beyond to add the job to clusters. Fixes: #143527 Epic: CRDB-43150 Release note (general change): For multi-tenant deployments, changes hot range logging to be a job, run from a single node, rather than a task run from every node.
1 parent 061c2ab commit 9cf523c

File tree

25 files changed

+151
-22
lines changed

25 files changed

+151
-22
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,4 +418,4 @@ trace.zipkin.collector string the address of a Zipkin instance to receive trace
418418
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
419419
ui.default_timezone string the default timezone used to format timestamps in the ui application
420420
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
421-
version version 1000025.2-upgrading-to-1000025.3-step-006 set the active cluster version in the format '<major>.<minor>' application
421+
version version 1000025.2-upgrading-to-1000025.3-step-008 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
@@ -376,6 +376,6 @@
376376
<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>Serverless/Dedicated/Self-Hosted</td></tr>
377377
<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>Serverless/Dedicated/Self-Hosted</td></tr>
378378
<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>Serverless/Dedicated/Self-Hosted</td></tr>
379-
<tr><td><div id="setting-version" class="anchored"><code>version</code></div></td><td>version</td><td><code>1000025.2-upgrading-to-1000025.3-step-006</code></td><td>set the active cluster version in the format &#39;&lt;major&gt;.&lt;minor&gt;&#39;</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
379+
<tr><td><div id="setting-version" class="anchored"><code>version</code></div></td><td>version</td><td><code>1000025.2-upgrading-to-1000025.3-step-008</code></td><td>set the active cluster version in the format &#39;&lt;major&gt;.&lt;minor&gt;&#39;</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
380380
</tbody>
381381
</table>

pkg/ccl/spanconfigccl/spanconfigsqltranslatorccl/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ go_test(
3434
"//pkg/testutils/skip",
3535
"//pkg/testutils/sqlutils",
3636
"//pkg/testutils/testcluster",
37+
"//pkg/upgrade/upgradebase",
3738
"//pkg/util/leaktest",
3839
"//pkg/util/log",
3940
"//pkg/util/randutil",

pkg/ccl/spanconfigccl/spanconfigsqltranslatorccl/datadriven_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import (
3333
"github.com/cockroachdb/cockroach/pkg/testutils/skip"
3434
"github.com/cockroachdb/cockroach/pkg/testutils/sqlutils"
3535
"github.com/cockroachdb/cockroach/pkg/testutils/testcluster"
36+
"github.com/cockroachdb/cockroach/pkg/upgrade/upgradebase"
3637
"github.com/cockroachdb/cockroach/pkg/util/leaktest"
3738
"github.com/cockroachdb/cockroach/pkg/util/log"
3839
"github.com/cockroachdb/cockroach/pkg/util/syncutil"
@@ -120,6 +121,9 @@ func TestDataDriven(t *testing.T) {
120121
GCJob: gcTestingKnobs,
121122
SpanConfig: scKnobs,
122123
SQLExecutor: sqlExecutorKnobs,
124+
UpgradeManager: &upgradebase.TestingKnobs{
125+
SkipHotRangesLoggerJobBootstrap: true,
126+
},
123127
},
124128
StoreSpecs: []base.StoreSpec{
125129
{InMemory: true, Attributes: []string{attr}},

pkg/cli/testdata/doctor/test_examine_cluster

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ debug doctor examine cluster
33
debug doctor examine cluster
44
Examining 69 descriptors and 68 namespace entries...
55
ParentID 100, ParentSchemaID 101: relation "foo" (105): expected matching namespace entry, found none
6-
Examining 12 jobs...
6+
Examining 13 jobs...
77
ERROR: validation failed

pkg/cli/testdata/doctor/test_examine_cluster_dropped

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ debug doctor examine cluster
22
----
33
debug doctor examine cluster
44
Examining 68 descriptors and 68 namespace entries...
5-
Examining 10 jobs...
5+
Examining 11 jobs...
66
No problems found!

pkg/cli/testdata/doctor/test_examine_cluster_jobs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ Examining 68 descriptors and 69 namespace entries...
77
ParentID 183, ParentSchemaID 381: relation "foo" (104): expected matching namespace entry, found none
88
ParentID 183, ParentSchemaID 381: relation "foo" (104): mutation job 962952277419655169: job 962952277419655169 not found
99
ParentID 100, ParentSchemaID 101: namespace entry "foo" (104): mismatched name "foo" in relation descriptor
10-
Examining 10 jobs...
10+
Examining 11 jobs...
1111
ERROR: validation failed

pkg/clusterversion/cockroach_versions.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@ const (
217217
V25_3_AddEventLogColumnAndIndex
218218

219219
V25_3_AddEstimatedLastLoginTime
220+
221+
V25_3_AddHotRangeLoggerJob
220222
// *************************************************
221223
// Step (1) Add new versions above this comment.
222224
// Do not add new versions to a patch release.
@@ -275,6 +277,8 @@ var versionTable = [numKeys]roachpb.Version{
275277

276278
V25_3_AddEstimatedLastLoginTime: {Major: 25, Minor: 2, Internal: 6},
277279

280+
V25_3_AddHotRangeLoggerJob: {Major: 25, Minor: 2, Internal: 8},
281+
278282
// *************************************************
279283
// Step (2): Add new versions above this comment.
280284
// Do not add new versions to a patch release.

pkg/jobs/jobspb/wrap.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,8 @@ func WrapProgressDetails(details ProgressDetails) interface {
372372
return &Progress_StandbyReadTsPoller{StandbyReadTsPoller: &d}
373373
case SqlActivityFlushProgress:
374374
return &Progress_SqlActivityFlush{SqlActivityFlush: &d}
375+
case HotRangesLoggerProgress:
376+
return &Progress_HotRangesLogger{HotRangesLogger: &d}
375377
default:
376378
panic(errors.AssertionFailedf("WrapProgressDetails: unknown progress type %T", d))
377379
}

pkg/jobs/registry.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,10 @@ const (
321321
UpdateTableMetadataCacheJobID = jobspb.JobID(105)
322322

323323
SqlActivityFlushJobID = jobspb.JobID(106)
324+
325+
// HotRangesLoggerJobID A static job ID which is used for the
326+
// hot ranges logger job.
327+
HotRangesLoggerJobID = jobspb.JobID(107)
324328
)
325329

326330
// MakeJobID generates a new job ID.

0 commit comments

Comments
 (0)