From 3f5d4f3f1f4a0871d1a1b5f02e7361b2c3fb3ca0 Mon Sep 17 00:00:00 2001 From: Rafi Shamim Date: Sun, 8 Dec 2024 05:59:18 +0000 Subject: [PATCH] catalog/descs: avoid log.Fatal for invalid descriptor error Rather tahn crashing the whole process, we can use an assertion error for this. The log.Fatal was initially added in 5d205ed62d5, in a time far before we were careful about avoiding node crashes. Release note: None --- pkg/sql/catalog/descs/leased_descriptors.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/sql/catalog/descs/leased_descriptors.go b/pkg/sql/catalog/descs/leased_descriptors.go index 4daa0794e944..0ebb2d3b5c96 100644 --- a/pkg/sql/catalog/descs/leased_descriptors.go +++ b/pkg/sql/catalog/descs/leased_descriptors.go @@ -161,7 +161,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())