Skip to content

Commit

Permalink
catalog/descs: avoid log.Fatal for invalid descriptor error
Browse files Browse the repository at this point in the history
Rather tahn 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.

Release note: None
  • Loading branch information
rafiss committed Dec 8, 2024
1 parent ccaed97 commit bf6cbf6
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 bf6cbf6

Please sign in to comment.