-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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: finer granularity for tidb backend finished bytes #39318
Changes from 10 commits
14d3567
29593bd
f4e36dc
d0356ab
e97a4cc
c373c08
3457792
912d1a8
7c1de7e
2743ae4
6250609
fe73373
303d3ee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -327,7 +327,7 @@ 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 { | ||
if rc.status != nil && rc.status.backend == config.BackendLocal { | ||
for _, chunk := range ecp.Chunks { | ||
rc.status.FinishedFileSize.Add(chunk.Chunk.EndOffset - chunk.Key.Offset) | ||
} | ||
|
@@ -406,6 +406,11 @@ func (tr *TableRestore) restoreEngine( | |
if err != nil { | ||
return closedEngine, errors.Trace(err) | ||
} | ||
if rc.status != nil && rc.status.backend == config.BackendTiDB { | ||
for _, chunk := range cp.Chunks { | ||
rc.status.FinishedFileSize.Add(chunk.Chunk.EndOffset) | ||
okJiang marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} | ||
return closedEngine, nil | ||
} | ||
|
||
|
@@ -475,6 +480,9 @@ func (tr *TableRestore) restoreEngine( | |
|
||
// Restore table data | ||
for chunkIndex, chunk := range cp.Chunks { | ||
if rc.status != nil && rc.status.backend == config.BackendTiDB { | ||
rc.status.FinishedFileSize.Add(chunk.Chunk.Offset) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. seems that not restore completedly here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. here I want to recover FinishedFileSize from checkpoint, the restore process of current run is not started There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should it be |
||
} | ||
if chunk.Chunk.Offset >= chunk.Chunk.EndOffset { | ||
continue | ||
} | ||
|
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.
should it be
chunk.Chunk.EndOffset-chunk.Key.Offset
, in case of strict format wherechunk.Key.Offset
is not 0There 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'm not familiar with strict format, can you give some reference to the behaviour?
I think you want to keep a property that the value of
FinishedFileSize.Add
should be same no matter it's processed without failure or recovered from checkpoint?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 I guess the strict mode will split a file into many chunks, the split position is written in Key.Offset