-
Notifications
You must be signed in to change notification settings - Fork 102
Conversation
@@ -30,6 +31,11 @@ func runBackupCommand(command *cobra.Command, cmdName string) error { | |||
ctx, store = trace.TracerStartSpan(ctx) | |||
defer trace.TracerFinishSpan(ctx, store) | |||
} | |||
if cfg.IgnoreStats { | |||
// Do not run stat worker in BR. | |||
session.DisableStats4Test() |
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 about restore?
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.
It's not easy to distinguish whether we should DisableStats4Test
in restoration. I had two ideas
-
Read backupmeta and check all tables whether stats != nil. but we should do it carefully, because read backupmeta is intask.runRestore
and we cannot runDisableStats4Test
otherwise it will influence BR via SQL. -
Change kvproto to record the status of--ignore-stats
. and this will involve other repo.
So both of them will change a lot. we need to confirm the cost of DisableStats4Test
and is it worth for the above changes?
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.
LoadStatsFromJson only execute SQL to storage. so we can disable stats loop directly.
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.
lgtm
Test restore with sysbench 3000 tables. |
LGTM |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-4.0 in PR #696 |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-5.0-rc in PR #697 |
Test backup with sysbench 3000 tables. We can reduce the memory inuse with this PR. |
What problem does this PR solve?
Disable backup stats by default. because of
What is changed and how it works?
cfg.IgnoreStats
default to truecfg.IgnoreStats
is true, setstatsLease
to -1Check List
Tests
Related changes
Release Note