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

fix(block-scheduler): one job per partition (local branch copy) #15579

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

owen-d
Copy link
Member

@owen-d owen-d commented Jan 2, 2025

Local branch copy of #15578 to debug possible fork permission issues

  • Removes max_jobs_planned_per_interval. We don't want this yet and it was being used incorrectly as the planners maxJobsPerPartition argument.
  • Hardcodes one job per partition during planning
  • enqueues the next job for some partition when the current one finishes.

Some of it is a bit hacky & will need refactoring, but this should work well enough in the meantime to flesh out issues.

@owen-d owen-d requested a review from a team as a code owner January 2, 2025 18:39
@github-actions github-actions bot added the type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories label Jan 2, 2025
Copy link
Contributor

github-actions bot commented Jan 2, 2025


// find first job for this partition
nextJob := sort.Search(len(jobs), func(i int) bool {
return jobs[i].Job.Partition() >= job.Partition()
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return jobs[i].Job.Partition() >= job.Partition()
return jobs[i].Job.Partition() == job.Partition()

Copy link
Member Author

Choose a reason for hiding this comment

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

That function probably works a bit different than you think :)

})

if nextJob < len(jobs) {
_, _, _ = s.idempotentEnqueue(jobs[nextJob])
Copy link
Contributor

Choose a reason for hiding this comment

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

there is a potential race here that could result in this operation to fail as we try to enqueue the same job from two different routines (from HandleCompleteJob or from the scheduler run loop). but this might not cause any problems

Copy link
Member Author

@owen-d owen-d Jan 3, 2025

Choose a reason for hiding this comment

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

This should be ok since the enqueue code first checks the statusmap for existence of a job before adding it to the queue. We may need to introduce some error handling here or there to swallow these cases, but it shouldn't be possible to add duplicate jobs at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants