Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release-24.3: workload/schemachange: turn on exec logging for all statements #137811

Open
wants to merge 3 commits into
base: release-24.3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/workload/cli/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -595,8 +595,8 @@ func runRun(gen workload.Generator, urls []string, dbName string) error {
}
continue
}
// Log the error so we get the stack trace.
log.Errorf(ctx, "%v", err)
// Log the error with %+v so we get the stack trace.
log.Errorf(ctx, "workload run error: %+v", err)
return err

case <-ticker.C:
Expand Down
4 changes: 4 additions & 0 deletions pkg/workload/schemachange/operation_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -3141,6 +3141,10 @@ func (es *ErrorState) Unwrap() error {
return es.cause
}

func (es *ErrorState) Cause() error {
return es.cause
}

func (es *ErrorState) Error() string {
return es.cause.Error()
}
Expand Down
12 changes: 10 additions & 2 deletions pkg/workload/schemachange/schemachange.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,16 @@ func (s *schemaChange) Ops(
// setClusterSettings configures any settings required for the workload ahead
// of starting workers.
func (s *schemaChange) setClusterSettings(ctx context.Context, pool *workload.MultiConnPool) error {
_, err := pool.Get().Exec(ctx, `SET CLUSTER SETTING sql.defaults.super_regions.enabled = 'on'`)
return errors.WithStack(err)
for _, stmt := range []string{
`SET CLUSTER SETTING sql.defaults.super_regions.enabled = 'on'`,
`SET CLUSTER SETTING sql.log.all_statements.enabled = 'on'`,
} {
_, err := pool.Get().Exec(ctx, stmt)
if err != nil {
return errors.WithStack(err)
}
}
return nil
}

// initSeqName returns the smallest available sequence number to be
Expand Down