Skip to content
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
289a51e
br: improve summary and progress visualization of br (#56612)
Leavrth Jan 22, 2025
35913fd
br: provide a storage target option for BR restore checkpoint data (#…
Leavrth Mar 7, 2025
b55aab6
br: save pitr id map if table mysql.tidb_pitr_id_map does not exist (…
Leavrth May 8, 2025
6cc61e3
br: record files into filesOfPhysicalID (#60423)
Leavrth Apr 23, 2025
fcb9ee9
br: PiTR table filter online support (#59281)
Tristan1900 May 20, 2025
0587538
br: fix table filter nil pointer issue (#61225)
Tristan1900 May 22, 2025
74a1553
br: add restoreid to idmap table (#61278)
Tristan1900 May 27, 2025
f00cd31
br: sort meta kv by ts when updating table history (#61366)
Tristan1900 May 30, 2025
19c3032
br: add a checkpoint metadata validation for restore (#61108)
RidRisR May 30, 2025
f4c8d63
br: compatibility of log backup and log restore (#61238)
Leavrth May 27, 2025
9c9ee6e
br: enable parallel restore (#58724)
Tristan1900 Jun 3, 2025
8349c5a
br/lightning: Apply pd_enable_follower_handle_region to Lightning/BR …
okJiang Mar 3, 2025
7566c61
some manual fix, not done
Tristan1900 Jun 6, 2025
909767e
fix pd and one test
Tristan1900 Jun 6, 2025
215e9fe
fix
Tristan1900 Jun 6, 2025
a54ac7d
br: reduce the memory consumption of backup ranges (#60174)
Leavrth Apr 18, 2025
84495f7
fix a bunch of errors
Tristan1900 Jun 6, 2025
676fdee
fix another test
Tristan1900 Jun 6, 2025
24e3e95
fix another pmodel
Tristan1900 Jun 6, 2025
6d6608d
fix test
Tristan1900 Jun 6, 2025
5eb4deb
fix bazel
Tristan1900 Jun 6, 2025
d24f2e3
fix
Tristan1900 Jun 6, 2025
c80b75a
revert 1eb66dab8c5a7da2320699c1900eb6dd57fbd37e
Leavrth Jun 6, 2025
14009b5
complete 5a032651f5c4a36bebdab492514fbbf7cab6146f
Leavrth Jun 6, 2025
e27f4f4
fix integration test
Leavrth Jun 6, 2025
d708fc6
fix ut
Tristan1900 Jun 6, 2025
4dee233
fix
Tristan1900 Jun 6, 2025
543bb69
fix ut
Tristan1900 Jun 6, 2025
864cb46
fix ut
Tristan1900 Jun 6, 2025
429ef8a
fix and cleanup
Tristan1900 Jun 7, 2025
d00e9d9
fix ut
Tristan1900 Jun 7, 2025
8103236
fix early cancel issue
Tristan1900 Jun 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 33 additions & 27 deletions br/cmd/br/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,33 +92,35 @@ func newCheckSumCommand() *cobra.Command {
var calCRC64 uint64
var totalKVs uint64
var totalBytes uint64
for _, file := range tbl.Files {
calCRC64 ^= file.Crc64Xor
totalKVs += file.GetTotalKvs()
totalBytes += file.GetTotalBytes()
log.Info("file info", zap.Stringer("table", tbl.Info.Name),
zap.String("file", file.GetName()),
zap.Uint64("crc64xor", file.GetCrc64Xor()),
zap.Uint64("totalKvs", file.GetTotalKvs()),
zap.Uint64("totalBytes", file.GetTotalBytes()),
zap.Uint64("startVersion", file.GetStartVersion()),
zap.Uint64("endVersion", file.GetEndVersion()),
logutil.Key("startKey", file.GetStartKey()),
logutil.Key("endKey", file.GetEndKey()),
)

var data []byte
data, err = s.ReadFile(ctx, file.Name)
if err != nil {
return errors.Trace(err)
}
s := sha256.Sum256(data)
if !bytes.Equal(s[:], file.Sha256) {
return errors.Annotatef(berrors.ErrBackupChecksumMismatch, `
for _, files := range tbl.FilesOfPhysicals {
for _, file := range files {
calCRC64 ^= file.Crc64Xor
totalKVs += file.GetTotalKvs()
totalBytes += file.GetTotalBytes()
log.Info("file info", zap.Stringer("table", tbl.Info.Name),
zap.String("file", file.GetName()),
zap.Uint64("crc64xor", file.GetCrc64Xor()),
zap.Uint64("totalKvs", file.GetTotalKvs()),
zap.Uint64("totalBytes", file.GetTotalBytes()),
zap.Uint64("startVersion", file.GetStartVersion()),
zap.Uint64("endVersion", file.GetEndVersion()),
logutil.Key("startKey", file.GetStartKey()),
logutil.Key("endKey", file.GetEndKey()),
)

var data []byte
data, err = s.ReadFile(ctx, file.Name)
if err != nil {
return errors.Trace(err)
}
s := sha256.Sum256(data)
if !bytes.Equal(s[:], file.Sha256) {
return errors.Annotatef(berrors.ErrBackupChecksumMismatch, `
backup data checksum failed: %s may be changed
calculated sha256 is %s,
origin sha256 is %s`,
file.Name, hex.EncodeToString(s[:]), hex.EncodeToString(file.Sha256))
file.Name, hex.EncodeToString(s[:]), hex.EncodeToString(file.Sha256))
}
}
}
if tbl.Info == nil {
Expand Down Expand Up @@ -184,16 +186,20 @@ func newBackupMetaValidateCommand() *cobra.Command {
tables := make([]*metautil.Table, 0)
for _, db := range dbs {
for _, table := range db.Tables {
files = append(files, table.Files...)
for _, fs := range table.FilesOfPhysicals {
files = append(files, fs...)
}
}
tables = append(tables, db.Tables...)
}
// Check if the ranges of files overlapped
rangeTree := rtree.NewRangeTree()
for _, file := range files {
if out := rangeTree.InsertRange(rtree.Range{
StartKey: file.GetStartKey(),
EndKey: file.GetEndKey(),
KeyRange: rtree.KeyRange{
StartKey: file.GetStartKey(),
EndKey: file.GetEndKey(),
},
}); out != nil {
log.Error(
"file ranges overlapped",
Expand Down
2 changes: 1 addition & 1 deletion br/pkg/backup/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
go_library(
name = "backup",
srcs = [
"check.go",
"client.go",
"metrics.go",
"schema.go",
Expand Down Expand Up @@ -33,6 +32,7 @@ go_library(
"//pkg/meta/model",
"//pkg/statistics/handle",
"//pkg/statistics/handle/util",
"//pkg/tablecodec",
"//pkg/util",
"//pkg/util/table-filter",
"@com_github_google_btree//:btree",
Expand Down
34 changes: 0 additions & 34 deletions br/pkg/backup/check.go

This file was deleted.

Loading
Loading