From aff5d218e74ed75d22c8291fc24a907705f799a0 Mon Sep 17 00:00:00 2001 From: Rafi Shamim Date: Mon, 12 Aug 2024 14:33:43 -0400 Subject: [PATCH] workload/schemachange: avoid commmenting on transient check constraints These check constraints are added temporarily while adding a non-nullable column. We have seen flakes caused by the workload trying to refer to them. Release note: None --- pkg/workload/schemachange/operation_generator.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/workload/schemachange/operation_generator.go b/pkg/workload/schemachange/operation_generator.go index 4523e65240b3..ea63cffef32d 100644 --- a/pkg/workload/schemachange/operation_generator.go +++ b/pkg/workload/schemachange/operation_generator.go @@ -2785,6 +2785,8 @@ func (og *operationGenerator) commentOn(ctx context.Context, tx pgx.Tx) (*opStmt SELECT 'INDEX ' || quote_ident(schema_name) || '.' || quote_ident(table_name) || '@' || quote_ident("index"->>'name') FROM indexes UNION ALL SELECT 'CONSTRAINT ' || quote_ident("constraint"->>'name') || ' ON ' || quote_ident(schema_name) || '.' || quote_ident(table_name) FROM constraints + -- Avoid temporary CHECK constraints created while adding NOT NULL columns. + WHERE "constraint"->>'name' NOT LIKE '%%auto_not_null' %s`, onType)) commentables, err := Collect(ctx, og, tx, pgx.RowTo[string], q)