-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
[GCS] Non-STRICT_PACK PGs should be sorted by resource priority, size #22762
[GCS] Non-STRICT_PACK PGs should be sorted by resource priority, size #22762
Conversation
7c4fd20
to
48486a3
Compare
@rkooo567 I am thinking of moving unit tests to It is faster to run, and more directly addresses the logic of scheduling at root of this issue. Or should the more "integration" style (.py) tests created here be kept? |
Seems redis-ha failure is due to test_placement_group. It could just be long running with new added tests and not actually reflective of an issue. |
Can you add tests for both? I think we generally do both |
Can you actually add new tests to |
f8d862f
to
ef7b25e
Compare
Ok, done. btw, I believe placement_group_4 tests were not running previously due to missing: if __name__ == "__main__":
sys.exit(pytest.main(["-sv", __file__])) |
ef7b25e
to
e8ccab8
Compare
test_placement_group_4 is now timing out for ha gcs. Move to test_placement_group_5? |
@rkooo567 merge? |
|
||
const auto &result1 = | ||
gcs_resource_scheduler_->Schedule(required_resources_list, scheduling_type); | ||
ASSERT_TRUE(result1.first == gcs::SchedulingResultStatus::SUCCESS); |
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.
Can you add the same test case as the one from the issue?
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 reduced issue to minimal reproducible.
I tested it also succeeds on original issue's setup. (and fails prior to sorting)
std::vector<NodeID> node_ids; | ||
for (int i = 0; i < 6; i++) { | ||
node_ids.emplace_back(NodeID::FromRandom()); | ||
AddClusterResources(node_ids.back(), resources_list[i]); |
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.
Can you actually insert from the backward? 5->0. I think that will be close to generating the error scenario? Also did this test fail before this 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.
Test failed before PR (you can comment out sort).
Order doesn't really matter, the Score function is greedy about placing on the largest node, so that node has as much free remaining resource as possible. This causes order not to matter too much.
However I have improved the order slightly.
Test_placement_group_5 timeout for python medium and fail for windows build and test. Maybe I'll reduce size of integration test. Also, not possible to view logs on windows. |
Again failed on windows. Very strange. |
Maybe this also could mean the test is flaky |
If you run the same test like 50 times in a row, does it always succeed? |
test failures are now related to actor and client. |
That was broken in the master. Can you merge the latest master? |
Failed tests are unrelated |
Great job merging this! |
Why are these changes needed?
Previously, placement group had suboptimal bin-packing resulting in unexpected placement group stalls for users.
The root cause is lack of implementation for sorting of pg bundles by resource priority and size.
This PR implements a naive priority mechanism for bundles that can be improved upon (and even config by user in the future) in the GCS resource scheduler.
The behaviour is to schedule: "GPU" first, custom resources in
int64_t
order next, and finally, memory and then "CPU" last.CC @rkooo567
Related issue number
Fixes: #18309
Checks
scripts/format.sh
to lint the changes in this PR.