Skip to content

Commit 9ab7ea1

Browse files
craig[bot]angles-n-daemonskyle-a-wong
committed
145549: upgrades: add 25.3 migration for hot range logging job r=angles-n-daemons a=angles-n-daemons 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): Adds a migration to start the hot range logging job. 147769: log, server: Create new log.EventLog() API r=dhartunian a=kyle-a-wong This PR introduces a new log.EventLog() API that gives first class support for writing to the system.eventlog table. This API lives in the log package and doesn't have a dependency on the sql package, making it easy to use across the repo. This is implemented using a new set of interfaces in the log package that allows the system and tenant servers to register new event log writers. The logic for writing to the event log table is the same as that which is sql/event_log.go. For now the code is duplicated, but it will be removed in a future commit when this file is updated to use the new API. Epic: [CRDB-42978](https://cockroachlabs.atlassian.net/browse/CRDB-42978) Release note: None Co-authored-by: Brian Dillmann <[email protected]> Co-authored-by: Kyle Wong <[email protected]>
3 parents 0a44fb9 + 9cf523c + fae8c94 commit 9ab7ea1

Some content is hidden

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

53 files changed

+927
-60
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/BUILD.bazel

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -753,6 +753,7 @@ ALL_TESTS = [
753753
"//pkg/util/json:json_test",
754754
"//pkg/util/jsonpath/parser:parser_test",
755755
"//pkg/util/limit:limit_test",
756+
"//pkg/util/log/eventlog:eventlog_test",
756757
"//pkg/util/log/eventpb:eventpb_test",
757758
"//pkg/util/log/logconfig:logconfig_test",
758759
"//pkg/util/log/logcrash:logcrash_test",
@@ -2624,6 +2625,8 @@ GO_TARGETS = [
26242625
"//pkg/util/limit:limit",
26252626
"//pkg/util/limit:limit_test",
26262627
"//pkg/util/log/channel:channel",
2628+
"//pkg/util/log/eventlog:eventlog",
2629+
"//pkg/util/log/eventlog:eventlog_test",
26272630
"//pkg/util/log/eventpb/eventpbgen:eventpbgen",
26282631
"//pkg/util/log/eventpb/eventpbgen:eventpbgen_lib",
26292632
"//pkg/util/log/eventpb:eventpb",

pkg/base/serverident/server_ident.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ type ServerIdentificationPayload interface {
5050
ServerIdentityString(key ServerIdentificationKey) string
5151
}
5252

53+
type ServerIdentifier interface {
54+
GetServerIdentificationPayload() ServerIdentificationPayload
55+
}
56+
5357
// ServerIdentificationKey represents a possible parameter to the
5458
// ServerIdentityString() method in ServerIdentificationPayload.
5559
type ServerIdentificationKey int

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/ccl/telemetryccl/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ go_test(
3030
"//pkg/testutils/testcluster",
3131
"//pkg/util/leaktest",
3232
"//pkg/util/log",
33+
"//pkg/util/log/eventlog",
3334
"//pkg/util/log/eventpb",
3435
"//pkg/util/log/logpb",
3536
"//pkg/util/log/logtestutils",

pkg/ccl/telemetryccl/telemetry_logging_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
"github.com/cockroachdb/cockroach/pkg/testutils/sqlutils"
2929
"github.com/cockroachdb/cockroach/pkg/util/leaktest"
3030
"github.com/cockroachdb/cockroach/pkg/util/log"
31+
"github.com/cockroachdb/cockroach/pkg/util/log/eventlog"
3132
"github.com/cockroachdb/cockroach/pkg/util/log/eventpb"
3233
"github.com/cockroachdb/cockroach/pkg/util/log/logpb"
3334
"github.com/cockroachdb/cockroach/pkg/util/log/logtestutils"
@@ -218,7 +219,7 @@ func TestBulkJobTelemetryLogging(t *testing.T) {
218219
testCluster := serverutils.StartCluster(t, 1, base.TestClusterArgs{
219220
ServerArgs: base.TestServerArgs{
220221
Knobs: base.TestingKnobs{
221-
EventLog: &sql.EventLogTestingKnobs{
222+
EventLog: &eventlog.EventLogTestingKnobs{
222223
// The sampling checks below need to have a deterministic
223224
// number of statements run by internal executor.
224225
SyncWrites: true,

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!

0 commit comments

Comments
 (0)