-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
opt: add testing infrastructure to disable rules #30636
Conversation
This commit adds testing infrastructure for randomly disabling some transformation rules in the optimizer. The goal is to test that alternate plans produced by the optimizer are logically equivalent. It can be used to test that the logic tests still pass with some rules randomly disabled as follows: > make test PKG=./pkg/sql/logictest/... TESTS='TestLogic/local-opt/.*' \ TESTFLAGS='-disable-opt-rule-probability=0.1' This test indicates that each transformation rule may be disabled with 10% probability. The value of -disable-opt-rule-probability can be any value between 0.0 and 1.0. Release note: None
There are six rules which are "essential" because the tests panic if they are disabled. It's possible that this is an indication of bug(s). In particular disabling Otherwise, the only tests that fail are those that fail with the error "could not decorrelate subquery". From the test runs I have done, it seems that the alternate plans are producing correct output. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty cool! If you have some time, can you run it against the bigtest suite? Sample command line here: https://github.com/cockroachdb/cockroach/blob/master/build/teamcity-sqllogictest.sh#L18
Reviewable status: complete! 0 of 0 LGTMs obtained
👍 running now |
bigtest passed with |
LGTM - I can't believe how little actual code this required, super cool |
TFTR! bors r+ |
30636: opt: add testing infrastructure to disable rules r=rytaft a=rytaft This commit adds testing infrastructure for randomly disabling some transformation rules in the optimizer. The goal is to test that alternate plans produced by the optimizer are logically equivalent. It can be used to test that the logic tests still pass with some rules randomly disabled as follows: ``` > make test PKG=./pkg/sql/logictest/... TESTS='TestLogic/local-opt/.*' \ TESTFLAGS='-disable-opt-rule-probability=0.1' ``` This test indicates that each transformation rule may be disabled with 10% probability. The value of -disable-opt-rule-probability can be any value between 0.0 and 1.0. Release note: None 30689: opt: show FKs in ddl output for test catalog r=justinj a=justinj Also remove a TODO fixed by #30072. Release note: None 30716: storage: proactively add to replicate queue on leader acquisition r=petermattis a=petermattis Proactively add replicas to the replicate queue on Raft leader acquisition. This is done in order to speed up removal of a replica when the replica to be removed is the leaseholder. When that happens the leaseholder transfers the lease to another replica and after the lease is transferred Raft leadership is transferred. Prior to this change the system then had to wait for the scanner on the new leaseholder node to pick up the replica and complete the removal. Note that we wait for Raft leadership to transfer because removal of a replica requires the leaseholder to also be the Raft leader due to the checks in `filterUnremovableReplicas` which ensure we're not removing a replica that is critical for quorum. Fixes #30695 Release note: None Co-authored-by: Rebecca Taft <[email protected]> Co-authored-by: Justin Jaffray <[email protected]> Co-authored-by: Peter Mattis <[email protected]>
Build succeeded |
This commit adds testing infrastructure for randomly disabling
some transformation rules in the optimizer. The goal is to test that
alternate plans produced by the optimizer are logically equivalent.
It can be used to test that the logic tests still pass with some
rules randomly disabled as follows:
This test indicates that each transformation rule may be disabled with
10% probability. The value of -disable-opt-rule-probability can be any
value between 0.0 and 1.0.
Release note: None