From 3d2aca6ee3b53c1419a7e54192d2d8e2217359ff Mon Sep 17 00:00:00 2001 From: Faizan Qazi Date: Tue, 9 Jul 2024 19:16:16 +0000 Subject: [PATCH] release-23.1: workload/schemachange: handle desc ID generator errors Previously, during migrations to version 23.1, if a descriptor ID generator error occurred during CREATE SCHEMA, the process would incorrectly fail in this test. This error is expected due to the addition of a new sequence for tracking descriptor IDs in version 23.1. To resolve this, this patch introduces logic to detect and ignore this error specifically for CREATE SCHEMA operations. Fixes: #126784 Release note: None --- pkg/workload/schemachange/operation_generator.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/workload/schemachange/operation_generator.go b/pkg/workload/schemachange/operation_generator.go index 4bac8c5408c9..0a05120e9674 100644 --- a/pkg/workload/schemachange/operation_generator.go +++ b/pkg/workload/schemachange/operation_generator.go @@ -3414,6 +3414,15 @@ func (og *operationGenerator) createSchema(ctx context.Context, tx pgx.Tx) (*opS if schemaExists && !ifNotExists { opStmt.expectedExecErrors.add(pgcode.DuplicateSchema) } + // Descriptor ID generator may be temporarily unavailable, so + // allow uncategorized errors temporarily. + potentialDescIDGeneratorError, err := maybeExpectPotentialDescIDGenerationError(ctx, tx) + if err != nil { + return nil, err + } + codesWithConditions{ + {code: pgcode.Uncategorized, condition: potentialDescIDGeneratorError}, + }.add(opStmt.potentialExecErrors) // TODO(jayshrivastava): Support authorization stmt := randgen.MakeSchemaName(ifNotExists, schemaName, tree.MakeRoleSpecWithRoleName(username.RootUserName().Normalized()))