Skip to content

Commit

Permalink
Merge #136978
Browse files Browse the repository at this point in the history
136978: catalog/descs: avoid log.Fatal for invalid descriptor error r=rafiss a=rafiss

Rather than crashing the whole process, we can use an assertion error for this. The log.Fatal was initially added in 5d205ed, in a time far before we were careful about avoiding node crashes.

fixes #136962
fixes #136961

Release note: None

Co-authored-by: Rafi Shamim <[email protected]>
  • Loading branch information
craig[bot] and rafiss committed Dec 9, 2024
2 parents 0b43622 + bf6cbf6 commit 7f75f3e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/sql/catalog/descs/leased_descriptors.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ func (ld *leasedDescriptors) getResult(
expiration := ldesc.Expiration(ctx)
readTimestamp := txn.ReadTimestamp()
if expiration.LessEq(txn.ReadTimestamp()) {
log.Fatalf(ctx, "bad descriptor for T=%s, expiration=%s", readTimestamp, expiration)
return nil, false, errors.AssertionFailedf("bad descriptor for id=%d readTimestamp=%s, expiration=%s", ldesc.GetID(), readTimestamp, expiration)
}

ld.cache.Upsert(ldesc, ldesc.Underlying().SkipNamespace())
Expand Down

0 comments on commit 7f75f3e

Please sign in to comment.