-
Notifications
You must be signed in to change notification settings - Fork 3.8k
feat(block-scheduler): job tracking & offset commits #15338
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
Changes from 1 commit
fe41286
f493c53
fddd01a
118a9b9
2608b00
0215559
5576b0c
d14f9d6
67fc8ac
e6ed2e4
d7e9062
db1406a
de67588
f096e8b
497ac91
c6ed241
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -214,17 +214,32 @@ func (s *BlockScheduler) HandleGetJob(ctx context.Context) (*types.Job, bool, er | |||||
| } | ||||||
| } | ||||||
|
|
||||||
| func (s *BlockScheduler) HandleCompleteJob(_ context.Context, job *types.Job, success bool) error { | ||||||
| func (s *BlockScheduler) HandleCompleteJob(ctx context.Context, job *types.Job, success bool) (err error) { | ||||||
| logger := log.With(s.logger, "job", job.ID()) | ||||||
|
|
||||||
| if success { | ||||||
| level.Info(logger).Log("msg", "job completed successfully") | ||||||
| s.queue.MarkComplete(job.ID(), types.JobStatusComplete) | ||||||
| return nil | ||||||
| // TODO(owen-d): do i need to increment offset here? | ||||||
| if err = s.offsetManager.Commit( | ||||||
| ctx, | ||||||
| job.Partition(), | ||||||
| job.Offsets().Max, | ||||||
|
||||||
| job.Offsets().Max, | |
| job.Offsets().Max-1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't failed jobs instead get a higher priority?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but I didn't want to complicate the PR further by adding logic for priority discovery on retries. I think this is best left for a followup PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think we need to commit
job.Offsets().Max-1given builders only consume upto but not includingMaxThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good