-
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
lightning: do not output pre-check info when disable check-requirements #27934
Conversation
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
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.
rest LGTM
@@ -92,8 +92,7 @@ func (rc *Controller) getClusterAvail(ctx context.Context) (uint64, error) { | |||
return clusterAvail, nil | |||
} | |||
|
|||
// ClusterResource check cluster has enough resource to import data. this test can by skipped. | |||
func (rc *Controller) ClusterResource(ctx context.Context, localSource int64) error { | |||
func (rc *Controller) clusterResource(ctx context.Context, localSource int64) error { |
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 think it's useful to keep the doc comment
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.
Ok
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
@@ -314,11 +314,20 @@ func (tr *TableRestore) restoreEngines(pCtx context.Context, rc *Controller, cp | |||
dataWorker := rc.closedEngineLimit.Apply() | |||
defer rc.closedEngineLimit.Recycle(dataWorker) | |||
err = tr.importEngine(ctx, dataClosedEngine, rc, eid, ecp) | |||
if rc.status != nil { | |||
for _, chunk := range ecp.Chunks { | |||
rc.status.FinishedFileSize.Add(chunk.FileMeta.FileSize) |
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.
Multiple chunks may share a same file when we split large csv files. The correct value should be chunk.Chunk.EndOffset - chunk.Key.Offset
.
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.
But if it started since a checkpoint, we shall calculate the total size rather than how much it does in this job.
} | ||
if err != nil { | ||
setError(err) | ||
} | ||
}(restoreWorker, engineID, engine) | ||
} else { | ||
for _, chunk := range engine.Chunks { | ||
rc.status.FinishedFileSize.Add(chunk.FileMeta.FileSize) |
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.
ditto
@@ -82,7 +82,7 @@ func (c *SimpleTemplate) Collect(t CheckType, passed bool, msg string) { | |||
} | |||
|
|||
func (c *SimpleTemplate) Success() bool { | |||
return c.warnFailedCount+c.criticalFailedCount == 0 | |||
return c.criticalFailedCount == 0 |
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.
// If the performance is not as expect or one of critical check not passed. it will stop import task.
Collect(t CheckType, passed bool, msg string)
If c.warnFailedCount > 0
, the import task should also be failed. @3pointer PTAL
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
/run-check_dev_2 |
return errors.Trace(err) | ||
} | ||
if rc.cfg.App.CheckRequirements { | ||
if err := rc.ClusterIsAvailable(ctx); err != nil { |
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.
tidb/br/pkg/lightning/restore/check_info.go
Line 171 in 86b464b
if !rc.cfg.App.CheckRequirements { |
this line can be removed
br/pkg/lightning/restore/restore.go
Outdated
} | ||
} | ||
} | ||
if rc.tidbGlue.OwnsSQLExecutor() { | ||
|
||
if rc.tidbGlue.OwnsSQLExecutor() && rc.cfg.App.CheckRequirements { | ||
// print check info at any time. |
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.
ditto
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.
rest LGTM
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
/merge |
This pull request has been accepted and is ready to merge. Commit hash: aac4185
|
What problem does this PR solve?
Issue Number: close #xxx
Problem Summary:
Lightning will check some requirement and it may cause lightning can not run.
What is changed and how it works?
Part of pingcap/tiflow#5833
What's Changed:
SetAppLogger
so that DM-worker can use lightning as a library.How it Works:
Check List
Tests
Side effects
Documentation
Release note