Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
br: pipeline backup schemas #43003
br: pipeline backup schemas #43003
Changes from 5 commits
a789d69
27528d4
f24c365
a7a3910
d84dd9a
44e6e85
e0e19e5
373705f
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Note: change the ranges with keyspace prefix only when get the ranges from kv storage instead of checkpoint data.
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.
Why schemaNum increasing at the same frequency as tableNum?
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.
schemaNum
is to record the total number of(dbInfo, tableInfo)
or(dbInfo, nil)
. (equivalent toschemas.Len()
).tableNum
is to record whether thedbInfo
has records anytableInfo
s. (equivalent tolen(tableInfos)
).now
tableNum
has been changed tovar hasTable bool
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.
Note: the origin code might have a little mistake: When
len(tables) > 0
but all the tables is skipped bytable-filter
, so thedbInfo
won't be added into schemasThere 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.
Concurrency is different now. Is it intentional?
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.
That's because the new
schemas
need to iterates all tables to get the size, which is repeated in this situation. Therefore, we don't get the size ofschemas
.Besides, we can see the
workerpool
inschemas.BackupSchemas
only push theworker
to channel. Only when callApplyOnErrorGroup
, it would create a new goroutine. So directly usebackup.DefaultSchemaConcurrency
is somewhat equivalent tomathutil.Min(backup.DefaultSchemaConcurrency, schemas.Len()))
.If
schemas.Len()
>=backup.DefaultSchemaConcurrency
, it is the same to usebackup.DefaultSchemaConcurrency
.If
schemas.Len()
<backup.DefaultSchemaConcurrency
, the new version would create theschemas.Len()
goroutine in total, which is the same as old version. Andbackup.DefaultSchemaConcurrency - schemas.Len()
moreworker struct
add into the channel, which is no effect.