Skip to content

backupccl: v21.2.4-customer: nil pointer in restoreResumer.cleanupTempSystemTables #76720

@cockroach-teamcity

Description

@cockroach-teamcity

This issue was autofiled by Sentry. It represents a crash or reported error on a live cluster with telemetry enabled.

Sentry link: https://sentry.io/organizations/cockroach-labs/issues/3022515119/?referrer=webhooks_plugin

Panic message:

panic.go:965: runtime error: invalid memory address or nil pointer dereference
--
runtime.errorString
panic.go:965: *withstack.withStack (top exception)

Stacktrace (expand for inline code snippets):

/usr/local/go/src/runtime/panic.go#L964-L966 in runtime.gopanic
/usr/local/go/src/runtime/panic.go#L211-L213 in runtime.panicmem
/usr/local/go/src/runtime/signal_unix.go#L733-L735 in runtime.sigpanic

func (r *restoreResumer) cleanupTempSystemTables(ctx context.Context, txn *kv.Txn) error {
executor := r.execCfg.InternalExecutor
// Check if the temp system database has already been dropped. This can happen
in pkg/ccl/backupccl.(*restoreResumer).cleanupTempSystemTables
// in `dropDescriptors` but we still need to drop the temporary system db.
return r.cleanupTempSystemTables(ctx, txn)
}
in pkg/ccl/backupccl.(*restoreResumer).OnFailOrCancel.func1
}
if err := f(ctx, txn, &descsCol); err != nil {
return err
in pkg/sql/catalog/descs.(*CollectionFactory).Txn.func2

cockroach/pkg/kv/db.go

Lines 835 to 837 in b4a27f3

err := txn.exec(ctx, func(ctx context.Context, txn *Txn) error {
return retryable(ctx, txn)
})
in pkg/kv.runTxn.func1

cockroach/pkg/kv/txn.go

Lines 907 to 909 in b4a27f3

}
err = fn(ctx, txn)
in pkg/kv.(*Txn).exec

cockroach/pkg/kv/db.go

Lines 834 to 836 in b4a27f3

func runTxn(ctx context.Context, txn *Txn, retryable func(context.Context, *Txn) error) error {
err := txn.exec(ctx, func(ctx context.Context, txn *Txn) error {
return retryable(ctx, txn)
in pkg/kv.runTxn

cockroach/pkg/kv/db.go

Lines 816 to 818 in b4a27f3

txn.SetDebugName("unnamed")
return runTxn(ctx, txn, retryable)
}
in pkg/kv.(*DB).Txn
var descsCol Collection
if err := db.Txn(ctx, func(ctx context.Context, txn *kv.Txn) error {
modifiedDescriptors = nil
in pkg/sql/catalog/descs.(*CollectionFactory).Txn

cockroach/pkg/sql/exec_util.go

Lines 3073 to 3075 in b4a27f3

) error {
return execCfg.CollectionFactory.Txn(ctx, execCfg.InternalExecutor, execCfg.DB, f)
}
in pkg/sql.DescsTxn
execCfg := execCtx.(sql.JobExecContext).ExecCfg()
if err := sql.DescsTxn(ctx, execCfg, func(
ctx context.Context, txn *kv.Txn, descsCol *descs.Collection,
in pkg/ccl/backupccl.(*restoreResumer).OnFailOrCancel

cockroach/pkg/jobs/registry.go

Lines 1269 to 1271 in b4a27f3

defer jm.CurrentlyRunning.Dec(1)
err = resumer.OnFailOrCancel(onFailOrCancelCtx, execCtx)
}()
in pkg/jobs.(*Registry).stepThroughStateMachine.func3

cockroach/pkg/jobs/registry.go

Lines 1270 to 1272 in b4a27f3

err = resumer.OnFailOrCancel(onFailOrCancelCtx, execCtx)
}()
if successOnFailOrCancel := err == nil; successOnFailOrCancel {
in pkg/jobs.(*Registry).stepThroughStateMachine

cockroach/pkg/jobs/adopt.go

Lines 414 to 416 in b4a27f3

// Run the actual job.
err := r.stepThroughStateMachine(ctx, execCtx, resumer, job, status, finalResumeError)
// If the context has been canceled, disregard errors for the sake of logging
in pkg/jobs.(*Registry).runJob

cockroach/pkg/jobs/adopt.go

Lines 335 to 337 in b4a27f3

// was one it's been set in the job status already.
_ = r.runJob(resumeCtx, resumer, job, status, job.taskName())
}); err != nil {
in pkg/jobs.(*Registry).resumeJob.func1
f(ctx)
}()
in pkg/util/stop.(*Stopper).RunAsyncTaskEx.func2
/usr/local/go/src/runtime/asm_amd64.s#L1370-L1372 in runtime.goexit

/usr/local/go/src/runtime/panic.go in runtime.gopanic at line 965
/usr/local/go/src/runtime/panic.go in runtime.panicmem at line 212
/usr/local/go/src/runtime/signal_unix.go in runtime.sigpanic at line 734
pkg/ccl/backupccl/restore_job.go in pkg/ccl/backupccl.(*restoreResumer).cleanupTempSystemTables at line 2429
pkg/ccl/backupccl/restore_job.go in pkg/ccl/backupccl.(*restoreResumer).OnFailOrCancel.func1 at line 1939
pkg/sql/catalog/descs/txn.go in pkg/sql/catalog/descs.(*CollectionFactory).Txn.func2 at line 84
pkg/kv/db.go in pkg/kv.runTxn.func1 at line 836
pkg/kv/txn.go in pkg/kv.(*Txn).exec at line 908
pkg/kv/db.go in pkg/kv.runTxn at line 835
pkg/kv/db.go in pkg/kv.(*DB).Txn at line 817
pkg/sql/catalog/descs/txn.go in pkg/sql/catalog/descs.(*CollectionFactory).Txn at line 76
pkg/sql/exec_util.go in pkg/sql.DescsTxn at line 3074
pkg/ccl/backupccl/restore_job.go in pkg/ccl/backupccl.(*restoreResumer).OnFailOrCancel at line 1909
pkg/jobs/registry.go in pkg/jobs.(*Registry).stepThroughStateMachine.func3 at line 1270
pkg/jobs/registry.go in pkg/jobs.(*Registry).stepThroughStateMachine at line 1271
pkg/jobs/adopt.go in pkg/jobs.(*Registry).runJob at line 415
pkg/jobs/adopt.go in pkg/jobs.(*Registry).resumeJob.func1 at line 336
pkg/util/stop/stopper.go in pkg/util/stop.(*Stopper).RunAsyncTaskEx.func2 at line 442
/usr/local/go/src/runtime/asm_amd64.s in runtime.goexit at line 1371
Tag Value
Cockroach Release v21.2.4-53-gb4a27f3634
Cockroach SHA: b4a27f3
Platform linux amd64
Distribution CCL
Environment development
Command server
Go Version ``
# of CPUs
# of Goroutines

Jira issue: CRDB-13247

Metadata

Metadata

Assignees

Labels

C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.O-sentryOriginated from an in-the-wild panic report.T-disaster-recovery

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions