diff --git a/pkg/cmd/roachtest/acceptance.go b/pkg/cmd/roachtest/acceptance.go index 37f2e2bed22e..10539eaf033c 100644 --- a/pkg/cmd/roachtest/acceptance.go +++ b/pkg/cmd/roachtest/acceptance.go @@ -46,7 +46,6 @@ func registerAcceptance(r *testRegistry) { {name: "status-server", fn: runStatusServer}, { name: "version-upgrade", - skip: "#43957", fn: runVersionUpgrade, // This test doesn't like running on old versions because it upgrades to // the latest released version and then it tries to "head", where head is diff --git a/pkg/server/server.go b/pkg/server/server.go index 14f26874f0ec..a651df723c0f 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -1599,10 +1599,23 @@ func (s *Server) Start(ctx context.Context) error { if migrationManagerTestingKnobs := s.cfg.TestingKnobs.SQLMigrationManager; migrationManagerTestingKnobs != nil { mmKnobs = *migrationManagerTestingKnobs.(*sqlmigrations.MigrationManagerTestingKnobs) } + migrationsExecutor := sql.MakeInternalExecutor( + ctx, s.pgServer.SQLServer, s.internalMemMetrics, s.ClusterSettings()) + migrationsExecutor.SetSessionData( + &sessiondata.SessionData{ + // Migrations need an executor with query distribution turned off. This is + // because the node crashes if migrations fail to execute, and query + // distribution introduces more moving parts. Local execution is more + // robust; for example, the DistSender has retries if it can't connect to + // another node, but DistSQL doesn't. Also see #44101 for why DistSQL is + // particularly fragile immediately after a node is started (i.e. the + // present situation). + DistSQLMode: sessiondata.DistSQLOff, + }) migMgr := sqlmigrations.NewManager( s.stopper, s.db, - s.internalExecutor, + &migrationsExecutor, s.clock, mmKnobs, s.NodeID().String(), diff --git a/pkg/sql/logictest/testdata/logic_test/event_log b/pkg/sql/logictest/testdata/logic_test/event_log index 5cffcdc6977b..77310a98ddcf 100644 --- a/pkg/sql/logictest/testdata/logic_test/event_log +++ b/pkg/sql/logictest/testdata/logic_test/event_log @@ -365,7 +365,7 @@ AND info NOT LIKE '%sql.stats.automatic_collection.enabled%' AND info NOT LIKE '%sql.defaults.vectorize%' ORDER BY "timestamp" ---- -0 1 {"SettingName":"diagnostics.reporting.enabled","Value":"true","User":"root"} +0 1 {"SettingName":"diagnostics.reporting.enabled","Value":"true","User":"node"} 0 1 {"SettingName":"kv.range_merge.queue_enabled","Value":"false","User":"root"} 0 1 {"SettingName":"sql.stats.automatic_collection.min_stale_rows","Value":"5","User":"root"} 0 1 {"SettingName":"kv.allocator.load_based_lease_rebalancing.enabled","Value":"false","User":"root"} diff --git a/pkg/sqlmigrations/migrations.go b/pkg/sqlmigrations/migrations.go index 48e7ab4128e4..96259efed98d 100644 --- a/pkg/sqlmigrations/migrations.go +++ b/pkg/sqlmigrations/migrations.go @@ -239,14 +239,14 @@ var backwardCompatibleMigrations = []migrationDescriptor{ includedInBootstrap: cluster.VersionByKey(cluster.Version19_2), workFn: func(ctx context.Context, r runner) error { // Note that these particular schema changes are idempotent. - if _, err := r.sqlExecutor.ExecWithUser(ctx, "update-reports-meta-generated", nil, /* txn */ - security.NodeUser, + if _, err := r.sqlExecutor.ExecEx(ctx, "update-reports-meta-generated", nil, /* txn */ + sqlbase.InternalExecutorSessionDataOverride{User: security.NodeUser}, `ALTER TABLE system.reports_meta ALTER generated TYPE TIMESTAMP WITH TIME ZONE`, ); err != nil { return err } - if _, err := r.sqlExecutor.ExecWithUser(ctx, "update-reports-meta-generated", nil, /* txn */ - security.NodeUser, + if _, err := r.sqlExecutor.ExecEx(ctx, "update-reports-meta-generated", nil, /* txn */ + sqlbase.InternalExecutorSessionDataOverride{User: security.NodeUser}, "ALTER TABLE system.replication_constraint_stats ALTER violation_start "+ "TYPE TIMESTAMP WITH TIME ZONE", ); err != nil { @@ -769,7 +769,12 @@ func runStmtAsRootWithRetry( // arbitrarily long time. var err error for retry := retry.Start(retry.Options{MaxRetries: 5}); retry.Next(); { - _, err := r.sqlExecutor.Exec(ctx, opName, nil /* txn */, stmt, qargs...) + _, err := r.sqlExecutor.ExecEx(ctx, opName, nil, /* txn */ + sqlbase.InternalExecutorSessionDataOverride{ + User: security.RootUser, + Database: "system", + }, + stmt, qargs...) if err == nil { break }