Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
91100: logictest: only run create_as_non_metamorphic under local r=ajwerner a=ajwerner

This test is very expensive because it was writing 100Mib of data. It now writes more like 10. Nevertheless, let's not run it in so many places. I did verify that it still tests what it was intended to test.

Fixes #91080

Release note: None

91253: ui: fiz size chart when first load r=maryliag a=maryliag

Previously, the chart sizes were being properly
updated when resized, but the initial value was not correct.
This commit adds the call to handle resize so it
can load the correct size on first load.

Fix #91207

https://www.loom.com/share/3faf00b251e849d59120ce0b6e94047f

Release note: None

91283: ui: add horizontal scroll txn insight details r=maryliag a=maryliag

Previously, the table of "waiten on" inside the Transaction Insights details didn't have a horizontal scroll, not letting the user to see the full page on CC console. This commits adds the proper scroll to it.

Fixes #91199

Before
https://www.loom.com/share/80437381cd4546cfad9692c7718de38c

After
https://www.loom.com/share/7363d53bec1d49a0be1b90ab0c9069f2

Release note (bug fix): Add horizontal scroll on "waited on" table on Transaction Insight details page.

91307: scbuild: error on duplicate columns in ALTER PRIMARY KEY r=ajwerner a=postamar

This check has been missing from the declarative schema changer builder. This would result in execution errors in later stages when the new index makes it into the table descriptor. Since these are internal errors, the user experience is correspondingly poor. This patch fixes this.

Fixes #91301

Release note (bug fix): fixed a bug present only in earlier 22.2 release candidates, in which an ALTER PRIMARY KEY USING COLUMNS (x, x) statement would result in an internal error instead of the expected user-facing error with a pg-code.

91443: colexecop: remove stale TODO r=yuzefovich a=yuzefovich

This commit removes now-stale TODO about `Closer.Close` being safe to execute even after `Release` call. The root cause was the intertwining of planning and execution infrastructure and has been recently addressed in #89052.

Epic: None

Release note: None

91446: colexec: protect columnarizer when closing not started input r=yuzefovich a=yuzefovich

This commit makes sure that the columnarizer calls `InternalClose` only if it has been initialized. Previously, if `Columnarizer.Init` wasn't performed (most likely due to a panic in `Init` of another operator), the columnarizer's input would not be started, so when `InternalClose` called `input.ConsumerClosed`, that could lead to a nil pointer panic since `input.Ctx` would be `nil` if the input tried to do some logging (some processors do that). We now protect against this by short-circuiting `InternalClose` call altogether, similar to what we do in `Columnarizer.DrainMeta`. This makes it so that the columnarizer satisfies `Closer.Close` contract properly.

Fixes: #84902.

Release note: None

91450: workload/schemachange: address intermittent failures with select stmts r=fqazi a=fqazi

Fixes: #91445

Previously, we added logic to detect memory budget, and disk budget errors but those were only when opening a result set. Unfortunately, these errors can also be hit when consuming the rows themselves. To address this, this patch will detect the same errors and ignore them if detected consuming the result set.

Release note: None

Co-authored-by: Andrew Werner <[email protected]>
Co-authored-by: maryliag <[email protected]>
Co-authored-by: Marius Posta <[email protected]>
Co-authored-by: Yahor Yuzefovich <[email protected]>
Co-authored-by: Faizan Qazi <[email protected]>
  • Loading branch information
6 people committed Nov 8, 2022
8 parents db8f691 + 4082a28 + 2a890cf + af4d9da + 3a3123d + 619f45e + 4ab5ce9 + a66093a commit 666fdee
Show file tree
Hide file tree
Showing 17 changed files with 38 additions and 57 deletions.
7 changes: 0 additions & 7 deletions pkg/ccl/logictestccl/tests/3node-tenant/generated_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions pkg/sql/colexec/columnarizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,13 @@ func (c *Columnarizer) Close(context.Context) error {
return nil
}
c.helper.Release()
if c.Ctx == nil {
// The columnarizer wasn't initialized, so the wrapped processors might
// not have been started leaving them in a state unsafe for the
// InternalClose, so we skip that. Mostly likely this happened because a
// panic was encountered in Init.
return nil
}
c.InternalClose()
return nil
}
Expand Down
5 changes: 0 additions & 5 deletions pkg/sql/colexecop/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,6 @@ type Closer interface {
// (wherever necessary) by the implementation. This is so since the span in
// the context from Init() might be already finished when Close() is called
// whereas the argument context will contain an unfinished span.
//
// If this Closer is an execinfra.Releasable, the implementation must be
// safe to execute even after Release() was called.
// TODO(yuzefovich): refactor this because the Release()'d objects should
// not be used anymore.
Close(context.Context) error
}

