Skip to content

Commit b9ddf79

Browse files
committed
sql: remove now-stale growstack for internal executor
As of 4a5c503, we now grow stack unconditionally for all async tasks. Some time ago we added an ability to growstack in the async task of the internal executor when used in the LDR, and now that has become redundant, so we remove this special case. Release note: None
1 parent 99e7c38 commit b9ddf79

File tree

4 files changed

+1
-17
lines changed

4 files changed

+1
-17
lines changed

pkg/crosscluster/logical/lww_row_processor.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -407,10 +407,6 @@ var (
407407
// Use generic query plans since our queries are extremely simple and
408408
// won't benefit from custom plans.
409409
PlanCacheMode: &forceGenericPlan,
410-
// We've observed in the CPU profiles that the default goroutine stack
411-
// of the connExecutor goroutine is insufficient for evaluation of the
412-
// ingestion queries, so we grow the stack right away to 32KiB.
413-
GrowStackSize: true,
414410
// We don't get any benefits from generating plan gists for internal
415411
// queries, so we disable them.
416412
DisablePlanGists: true,

pkg/sql/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,6 @@ go_library(
575575
"//pkg/util/errorutil",
576576
"//pkg/util/errorutil/unimplemented",
577577
"//pkg/util/fsm",
578-
"//pkg/util/growstack",
579578
"//pkg/util/grpcutil",
580579
"//pkg/util/grunning",
581580
"//pkg/util/hlc",

pkg/sql/internal.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ import (
3939
"github.com/cockroachdb/cockroach/pkg/sql/sqltelemetry"
4040
"github.com/cockroachdb/cockroach/pkg/sql/types"
4141
"github.com/cockroachdb/cockroach/pkg/util/fsm"
42-
"github.com/cockroachdb/cockroach/pkg/util/growstack"
4342
"github.com/cockroachdb/cockroach/pkg/util/log"
4443
"github.com/cockroachdb/cockroach/pkg/util/mon"
4544
"github.com/cockroachdb/cockroach/pkg/util/retry"
@@ -223,7 +222,6 @@ func (ie *InternalExecutor) runWithEx(
223222
syncCallback func([]*streamingCommandResult),
224223
errCallback func(error),
225224
attributeToUser bool,
226-
growStackSize bool,
227225
) error {
228226
ex, err := ie.initConnEx(ctx, txn, w, mode, sd, stmtBuf, syncCallback, attributeToUser)
229227
if err != nil {
@@ -251,11 +249,6 @@ func (ie *InternalExecutor) runWithEx(
251249
go func() {
252250
defer hdl.Activate(ctx).Release(ctx)
253251
defer cleanup(ctx)
254-
// TODO(yuzefovich): benchmark whether we should be growing the
255-
// stack size unconditionally.
256-
if growStackSize {
257-
growstack.Grow()
258-
}
259252
if err := ex.run(
260253
ctx,
261254
ie.mon,
@@ -1196,7 +1189,6 @@ func (ie *InternalExecutor) execInternal(
11961189
txn.SetBufferedWritesEnabled(false)
11971190
}
11981191
attributeToUser := sessionDataOverride.AttributeToUser && attributeToUserEnabled.Get(&ie.s.cfg.Settings.SV)
1199-
growStackSize := sessionDataOverride.GrowStackSize
12001192
if !rw.async() && (txn != nil && txn.Type() == kv.RootTxn) {
12011193
// If the "outer" query uses the RootTxn and the sync result channel is
12021194
// requested, then we must disable both DistSQL and Streamer to ensure
@@ -1308,7 +1300,7 @@ func (ie *InternalExecutor) execInternal(
13081300
errCallback := func(err error) {
13091301
_ = rw.addResult(ctx, ieIteratorResult{err: err})
13101302
}
1311-
err = ie.runWithEx(ctx, opName, txn, rw, mode, sd, stmtBuf, &wg, syncCallback, errCallback, attributeToUser, growStackSize)
1303+
err = ie.runWithEx(ctx, opName, txn, rw, mode, sd, stmtBuf, &wg, syncCallback, errCallback, attributeToUser)
13121304
if err != nil {
13131305
return nil, err
13141306
}

pkg/sql/sessiondata/internal.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ type InternalExecutorOverride struct {
7979
OriginTimestampForLogicalDataReplication hlc.Timestamp
8080
// PlanCacheMode, if set, overrides the plan_cache_mode session variable.
8181
PlanCacheMode *sessiondatapb.PlanCacheMode
82-
// GrowStackSize, if true, indicates that the connExecutor goroutine stack
83-
// should be grown to 32KiB right away.
84-
GrowStackSize bool
8582
// DisablePlanGists, if true, overrides the disable_plan_gists session var.
8683
DisablePlanGists bool
8784
// BufferedWritesEnabled, if set, controls whether the buffered writes KV transaction

0 commit comments

Comments
 (0)