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: Add import scheduler and manager #29367

Merged
merged 254 commits into from
Mar 1, 2024

Conversation

bigsheeper
Copy link
Contributor

This PR introduces novel managerial roles for importv2:

  1. ImportMeta: To manage all the import tasks;
  2. ImportScheduler: To process tasks and modify their states;
  3. ImportChecker: To ascertain the completion of all tasks and instigate relevant operations.

issue: #28521

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
@bigsheeper
Copy link
Contributor Author

rerun ut

@mergify mergify bot added the ci-passed label Feb 28, 2024
})
segmentIDs := task.(*importTask).GetSegmentIDs()
for _, segmentID := range segmentIDs {
segment := meta.GetSegment(segmentID)
Copy link
Collaborator

Choose a reason for hiding this comment

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

do not lock frequently

}
return int64(progress), internalpb.ImportState_InProgress, ""
return 0, internalpb.ImportJobState_Failed, "unknown import job state"
Copy link
Collaborator

Choose a reason for hiding this comment

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

ImportJobState_None

@@ -276,72 +270,61 @@ func (c *importChecker) checkImportState(job ImportJob) {
return
}
c.buildIndexCh <- segmentID // accelerate index building
err = c.meta.UnsetIsImporting(segmentID)
segment := c.meta.GetSegment(segmentID)
Copy link
Collaborator

Choose a reason for hiding this comment

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

minimize the number of calsl of meta.GetSegment

}
}

func (c *importChecker) checkTimeout(jobID int64) {
tasks := c.imeta.GetTaskBy(WithStates(internalpb.ImportState_InProgress), WithJob(jobID))
func (c *importChecker) checkFailedJob(job ImportJob) {
Copy link
Collaborator

@czs007 czs007 Mar 1, 2024

Choose a reason for hiding this comment

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

rename to tryFailingTasks


timeoutTime := tsoutil.PhysicalTime(c.imeta.GetJob(jobID).GetTimeoutTs())
func (c *importChecker) checkTimeout(job ImportJob) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

rename to tryTimeoutJob?

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
@mergify mergify bot added ci-passed and removed ci-passed labels Mar 1, 2024
@czs007
Copy link
Collaborator

czs007 commented Mar 1, 2024

/approve
/lgtm

@sre-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bigsheeper, czs007

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sre-ci-robot sre-ci-robot merged commit a434d33 into milvus-io:master Mar 1, 2024
13 of 14 checks passed
MrPresent-Han pushed a commit to MrPresent-Han/milvus that referenced this pull request Mar 3, 2024
This PR introduces novel managerial roles for importv2:
1. ImportMeta: To manage all the import tasks;
2. ImportScheduler: To process tasks and modify their states;
3. ImportChecker: To ascertain the completion of all tasks and instigate
relevant operations.

issue: milvus-io#28521

---------

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved area/dependency Pull requests that update a dependency file area/internal-api area/test ci-passed dco-passed DCO check passed. kind/feature Issues related to feature request from users lgtm sig/testing size/XXL Denotes a PR that changes 1000+ lines. test/integration integration test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants