Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
RidRisR committed Jul 12, 2024
1 parent f4b7590 commit f166e35
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
24 changes: 12 additions & 12 deletions br/pkg/task/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,17 @@ const (

FlagResetSysUsers = "reset-sys-users"

defaultPiTRBatchCount = 8
defaultPiTRBatchSize = 16 * 1024 * 1024
defaultRestoreConcurrency = 128
defaultPiTRConcurrency = 16
defaultPDConcurrency = 1
defaultStatsConcurrency = 12
defaultBatchFlushInterval = 16 * time.Second
defaultFlagDdlBatchSize = 128
resetSpeedLimitRetryTimes = 3
maxRestoreBatchSizeLimit = 10240
pb uint64 = 1024 * 1024 * 1024 * 1024 * 1024
defaultPiTRBatchCount = 8
defaultPiTRBatchSize = 16 * 1024 * 1024
defaultRestoreConcurrency = 128
defaultPiTRConcurrency = 16
defaultPDConcurrency = 1
defaultStatsConcurrency = 12
defaultBatchFlushInterval = 16 * time.Second
defaultFlagDdlBatchSize = 128
resetSpeedLimitRetryTimes = 3
maxRestoreBatchSizeLimit = 10240
pb = 1024 * 1024 * 1024 * 1024 * 1024
)

const (
Expand Down Expand Up @@ -1268,7 +1268,7 @@ func EstimateTiflashUsage(tables []*metautil.Table, storeCnt uint64) uint64 {
for _, file := range table.Files {
tableBytes += file.GetSize_()
}
tiflashTotal += tableBytes * uint64(table.Info.TiFlashReplica.Count)
tiflashTotal += tableBytes * table.Info.TiFlashReplica.Count
}
log.Info("estimate tiflash usage", zap.Uint64("total size", tiflashTotal), zap.Uint64("store count", storeCnt))
return tiflashTotal / storeCnt
Expand Down
4 changes: 2 additions & 2 deletions br/pkg/task/restore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ func TestTikvUsage(t *testing.T) {
{Name: "F5", Size_: 5 * pb},
}
replica := uint64(3)
storeCnt := 6
storeCnt := uint64(6)
total := uint64(0)
for _, f := range files {
total += f.GetSize_()
Expand All @@ -508,7 +508,7 @@ func TestTiflashUsage(t *testing.T) {
{TiFlashReplicas: 2, Files: []*backuppb.File{{Size_: 3 * pb}}},
}

storeCnt := 3
var storeCnt uint64 = 3
ret := task.EstimateTiflashUsage(tables, storeCnt)
require.Equal(t, 8*pb/3, ret)
}
Expand Down

0 comments on commit f166e35

Please sign in to comment.