Skip to content

Commit

Permalink
release-23.1: workload/schemachange: handle desc ID generator errors
Browse files Browse the repository at this point in the history
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
  • Loading branch information
fqazi committed Jul 9, 2024
1 parent fbcb992 commit 08bc520
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/workload/schemachange/operation_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
Expand Down

0 comments on commit 08bc520

Please sign in to comment.