diff --git a/pkg/server/server.go b/pkg/server/server.go index 18f45ed8c34b..ef8a0b3ec02d 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -805,15 +805,6 @@ func NewServer(cfg Config, stopper *stop.Stopper) (*Server, error) { internalExecutor, ) - // Configure the path to the file that blocks starting background jobs. - var jobAdoptionStopFile string - for _, spec := range cfg.Stores.Specs { - if !spec.InMemory && spec.Path != "" { - jobAdoptionStopFile = filepath.Join(spec.Path, jobs.PreventAdoptionFile) - break - } - } - // Instantiate the KV prober. kvProber := kvprober.NewProber(kvprober.Opts{ Tracer: cfg.AmbientCtx.Tracer, @@ -879,7 +870,6 @@ func NewServer(cfg Config, stopper *stop.Stopper) (*Server, error) { circularInternalExecutor: internalExecutor, internalExecutorFactory: internalExecutorFactory, circularJobRegistry: jobRegistry, - jobAdoptionStopFile: jobAdoptionStopFile, protectedtsProvider: protectedtsProvider, rangeFeedFactory: rangeFeedFactory, sqlStatusServer: sStatus, diff --git a/pkg/server/server_sql.go b/pkg/server/server_sql.go index ae83f379e413..643e66bd25f3 100644 --- a/pkg/server/server_sql.go +++ b/pkg/server/server_sql.go @@ -325,7 +325,6 @@ type sqlServerArgs struct { // pointer to an empty struct in this configuration, which newSQLServer // fills. circularJobRegistry *jobs.Registry - jobAdoptionStopFile string // The executorConfig uses the provider. protectedtsProvider protectedts.Provider @@ -442,6 +441,15 @@ func newSQLServer(ctx context.Context, cfg sqlServerArgs) (*SQLServer, error) { codec = keys.MakeSQLCodec(override) } } + + var jobAdoptionStopFile string + for _, spec := range cfg.Stores.Specs { + if !spec.InMemory && spec.Path != "" { + jobAdoptionStopFile = filepath.Join(spec.Path, jobs.PreventAdoptionFile) + break + } + } + // Create blob service for inter-node file sharing. blobService, err := blobs.NewBlobService(cfg.Settings.ExternalIODir) if err != nil { @@ -531,7 +539,7 @@ func newSQLServer(ctx context.Context, cfg sqlServerArgs) (*SQLServer, error) { // in sql/jobs/registry.go on planHookMaker. return sql.MakeJobExecContext(opName, user, &sql.MemoryMetrics{}, execCfg) }, - cfg.jobAdoptionStopFile, + jobAdoptionStopFile, td, jobsKnobs, )