Expand Down
5 changes: 1 addition & 4 deletions pkg/sql/colfetcher/index_join.go
Original file line number Diff line number Diff line change
Expand Up @@ -682,9 +682,6 @@ func (s *ColIndexJoin) closeInternal() {
// span.
ctx := s.EnsureCtx()
s.cf.Close(ctx)
if s.spanAssembler != nil {
// spanAssembler can be nil if Release() has already been called.
s.spanAssembler.Close()
}
s.spanAssembler.Close()
s.batch = nil
}
3 changes: 3 additions & 0 deletions pkg/sql/logictest/testdata/logic_test/alter_primary_key
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ CREATE TABLE t (x INT PRIMARY KEY, y INT NOT NULL, z INT NOT NULL, w INT, INDEX
statement ok
INSERT INTO t VALUES (1, 2, 3, 4), (5, 6, 7, 8)

statement error pgcode 0A000 .* contains duplicate column \"y\"
ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (y, y)

statement ok
ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (y, z)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# LogicTest: !metamorphic-batch-sizes
# LogicTest: !metamorphic-batch-sizes local
# Disabled to allow us to validate create as with large batch sizes.

# Regression test for #81554, where tried to do gigantic batches for CTAS in
# explicit transactions. Use a fixed command size, so that an error is decoupled
# fom the default size.
statement ok
SET CLUSTER SETTING kv.raft.command.max_size='5m'
SET CLUSTER SETTING kv.raft.command.max_size='4.01MiB'

statement ok
BEGIN;
CREATE TABLE source_tbl_huge AS SELECT 1::CHAR(256) FROM generate_series(1, 500000);
CREATE TABLE source_tbl_huge AS SELECT 1::CHAR(256) FROM generate_series(1, 50000);
COMMIT;

statement ok
Expand Down
7 changes: 0 additions & 7 deletions pkg/sql/logictest/tests/fakedist-disk/generated_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions pkg/sql/logictest/tests/fakedist-vec-off/generated_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions pkg/sql/logictest/tests/fakedist/generated_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions pkg/sql/logictest/tests/local-vec-off/generated_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ func checkForEarlyExit(b BuildCtx, tbl *scpb.Table, t alterPrimaryKeySpec) {
panic(err)
}

usedColumns := make(map[tree.Name]bool, len(t.Columns))
for _, col := range t.Columns {
if col.Column == "" && col.Expr != nil {
panic(errors.WithHint(
Expand All @@ -219,6 +220,11 @@ func checkForEarlyExit(b BuildCtx, tbl *scpb.Table, t alterPrimaryKeySpec) {
"use columns instead",
))
}
if usedColumns[col.Column] {
panic(pgerror.Newf(pgcode.FeatureNotSupported,
"new primary key contains duplicate column %q", col.Column))
}
usedColumns[col.Column] = true

colElems := b.ResolveColumn(tbl.TableID, col.Column, ResolveParams{
IsExistenceOptional: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export class TransactionInsightDetails extends React.Component<TransactionInsigh
insightDetails.execType,
)}
</Heading>
<div className={tableCx("margin-bottom-large")}>
<div className={tableCx("table-area")}>
<WaitTimeDetailsTable
data={blockingExecutions}
execType={insightDetails.execType}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
}
}

.table-area {
overflow-x: scroll;
padding-bottom: 30px;
}

.margin-bottom {
margin-bottom: 20px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ export class StatementDetails extends React.Component<
}

componentDidUpdate(prevProps: StatementDetailsProps): void {
this.handleResize();
if (
prevProps.timeScale != this.props.timeScale ||
prevProps.statementFingerprintID != this.props.statementFingerprintID ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ $subnav-background = $background-color

.section
flex 0 0 auto
padding 12px 24px 12px 0px
max-width $max-window-width
padding 12px 40px 12px 0px
clearfix()

&--heading
Expand Down
10 changes: 10 additions & 0 deletions pkg/workload/schemachange/operation_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -3537,6 +3537,16 @@ func (og *operationGenerator) selectStmt(ctx context.Context, tx pgx.Tx) (stmt *
}
}
if err := rows.Err(); err != nil {
pgErr := new(pgconn.PgError)
// For select statements, we can have out of memory or temporary
// space errors at runtime when fetching the result set. So,
// deal with the min here.
if errors.As(err, &pgErr) &&
stmt.potentialExecErrors.contains(pgcode.MakeCode(pgErr.Code)) {
return errors.Mark(errors.Wrap(err, "ROLLBACK; Successfully got expected execution error."),
errRunInTxnRbkSentinel,
)
}
return err
}
return nil
Expand Down

0 comments on commit 666fdee

Please sign in to comment.