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

feat(schd): returning list of preferred nodes for scheduling #2

Merged
merged 3 commits into from
Feb 2, 2021

Conversation

pawanpraka1
Copy link
Contributor

Scheduler should return list of preferred nodes for scheduling.
It is up to the user of this libary which can pick first node in
the preferred list or can try on all the nodes in the order returned
by the scheduler.

This can solve the issue where csi controller is not able to create
the volume on first node, it can pick the next one in the list.

Signed-off-by: Pawan pawan@mayadata.io

@pawanpraka1 pawanpraka1 added the enhancement New feature or request label Jan 18, 2021
@pawanpraka1 pawanpraka1 changed the title feat(schd): returning list of preferred node for scheduling feat(schd): returning list of preferred nodes for scheduling Jan 18, 2021
Scheduler should return list of preferred nodes for scheduling.
It is up to the user of this libary which can pick first node in
the preferred list or can try on all the nodes in the order returned
by the scheduler.

This can solve the issue where csi controller is not able to create
the volume on first node, it can pick the next one in the list.

Signed-off-by: Pawan <pawan@mayadata.io>
Signed-off-by: Pawan <pawan@mayadata.io>
@@ -56,43 +62,68 @@ func getNodeList(topo *csi.TopologyRequirement) ([]string, error) {

// runScheduler goes through the node mapping
// in the topology and picks the node which is less weighted
func runScheduler(nodelist []string, nmap map[string]int64) string {
var selected string
func runScheduler(nodelist []string, nmap map[string]int64) []string {
Copy link
Member

Choose a reason for hiding this comment

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

n_: the comments needs to change to reflect the change in the logic.

topo := req.AccessibilityRequirements
if topo == nil ||
len(topo.Preferred) == 0 {
func Scheduler(req *csi.CreateVolumeRequest, nmap map[string]int64) []string {
Copy link
Member

Choose a reason for hiding this comment

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

q_: is it required to maintain backward compatibility for this API so that any of the CSI drivers using this method can still work, after this is merged and if they are using the latest code from this repo (without changing their code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it will work even after the merge because of the gomod.

Signed-off-by: Pawan <pawan@mayadata.io>
@kmova kmova merged commit 6083ef6 into openebs:develop Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants