Skip to content

[YUNIKORN-3084] Fix Inconsistency in Allocation Removal from sortedRequests#1022

Closed
mitdesai wants to merge 1 commit into
apache:masterfrom
mitdesai:yunikorn-3084
Closed

[YUNIKORN-3084] Fix Inconsistency in Allocation Removal from sortedRequests#1022
mitdesai wants to merge 1 commit into
apache:masterfrom
mitdesai:yunikorn-3084

Conversation

@mitdesai

@mitdesai mitdesai commented Jun 5, 2025

Copy link
Copy Markdown
Contributor

What is this PR for?

The binary search in the remove method used the LessThan() comparison function, which compares allocations based on priority and creation time. The comparison should be by allocation key.

When multiple allocations have the same priority and creation time, it is possible that the binary search will find an allocation that is different than the one we want to remove.

What type of PR is it?

  • - Bug Fix
  • - Improvement
  • - Feature
  • - Documentation
  • - Hot Fix
  • - Refactoring

Todos

  • - Task

What is the Jira issue?

https://issues.apache.org/jira/browse/YUNIKORN-3084

How should this be tested?

Create a Job with 1000 executors. Delete all the executors. Atleast one of the executors will have issue getting removed.

Screenshots (if appropriate)

Questions:

  • - The licenses files need update.
  • - There is breaking changes for older versions.
  • - It needs documentation.

@pbacsko
pbacsko self-requested a review June 5, 2025 08:03
@codecov

codecov Bot commented Jun 5, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.67%. Comparing base (bf04bd4) to head (bb1891b).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1022      +/-   ##
==========================================
- Coverage   82.69%   82.67%   -0.02%     
==========================================
  Files          98       98              
  Lines       15682    15683       +1     
==========================================
- Hits        12968    12966       -2     
- Misses       2439     2441       +2     
- Partials      275      276       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mitdesai

mitdesai commented Jun 5, 2025

Copy link
Copy Markdown
Contributor Author

I don't think the e2e test failure is due to this change.

@chenyulin0719

Copy link
Copy Markdown
Contributor

Yeah... It looks like something is broken in the Gang Scheduling E2E test.

@chenyulin0719 chenyulin0719 left a comment

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.

+1 LGTM.

A minor feedbcak, I think the second test TestRemoveWithSamePriorityAndTimeButDifferentInstances, might be a bit redundant. Maybe we can remove it? Does anyone else have any comments on it?

Comment thread pkg/scheduler/objects/sorted_asks_test.go Outdated
@mitdesai

Copy link
Copy Markdown
Contributor Author

Thanks for the review @chenyulin0719 and @pbacsko. I was trying some else when I wrote that test. I will update the PR.

@mitdesai

Copy link
Copy Markdown
Contributor Author

The test in question was not adding any additional value. So I have removed it.

@pbacsko pbacsko closed this in a5b865c Jun 12, 2025
pbacsko pushed a commit that referenced this pull request Jun 12, 2025
…quests (#1022)

Closes: #1022

Signed-off-by: Peter Bacsko <bacskop@gmail.com>
(cherry picked from commit a5b865c)
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.

4 participants