-
Notifications
You must be signed in to change notification settings - Fork 66
restore: add importing progress and optimize the accuracy of restore progress #506
Conversation
c140cc7
to
b4c2e65
Compare
f5a8086
to
c2f60f6
Compare
count you also add the estimated progress in |
Lightning doesn't support return the progress for any individual table. Please submit a feature request issue. |
@@ -486,6 +487,11 @@ func (local *local) getImportClient(ctx context.Context, peer *metapb.Peer) (sst | |||
return sst.NewImportSSTClient(conn), nil | |||
} | |||
|
|||
type rangeStats struct { | |||
count int64 |
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.
seems this member is not used
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.
yes, currently only uses the totalBytes
lightning/restore/restore.go
Outdated
} | ||
metric.ChunkCounter.WithLabelValues(metric.ChunkStatePending).Inc() | ||
remainChunkCnt := float64(chunk.Chunk.EndOffset-chunk.Chunk.Offset) / float64(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.
What's the meaning of chunk.Key.Offset
, when does it not equal chunk.Chunk.Offset
. 🤔
And hope there is no division by zero 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.
Key.Offset is the start offset, chunk.offset is the current read position
LGTM CI fail since TiDB keep the format |
…to import-progress
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
/lgtm |
/merge |
@glorv Oops! This PR requires at least 2 LGTMs to merge. The current number of |
/merge |
@lance6716 Oops! This PR requires at least 2 LGTMs to merge. The current number of |
/lgtm |
/merge |
/run-all-tests |
What problem does this PR solve?
Better progress calculation and log
resolves partially #440
What is changed and how it works?
estimatedWriteProgress * 0.8 + estimatedImportProgress * 0.2
New log output style:
Check List
Tests
Side effects
Related changes