Skip to content

opt: store and display mutation arbiter indexes in opt tests and EXPLAIN#53172

Merged
craig[bot] merged 2 commits into
cockroachdb:masterfrom
mgartner:show-arbiters
Aug 31, 2020
Merged

opt: store and display mutation arbiter indexes in opt tests and EXPLAIN#53172
craig[bot] merged 2 commits into
cockroachdb:masterfrom
mgartner:show-arbiters

Conversation

@mgartner

@mgartner mgartner commented Aug 21, 2020

Copy link
Copy Markdown
Contributor

opt: store mutation arbiter indexes and display in opt tests

This commit adds the list of arbiter indexes to opt test expression
trees. In order to facilitate this, the list of index ordinals that are
arbiters are stored on MutationPrivate for Upsert and Insert
expressions.

This commit also formats the canary column for UPSERTs like other
columns, instead of a plain column ID.

Additionally, the optgen error message produced when referencing a
type in an *.opt file that has not been registered is now less
ambiguous. With the previous error message it was unclear if it was
referencing opt/metadata.go or optgen/metadata.go.

Release justification: low-risk update to new functionality

Release note: None

opt: display arbiter indexes in EXPLAIN output

This commit adds a list of arbiter indexes to EXPLAIN output for UPSERT
and INSERT ON CONFLICT statements. These arbiters are used to detect
conflicts.

Release justification: low-risk update to new functionality

Release note (sql change): The output of EXPLAIN for UPSERT and INSERT
ON CONFLICT statements now includes a list of arbiter indexes. These
arbiters are the indexes used for detecting conflicts between the insert
row and the existing rows in the table.

@mgartner mgartner requested a review from a team as a code owner August 21, 2020 01:12
@cockroach-teamcity

Copy link
Copy Markdown
Member

This change is Reviewable

@RaduBerinde

Copy link
Copy Markdown
Member

LGTM

I'd also plumb them through to the exec factory so they can be shown in the regular EXPLAIN. These changes can be backported after the branching though, they're very low risk.

@mgartner mgartner force-pushed the show-arbiters branch 2 times, most recently from c884082 to 6f36167 Compare August 25, 2020 20:41
@mgartner

Copy link
Copy Markdown
Contributor Author

I've added the arbiters to EXPLAIN output. Is it odd that they are displayed in EXPLAIN and EXPLAIN (OPT, VERBOSE), but not in EXPLAIN (OPT)? Happy to add them to EXPLAIN (OPT) if so.

@mgartner mgartner force-pushed the show-arbiters branch 2 times, most recently from 13d4351 to 2e67b88 Compare August 26, 2020 00:51
@mgartner mgartner changed the title opt: store mutation arbiter indexes and display in opt tests opt: store and display mutation arbiter indexes in opt tests and EXPLAIN Aug 26, 2020

@RaduBerinde RaduBerinde left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! I think it's fine to omit in non-verbose EXPLAIN (OPT).

@mgartner

Copy link
Copy Markdown
Contributor Author

bors r=RaduBerinde

@craig

craig Bot commented Aug 27, 2020

Copy link
Copy Markdown
Contributor

Build failed (retrying...):

@craig

craig Bot commented Aug 27, 2020

Copy link
Copy Markdown
Contributor

Build failed (retrying...):

@craig

craig Bot commented Aug 27, 2020

Copy link
Copy Markdown
Contributor

Build failed (retrying...):

@craig

craig Bot commented Aug 28, 2020

Copy link
Copy Markdown
Contributor

Build failed:

This commit adds the list of arbiter indexes to opt test expression
trees. In order to facilitate this, the list of index ordinals that are
arbiters are stored on `MutationPrivate` for `Upsert` and `Insert`
expressions.

This commit also formats the canary column for `UPSERT`s like other
columns, instead of a plain column ID.

Additionally, the `optgen` error message produced when referencing a
type in an `*.opt` file that has not been registered is now less
ambiguous. With the previous error message it was unclear if it was
referencing `opt/metadata.go` or `optgen/metadata.go`.

Release justification: low-risk update to new functionality

Release note: None
This commit adds a list of arbiter indexes to EXPLAIN output for UPSERT
and INSERT ON CONFLICT statements. These arbiters are used to detect
conflicts.

Release justification: low-risk update to new functionality

Release note (sql change): The output of EXPLAIN for UPSERT and INSERT
ON CONFLICT statements now includes  a list of arbiter indexes. These
arbiters are the indexes used for detecting conflicts between the insert
row and the existing rows in the table.
@mgartner

Copy link
Copy Markdown
Contributor Author

bors r=RaduBerinde

@craig

craig Bot commented Aug 31, 2020

Copy link
Copy Markdown
Contributor

Build failed (retrying...):

@craig

craig Bot commented Aug 31, 2020

Copy link
Copy Markdown
Contributor

Build succeeded:

@craig craig Bot merged commit 7057acc into cockroachdb:master Aug 31, 2020
@mgartner mgartner deleted the show-arbiters branch August 31, 2020 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants