-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
57181: workload/schemachange: add backups and ndjson logging r=ajwerner a=jayshrivastava ### roachtest: save database backup on schemachange random load failure Previously, there was no way to inspect the state of the database when the schemachange random load workload failed. This change updates roachtest to save a backup in the artifacts directory so that the database state can be recovered for debugging or investigation. See #56118 Release note: None ### roachtest: add transaction log to schemachange/random-load Release note: None ### workload/schemachange: add json logging infrastructure This change adds mechanisms for writing json transaction logs to a file while the workload is running. Workers now use atomicLog structs to write transactions atomically to log files or stdout. Also, each worker stores log entries inside its internal state to make coordinating log writes easier. A preErrorHook function is introduced and implemented to ensure that partially completed transactions can be written to a log when the workload terminates due to an error. All log entries are protected by mutexes so this hook can halt other workers while it flushes their transaction logs. This hook can only be called once per workload and is protected by a sync.Once struct. If "tolerate-errors" is true, then the worker will restart and release the locks it has on other workers. Release note: None ### workload/schemachange: refactor logging to use new infrastructure Closes: #57471 Release note: None ### workload/schemachange: implement addForeignKeyConstraint op addForeignKeyConstraint adds a single, non-composite, foreign key relation between two random columns. Release note: None ### workload/schemachange: implement addUniqueConstraint op The addUniqueConstraint op adds a unique constraint on a single column. Release note: None 58070: eventpb: make the Timestamp field an int64 r=itsbilal a=knz First commit from #58066. While exploring how to use the data in practice, I noticed that the timestamp was encoded as a string in the JSON output, and that was making the events hard to parse and to use. There are many more functions that can operate on a number. Moreover, the integer representation is just more compact. Release note (api change): The 'Timestamp' field of structured notable events is now numeric, and encodes a number of nanoseconds since the unix epoch. (Note that this API has not yet been published in a released version of CockroachDB. The release note exists only to track the list of relevant items for the doc project.) 58082: workload/schemachange: update sequence number initialization and getTableColumns error handling r=ajwerner a=jayshrivastava ### 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 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 Co-authored-by: Jayant Shrivastava <[email protected]> Co-authored-by: Raphael 'kena' Poss <[email protected]>
- Loading branch information
Showing
14 changed files
with
540 additions
and
228 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.