workload/schemachange: update sequence number initialization and getTableColumns error handling#58082
Merged
craig[bot] merged 2 commits intocockroachdb:masterfrom Dec 21, 2020
Conversation
Member
9ee3c83 to
205cba5
Compare
Previously, it was possible for the seqNum of operationGeneratorParams to be initialized to an incorrect value. When the workload would start, it would check all table names, view names, and sequence names to determine the starting value of the sequence number. This change updates this behavior to ensure that enum names, index names, schema names, and column names are checked as well. This ensures that the sequence number starts at an appropriate value each time the workload starts. This value is important for uniqueness assumptions when generating names throughout the workload. Previously, failing to check the names of enums, indexes, schemas, and columns to initialize the global sequence number would cause seg faults as outlined in the issue below. Closes: cockroachdb#58076 Release note: None
Previously, unexpected syntax errors would occur if the workload attempted to create an index on a table with no columns. For example, the workload would generate a statements such as `CREATE INDEX index2 ON table1 ()`, which are syntactically invalid. This change updates the function `getTableColumns` to return an error if a table has no columns to use when creating an index. The workload will try to generate another operation when it sees this error. Release note: None
205cba5 to
4e31a6a
Compare
ajwerner
approved these changes
Dec 21, 2020
Contributor
ajwerner
left a comment
There was a problem hiding this comment.
Reviewed 2 of 2 files at r3, 1 of 1 files at r4.
Reviewable status:complete! 1 of 0 LGTMs obtained
Contributor
Author
|
bors r=ajwerner |
Contributor
|
Build succeeded: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
workload/schemachange: update sequence number initialization
Previously, it was possible for the seqNum of operationGeneratorParams
to be initialized to an incorrect value. When the workload would start,
it would check all table names, view names, and sequence names to
determine the starting value of the sequence number. This change
updates this behavior to ensure that enum names, index names,
schema names, and column names are checked as well. This ensures
that the sequence number starts at an appropriate value each
time the workload starts. This value is important for uniqueness
assumptions when generating names throughout the workload.
Previously, failing to check the names of enums, indexes, schemas,
and columns to initialize the global sequence number would cause
seg faults as outlined in the issue below.
Closes: #58076
Release note: None
workload/schemachange: return error when a table has no columns
Previously, unexpected syntax errors would occur if the workload
attempted to create an index on a table with no columns.
For example, the workload would generate a statements such as
CREATE INDEX index2 ON table1 (), which are syntacticallyinvalid. This change updates the function
getTableColumnstoreturn an error if a table has no columns to use when creating
an index. The workload will try to generate another operation
when it sees this error.
Release note: None