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

workload/bank: batch initial row generation #39719

Merged
merged 1 commit into from
Aug 20, 2019

Conversation

danhhz
Copy link
Contributor

@danhhz danhhz commented Aug 16, 2019

Release note: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Member

@nvanbenschoten nvanbenschoten left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 6 of 6 files at r1.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @danhhz)


pkg/workload/bank/bank.go, line 129 at r1 (raw file):

// Tables implements the Generator interface.
func (b *bank) Tables() []workload.Table {
	numBatches := int(math.Ceil(float64(b.rows) / float64(b.batchSize)))

Float arithmetic seems like it could cause issues. I'd favor integer arithmetic for something like this:

numBatches := (b.rows + b.batchSize - 1) / b.batchSize // ceil(b.rows/b.batchSize)

Copy link
Contributor Author

@danhhz danhhz left a comment

Choose a reason for hiding this comment

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

TFTR!

bors r=nvanbenschoten

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @nvanbenschoten)


pkg/workload/bank/bank.go, line 129 at r1 (raw file):

Previously, nvanbenschoten (Nathan VanBenschoten) wrote…

Float arithmetic seems like it could cause issues. I'd favor integer arithmetic for something like this:

numBatches := (b.rows + b.batchSize - 1) / b.batchSize // ceil(b.rows/b.batchSize)

Whoops, totally agree. I meant to go back and do that myself before I PR'd this and forgot. Done

@craig
Copy link
Contributor

craig bot commented Aug 20, 2019

Build failed

@danhhz
Copy link
Contributor Author

danhhz commented Aug 20, 2019

Fixed my broken tests

bors r=nvanbenschoten

@craig
Copy link
Contributor

craig bot commented Aug 20, 2019

Build failed

@danhhz
Copy link
Contributor Author

danhhz commented Aug 20, 2019

Flake is #39653

bors r=nvanbenschoten

craig bot pushed a commit that referenced this pull request Aug 20, 2019
39719: workload/bank: batch initial row generation r=nvanbenschoten a=danhhz

Release note: None

Co-authored-by: Daniel Harrison <daniel.harrison@gmail.com>
@craig
Copy link
Contributor

craig bot commented Aug 20, 2019

Build succeeded

@craig craig bot merged commit cd6f2de into cockroachdb:master Aug 20, 2019
@danhhz danhhz deleted the workload_bank branch September 3, 2019 19:01
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