-
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
logictest: randomly backup/restore in logic tests #74174
logictest: randomly backup/restore in logic tests #74174
Conversation
c62f94a
to
363f040
Compare
@dt @stevendanna friendly ping! |
363f040
to
6935130
Compare
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.
Nice this is exciting. I've left a few minor nits, but am looking forward to this getting in. I think we should double check that our new configuration definitely won't get run in the current CI jobs to avoid further slowing down CI.
@@ -2058,6 +2101,153 @@ func (t *logicTest) processTestFile(path string, config testClusterConfig) error | |||
return nil | |||
} | |||
|
|||
func (t *logicTest) hasOpenTxns() bool { | |||
for _, user := range t.clients { | |||
if _, err := user.Exec("SET TRANSACTION PRIORITY NORMAL;"); !testutils.IsError(err, "there is no transaction in progress") { |
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.
Could this end up changing the semantics of a test that has already tried to set the transaction priority to something other than normal?
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.
Good point, added a statement to reset it to the original txn priority.
pkg/sql/logictest/logic.go
Outdated
if err != nil { | ||
// We might get an error depending on the state of the test. Let's just | ||
// ignore it. | ||
// BEFOREMERGE: Add a comment here about when this is the case. |
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.
:D
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.
To be honest, this was an artifact from Paul's original PR. I've switched to returning an error for now. When we do enable this we can revisit this and add a comment to that effect.
6935130
to
2e21902
Compare
2e21902
to
6175c6c
Compare
@stevendanna this should be RFAL, I removed the |
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.
LGTM. I vote we get this in and iterate on it. I imagine we'll find oddities in the session serialisation stuff and other issues we haven't thought of, but that is kinda the point of the test in the first place.
This commit introduces a new configuration to logic tests that will randomly backup the cluster, re-create the cluster and restore that backup to the new cluster. This is primarily beneficial since it runs backup/restore under a much more comprehensive set of SQL states. This configuration is currently disabled via the `COCKROACH_LOGIC_TEST_BACKUP_RESTORE_PROBABILITY` environment variable being set to 0. The goal is to set up a nightly that will set this var to a non-zero number for a growing set of logic tests. Co-authored-by: Paul Bardea <[email protected]> Closes cockroachdb#54060. Release note: None Release justification: non-production code changes, adds a logictest config that randomly runs backup and restore between existing logic tests. This is currently disabled.
6175c6c
to
05e9034
Compare
TFTR! bors r=stevendanna |
Yay! 🎉 |
Build succeeded: |
This commit introduces a new configuration to logic tests that will
randomly backup the cluster, re-create the cluster and restore that
backup to the new cluster.
This is primarily beneficial since it runs backup/restore under a much
more comprehensive set of SQL states.
This configuration is currently disabled via the
COCKROACH_LOGIC_TEST_BACKUP_RESTORE_PROBABILITY
environment variablebeing set to 0. The goal is to set up a nightly that
will set this var to a non-zero number for a growing set of logic
tests.
Co-authored-by: Paul Bardea [email protected]
Closes #54060.
Release note: None
Release justification: non-production code changes, adds a logictest
config that randomly runs backup and restore between existing logic tests.
This is currently disabled.