GithubHelp home page GithubHelp logo

Comments (7)

annrpom avatar annrpom commented on August 17, 2024

Seen https://github.com/cockroachlabs/support/issues/2998

from cockroach.

annrpom avatar annrpom commented on August 17, 2024

As a follow-up, we should ensure other jobs kicked off by schema changes also get this override.

To tag on, we might want to audit if other session variables would land us in a similar spot.

from cockroach.

annrpom avatar annrpom commented on August 17, 2024

Actually, we can just make all background jobs ignore the statement timeout in here

cockroach/pkg/sql/internal.go

Lines 1131 to 1150 in b9680b4

var sd *sessiondata.SessionData
if ie.sessionDataStack != nil {
// TODO(andrei): Properly clone (deep copy) ie.sessionData.
sd = ie.sessionDataStack.Top().Clone()
} else {
sd = NewInternalSessionData(context.Background(), ie.s.cfg.Settings, "" /* opName */)
}
if globalOverride := ieMultiOverride.Get(&ie.s.cfg.Settings.SV); globalOverride != "" {
globalOverride = strings.TrimSpace(globalOverride)
// Prepend the "global" setting overrides to ensure that caller's
// overrides take precedence.
if localOverride := sessionDataOverride.MultiOverride; localOverride != "" {
sessionDataOverride.MultiOverride = globalOverride + "," + localOverride
} else {
sessionDataOverride.MultiOverride = globalOverride
}
}
applyInternalExecutorSessionExceptions(sd)
applyOverrides(sessionDataOverride, sd)

ref: https://cockroachlabs.slack.com/archives/C04N0AS14CT/p1719416225444619?thread_ts=1719410054.255929&cid=C04N0AS14CT

from cockroach.

rafiss avatar rafiss commented on August 17, 2024

I think this diff might be what we want. We could update the comment on NewInternalSessionData to indicate this.

diff --git a/pkg/sql/internal.go b/pkg/sql/internal.go
index 24685b16219..cfb161132b4 100644
--- a/pkg/sql/internal.go
+++ b/pkg/sql/internal.go
@@ -95,6 +95,7 @@ func NewInternalSessionData(
 	sd.SearchPath = sessiondata.DefaultSearchPathForUser(username.NodeUserName())
 	sd.SequenceState = sessiondata.NewSequenceState()
 	sd.Location = time.UTC
+	sd.StmtTimeout = 0
 	return sd
 }

from cockroach.

rafiss avatar rafiss commented on August 17, 2024

For people who are affected by this right now, we can recommend that they configure the default statement_timeout using ALTER ROLE ALL SET statement_timeout = ... rather than the sql.defaults.statement_timeout cluster setting.

from cockroach.

annrpom avatar annrpom commented on August 17, 2024

i'll leave this open until i take care of my backports

from cockroach.

annrpom avatar annrpom commented on August 17, 2024

Re-opening as per https://cockroachlabs.slack.com/archives/C0168LW5THS/p1723150249619579

from cockroach.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.