Skip to content

jobs: break out progress batcher/rate limiter#36042

Merged
craig[bot] merged 2 commits intocockroachdb:masterfrom
dt:job-progress
Mar 26, 2019
Merged

jobs: break out progress batcher/rate limiter#36042
craig[bot] merged 2 commits intocockroachdb:masterfrom
dt:job-progress

Conversation

@dt
Copy link
Copy Markdown
Contributor

@dt dt commented Mar 21, 2019

This extracts the logic for only sending a progress update when progress has meaningfully advanced and limiting their frequency
from the existing logger, allowing it to be potentially reused elsewhere.

Release note: none.

@dt dt requested review from a team and madelynnblue March 21, 2019 22:07
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

// progressFractionThreshold.
var (
progressTimeThreshold = 30 * time.Second
progressTimeThreshold = 15 * time.Second
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this used to be checked via an OR with meaningful delta (5%) -- it is now checked via an AND, so that even if we make very fast progress, we don't spam the job with rapid-file progress updates.

Thus, it is now a lower-bound, not an upper-bound, which is why I changed it to 15s.

This extracts the logic for only sending a progress update when progress has meaningfully advanced and limiting their frequency
from the existing logger, allowing it to be potentially reused elsewhere.

Release note: none.
p.Unlock()

if shouldReport {
return p.Report(ctx, p.completed)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The read on p.completed here needs to be within the mutex to prevent a race condition. Probably like completed := p.completed and then p.Report(ctx, completed) so Report doesn't lock the mutex.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

whoops, yep, done.

@dt
Copy link
Copy Markdown
Contributor Author

dt commented Mar 26, 2019

bors r+

craig bot pushed a commit that referenced this pull request Mar 26, 2019
36042: jobs: break out progress batcher/rate limiter r=dt a=dt

This extracts the logic for only sending a progress update when progress has meaningfully advanced and limiting their frequency
from the existing logger, allowing it to be potentially reused elsewhere.

Release note: none.

Co-authored-by: David Taylor <tinystatemachine@gmail.com>
@craig
Copy link
Copy Markdown
Contributor

craig bot commented Mar 26, 2019

Build succeeded

@craig craig bot merged commit f5852dd into cockroachdb:master Mar 26, 2019
@dt dt deleted the job-progress branch March 26, 2019 13:00
craig bot pushed a commit that referenced this pull request Mar 27, 2019
36106: importccl: parallelize CSV-skipping workload IMPORT r=dt a=dt

(only last commit, first two commits are #36042)

Reopening #36060 after accidentally deleting branch and then github said it cannot re-open :/

This spins up multiple workers, each importing every i'th batch, to do
workload IMPORT.

As noted inline, this execution order, as opposed to assinging large
spans of batches to each worker, should mean that adjacent batches are
processed at roughly the same time and thus end up in the same
sort-batch for SST creation, preserving the non-overlapping SSTs when
the workload's batches are ordered and non-overlapping.

Release note: none.

Co-authored-by: David Taylor <tinystatemachine@gmail.com>
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