From f1f0697bf7aecca98436f87179a3322dd6d3b207 Mon Sep 17 00:00:00 2001 From: Xiang Gu Date: Tue, 16 Aug 2022 14:12:16 -0400 Subject: [PATCH] upgrade: Added sessionData to TenantDeps to be used later --- pkg/upgrade/BUILD.bazel | 1 + pkg/upgrade/tenant_upgrade.go | 2 ++ pkg/upgrade/upgradejob/upgrade_job.go | 1 + 3 files changed, 4 insertions(+) diff --git a/pkg/upgrade/BUILD.bazel b/pkg/upgrade/BUILD.bazel index 9f36af240793..4d77c2971237 100644 --- a/pkg/upgrade/BUILD.bazel +++ b/pkg/upgrade/BUILD.bazel @@ -26,6 +26,7 @@ go_library( "//pkg/sql/catalog/descs", "//pkg/sql/catalog/lease", "//pkg/sql/catalog/resolver", + "//pkg/sql/sessiondata", "//pkg/sql/sqlutil", "//pkg/util/log", "//pkg/util/stop", diff --git a/pkg/upgrade/tenant_upgrade.go b/pkg/upgrade/tenant_upgrade.go index cd2ab925f979..f6ef9c1a80c7 100644 --- a/pkg/upgrade/tenant_upgrade.go +++ b/pkg/upgrade/tenant_upgrade.go @@ -24,6 +24,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/catalog/descs" "github.com/cockroachdb/cockroach/pkg/sql/catalog/lease" "github.com/cockroachdb/cockroach/pkg/sql/catalog/resolver" + "github.com/cockroachdb/cockroach/pkg/sql/sessiondata" "github.com/cockroachdb/cockroach/pkg/sql/sqlutil" "github.com/cockroachdb/logtags" ) @@ -38,6 +39,7 @@ type TenantDeps struct { LeaseManager *lease.Manager JobRegistry *jobs.Registry InternalExecutor sqlutil.InternalExecutor + SessionData *sessiondata.SessionData SpanConfig struct { // deps for span config upgrades; can be removed accordingly spanconfig.KVAccessor diff --git a/pkg/upgrade/upgradejob/upgrade_job.go b/pkg/upgrade/upgradejob/upgrade_job.go index 1ba74b08b6b3..902e6339ad69 100644 --- a/pkg/upgrade/upgradejob/upgrade_job.go +++ b/pkg/upgrade/upgradejob/upgrade_job.go @@ -97,6 +97,7 @@ func (r resumer) Resume(ctx context.Context, execCtxI interface{}) error { InternalExecutor: execCtx.ExecCfg().InternalExecutor, JobRegistry: execCtx.ExecCfg().JobRegistry, TestingKnobs: execCtx.ExecCfg().UpgradeTestingKnobs, + SessionData: execCtx.SessionData(), } tenantDeps.SpanConfig.KVAccessor = execCtx.ExecCfg().SpanConfigKVAccessor tenantDeps.SpanConfig.Splitter = execCtx.ExecCfg().SpanConfigSplitter