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: evaluate after filter #2363

Merged
merged 2 commits into from May 22, 2023
Merged

fix: evaluate after filter #2363

merged 2 commits into from May 22, 2023

Conversation

gaius-qi
Copy link
Member

Since the final length of the filter is the candidateParentLimit used, the parents after the filter is the returned parents.

Description

Related Issue

Motivation and Context

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation Update (if none of the other choices apply)

Checklist

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

Since the final length of the filter is the candidateParentLimit used,
the parents after the filter is the returned parents.

Signed-off-by: Gaius <gaius.qi@gmail.com>
@gaius-qi gaius-qi added enhancement New feature or request scheduler labels May 19, 2023
@gaius-qi gaius-qi added this to the v2.1.0 milestone May 19, 2023
@gaius-qi gaius-qi self-assigned this May 19, 2023
@gaius-qi gaius-qi requested a review from a team as a code owner May 19, 2023 05:50
@codecov
Copy link

codecov bot commented May 19, 2023

Codecov Report

Merging #2363 (cc206ea) into main (39c9839) will increase coverage by 0.00%.
The diff coverage is 66.66%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2363   +/-   ##
=======================================
  Coverage   49.70%   49.70%           
=======================================
  Files         148      148           
  Lines       19644    19646    +2     
=======================================
+ Hits         9765     9766    +1     
  Misses       9267     9267           
- Partials      612      613    +1     
Flag Coverage Δ
unittests 49.70% <66.66%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
scheduler/scheduling/scheduling.go 84.60% <66.66%> (+0.36%) ⬆️

... and 1 file with indirect coverage changes

Copy link
Contributor

@bigerous bigerous left a comment

Choose a reason for hiding this comment

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

I suggest evaluating and sorting candidates peers before filtering them for these reasons:

  • the complexity of evaluating is far low than filtering. The filtering need Lock on DAG, may slow the speed of scheduling. The filter process will stop at once when there is enough candidates(it would be 4 candidates if filtering after sort, but 40 when sort after filter)
  • The scheduling is not atomic(sometimes a candidate peer is good when filtering, but may become bad because assignments on other scheduling goroutines), so the process is the faster the better
  • when evaluatoring and sorting, it would be better if more peers are included.

Copy link

@hyy0322 hyy0322 left a comment

Choose a reason for hiding this comment

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

lgtm

@gaius-qi gaius-qi merged commit d6387da into main May 22, 2023
21 checks passed
@gaius-qi gaius-qi deleted the feature/filter branch May 22, 2023 06:16
gaius-qi added a commit that referenced this pull request Jun 28, 2023
Since the final length of the filter is the candidateParentLimit used,
the parents after the filter is the returned parents.

Signed-off-by: Gaius <gaius.qi@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request scheduler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants