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

sql: v20.2.1: foreign key does not exist during backfill #57376

Closed
cockroach-teamcity opened this issue Dec 2, 2020 · 1 comment
Closed

sql: v20.2.1: foreign key does not exist during backfill #57376

cockroach-teamcity opened this issue Dec 2, 2020 · 1 comment
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. O-sentry Originated from an in-the-wild panic report.

Comments

@cockroach-teamcity
Copy link
Member

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/2068446889/?referrer=webhooks_plugin

Panic message:

backfill.go:1885: foreign key × does not exist
--
*errutil.leafError: foreign key × does not exist (1)
backfill.go:1885: *withstack.withStack (top exception)
*assert.withAssertionFailure
(check the extra data payloads)

Stacktrace (expand for inline code snippets):

cockroach/pkg/sql/backfill.go

Lines 1884 to 1886 in fe9afec

if fk == nil {
return errors.AssertionFailedf("foreign key %s does not exist", fkName)
}
in pkg/sql.validateFkInTxn
case descpb.ConstraintToUpdate_FOREIGN_KEY:
if err := validateFkInTxn(ctx, sc.leaseMgr, &evalCtx.EvalContext, desc, txn, c.Name); err != nil {
return err
in pkg/sql.(*SchemaChanger).validateConstraints.func2.1
evalCtx := createSchemaChangeEvalCtx(ctx, sc.execCfg, readAsOf, sc.ieFactory)
return retryable(ctx, txn, &evalCtx)
})
in pkg/sql.(*SchemaChanger).makeFixedTimestampRunner.func1.1
txn.SetFixedTimestamp(ctx, readAsOf)
return retryable(ctx, txn)
})
in pkg/sql.(*SchemaChanger).fixedTimestampTxn.func1

cockroach/pkg/kv/db.go

Lines 706 to 708 in fe9afec

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

cockroach/pkg/kv/txn.go

Lines 810 to 812 in fe9afec

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

cockroach/pkg/kv/db.go

Lines 705 to 707 in fe9afec

txn.SetDebugName("unnamed")
err := txn.exec(ctx, func(ctx context.Context, txn *Txn) error {
return retryable(ctx, txn)
in pkg/kv.(*DB).Txn
) error {
return sc.db.Txn(ctx, func(ctx context.Context, txn *kv.Txn) error {
txn.SetFixedTimestamp(ctx, readAsOf)
in pkg/sql.(*SchemaChanger).fixedTimestampTxn
runner := func(ctx context.Context, retryable scTxnFn) error {
return sc.fixedTimestampTxn(ctx, readAsOf, func(ctx context.Context, txn *kv.Txn) error {
// We need to re-create the evalCtx since the txn may retry.
in pkg/sql.(*SchemaChanger).makeFixedTimestampRunner.func1
// Each check operates at the historical timestamp.
return runHistoricalTxn(ctx, func(ctx context.Context, txn *kv.Txn, evalCtx *extendedEvalContext) error {
// If the constraint is a check constraint that fails validation, we
in pkg/sql.(*SchemaChanger).validateConstraints.func2
g.wrapped.Go(func() error {
return f(g.ctx)
})
in pkg/util/ctxgroup.Group.GoCtx.func1
https://github.com/cockroachdb/cockroach/blob/fe9afecdaf3ffc41c6822897595e85451dad26f2/vendor/golang.org/x/sync/errgroup/errgroup.go#L56-L58 in golang.org/x/sync/errgroup.(*Group).Go.func1
/usr/local/go/src/runtime/asm_amd64.s#L1356-L1358 in runtime.goexit

pkg/sql/backfill.go in pkg/sql.validateFkInTxn at line 1885
pkg/sql/backfill.go in pkg/sql.(*SchemaChanger).validateConstraints.func2.1 at line 662
pkg/sql/backfill.go in pkg/sql.(*SchemaChanger).makeFixedTimestampRunner.func1.1 at line 133
pkg/sql/backfill.go in pkg/sql.(*SchemaChanger).fixedTimestampTxn.func1 at line 146
pkg/kv/db.go in pkg/kv.(*DB).Txn.func1 at line 707
pkg/kv/txn.go in pkg/kv.(*Txn).exec at line 811
pkg/kv/db.go in pkg/kv.(*DB).Txn at line 706
pkg/sql/backfill.go in pkg/sql.(*SchemaChanger).fixedTimestampTxn at line 144
pkg/sql/backfill.go in pkg/sql.(*SchemaChanger).makeFixedTimestampRunner.func1 at line 130
pkg/sql/backfill.go in pkg/sql.(*SchemaChanger).validateConstraints.func2 at line 644
pkg/util/ctxgroup/ctxgroup.go in pkg/util/ctxgroup.Group.GoCtx.func1 at line 166
vendor/golang.org/x/sync/errgroup/errgroup.go in golang.org/x/sync/errgroup.(*Group).Go.func1 at line 57
/usr/local/go/src/runtime/asm_amd64.s in runtime.goexit at line 1357
Tag Value
Cockroach Release v20.2.1
Cockroach SHA: fe9afec
Platform darwin amd64
Distribution CCL
Environment v20.2.1
Command server
Go Version ``
# of CPUs
# of Goroutines
@cockroach-teamcity cockroach-teamcity added C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. O-sentry Originated from an in-the-wild panic report. labels Dec 2, 2020
@yuzefovich yuzefovich changed the title sentry: backfill.go:1885: foreign key × does not exist -- *errutil.leafError: foreign key × does not exist (1) backfill.go:1885: *withstack.withStack (top exception) *assert.withAssertionFailure (check the extra data payloads) sql: v20.2.1: foreign key does not exist during backfill Dec 2, 2020
@jordanlewis
Copy link
Member

This is unactionable, so we're going to close until we see it again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. O-sentry Originated from an in-the-wild panic report.
Projects
None yet
Development

No branches or pull requests

2 participants