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

cmd/reduce: reduce costfuzz logs #83021

Merged
merged 1 commit into from
Jun 21, 2022
Merged

Conversation

michae2
Copy link
Collaborator

@michae2 michae2 commented Jun 16, 2022

Add a -costfuzz mode to reduce, with special handling for logs
produced by the costfuzz roachtest. This mode is similar to -tlp.

The logs produced by costfuzz consist of various CREATE TABLE, INSERT,
UPDATE, and DELETE statements followed by three special statements:

  1. A SELECT statement, called "control".
  2. A SET testing_optimizer_random_cost_seed statement.
  3. The same SELECT as (1), this time called "perturbed".

When the results of (1) and (3) do not match, we have a costfuzz
failure.

The -costfuzz mode removes these three special statements from the end
of the log, reduces the rest of the log, and then appends the statements
to the reduced log to check if the current reduction is interesting. As
long as the results of (1) and (3) continue to not match, the reduction
is interesting.

Also, make reduce run cockroach demo with an enterprise license. Now
that we use enterprise features in randgen we sometimes need this.

Informs: #81717

Release note: None

@michae2 michae2 requested review from msirek and a team June 16, 2022 22:06
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@michae2 michae2 force-pushed the reduce_costfuzz branch 2 times, most recently from f0b6ac8 to 6bdaa1f Compare June 16, 2022 23:27
Add a `-costfuzz` mode to `reduce`, with special handling for logs
produced by the costfuzz roachtest. This mode is similar to `-tlp`.

The logs produced by costfuzz consist of various CREATE TABLE, INSERT,
UPDATE, and DELETE statements followed by three special statements:
1. A SELECT statement, called "control".
2. A SET testing_optimizer_random_cost_seed statement.
3. The same SELECT as (1), this time called "perturbed".

When the results of (1) and (3) do not match, we have a costfuzz
failure.

The `-costfuzz` mode removes these three special statements from the end
of the log, reduces the rest of the log, and then appends the statements
to the reduced log to check if the current reduction is interesting. As
long as the results of (1) and (3) continue to not match, the reduction
is interesting.

Also, make `reduce` run `cockroach demo` with an enterprise license. Now
that we use enterprise features in randgen we sometimes need this.

Informs: cockroachdb#81717

Release note: None
Copy link
Contributor

@msirek msirek left a comment

Choose a reason for hiding this comment

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

This is great!
:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained

@michae2
Copy link
Collaborator Author

michae2 commented Jun 21, 2022

TFYR!

bors r=msirek

@craig
Copy link
Contributor

craig bot commented Jun 21, 2022

Build succeeded:

@craig craig bot merged commit 75cf2bb into cockroachdb:master Jun 21, 2022
@michae2 michae2 deleted the reduce_costfuzz branch June 21, 2022 19:26
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