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

repair: ensure max single repair job per host #3518

Conversation

karol-kokoszka
Copy link
Collaborator

Fixes #3425


"Only the Best is Good Enough." - LEGO company motto

Please make sure that:

  • Code is split to commits that address a single change
  • Commit messages are informative
  • Commit titles have module prefix
  • Commit titles have issue nr. suffix

@@ -74,7 +74,7 @@ func (c *rowLevelRepairController) shouldBlock(hosts []string, intensity int) bo

// DENY if any host has max nr of jobs already running
for _, h := range hosts {
if c.jobs[h] >= c.limits[h].Default {
if c.jobs[h] >= 1 {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: the comment in line 75 is now inaccurate.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

thanks, updated the comment + removed another checks that are not relevant anymore

@karol-kokoszka karol-kokoszka force-pushed the ensure_only_one_repair_job_per_host branch from b91d28f to 6eb2729 Compare August 9, 2023 17:07
@@ -199,44 +155,3 @@ func TestRowLevelRepairController(t *testing.T) {
}
})
}

func TestRowLevelRepairControllerIssue2446(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this test was removed?

t.Fatal("TryBlock() failed to block")
}
if a.Ranges != intensity {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be ">" - exactly as the error message below states.
Repair task is allowed to pick less than "intensity" ranges, e.g. in the last hunk.

@vladzcloudius
Copy link
Contributor

There is already a PR that fixes this and other issues which was submitted some time ago: #3506

This PR pretty much copies what this patch (8020beb) from the PR above does in terms of SM fix.

Don't you think that it makes more sense to pick the code part from the PR above and leave only the test part from this PR?

@karol-kokoszka
Copy link
Collaborator Author

Closing as #3521 is ready

@karol-kokoszka karol-kokoszka deleted the ensure_only_one_repair_job_per_host branch August 30, 2024 13:55
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