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

lint: simplify TestRoachVet #58066

Merged
merged 1 commit into from
Dec 21, 2020
Merged

lint: simplify TestRoachVet #58066

merged 1 commit into from
Dec 21, 2020

Conversation

knz
Copy link
Contributor

@knz knz commented Dec 18, 2020

Release note: None

@knz knz requested a review from tbg December 18, 2020 15:42
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Release note: None
Copy link
Member

@tbg tbg left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r1.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained

@knz
Copy link
Contributor Author

knz commented Dec 21, 2020

thanks!

bors r=tbg

@craig
Copy link
Contributor

craig bot commented Dec 21, 2020

Build succeeded:

@craig craig bot merged commit ce37dd2 into cockroachdb:master Dec 21, 2020
craig bot pushed a commit that referenced this pull request Dec 21, 2020
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]>
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