Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

roachtest: fix schemachange/mixed/tpcc for 19.1 #41079

Merged
merged 1 commit into from
Sep 25, 2019

Conversation

thoszhang
Copy link
Contributor

@thoszhang thoszhang commented Sep 25, 2019

schemachange/mixed/tpcc uses CREATE TABLE AS in 19.2. This PR will have the
test correctly create a similar table in 19.1 without using CREATE TABLE AS.

See #40935 (comment).

Release justification: Fixes a test.

Release note: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@pbardea pbardea left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @lucy-zhang and @pbardea)


pkg/cmd/roachtest/schemachange.go, line 428 at r1 (raw file):

						if err := runAndLogStmts(ctx, t, c, "mixed-schema-changes-19.1", []string{
							`CREATE TABLE tpcc.orderpks (o_w_id, o_d_id, o_id, PRIMARY KEY(o_w_id, o_d_id, o_id));`,
							`INSERT INTO tpcc.orderpks SELECT o_w_id, o_d_id, o_id FROM tpcc.order LIMIT 1000;`,

What's the purpose of this LIMIT 1000?

`schemachange/mixed/tpcc` uses `CREATE TABLE AS` in 19.2. This PR will have the
test correctly create a similar table in 19.1 without using `CREATE TABLE AS`.

Release justification: Fixes a test.

Release note: None
Copy link
Contributor Author

@thoszhang thoszhang left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @pbardea)


pkg/cmd/roachtest/schemachange.go, line 428 at r1 (raw file):

Previously, pbardea (Paul Bardea) wrote…

What's the purpose of this LIMIT 1000?

It's just to limit the number of rows to insert so we don't try to read and insert all 30 million rows of tpcc.order in this transaction, since I figured that the tables don't have to be identical in 19.1 and 19.2. 1000 might be too conservative, though. Now that I think about it, the best option is probably to just use all the rows to get a similarly-sized table, but use AOST to reduce contention, so I changed it.

Copy link
Contributor

@pbardea pbardea left a comment

Choose a reason for hiding this comment

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

LGTM

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @pbardea)

@thoszhang
Copy link
Contributor Author

TFTR

bors r+

craig bot pushed a commit that referenced this pull request Sep 25, 2019
41079: roachtest: fix schemachange/mixed/tpcc for 19.1 r=lucy-zhang a=lucy-zhang

`schemachange/mixed/tpcc` uses `CREATE TABLE AS` in 19.2. This PR will have the
test correctly create a similar table in 19.1 without using `CREATE TABLE AS`.

See #40935 (comment).

Release justification: Fixes a test.

Release note: None

Co-authored-by: Lucy Zhang <lucy-zhang@users.noreply.github.com>
@craig
Copy link
Contributor

craig bot commented Sep 25, 2019

Build succeeded

@craig craig bot merged commit 2c744d4 into cockroachdb:master Sep 25, 2019
@thoszhang thoszhang deleted the fix-schema-change-roachtest branch September 25, 2019 18:10
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.

4 participants