Skip to content

Commit 2101f05

Browse files
committed
commit some suggestions
Signed-off-by: Jianjun Liao <[email protected]>
1 parent a2a92cc commit 2101f05

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

br/pkg/restore/misc.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,12 +506,14 @@ func GroupOverlappedBackupFileSetsIter(ctx context.Context, regionClient split.S
506506
// into the set.
507507
thisBackupFileSet.SSTFiles = append(thisBackupFileSet.SSTFiles, file.backupFileSet.SSTFiles...)
508508
if thisBackupFileSet.TableID != file.backupFileSet.TableID || !thisBackupFileSet.RewriteRules.Equal(file.backupFileSet.RewriteRules) {
509-
log.Panic("the overlapped SST must have the same table id and rewrite rules",
509+
log.Error("the overlapped SST must have the same table id and rewrite rules",
510510
zap.Int64("set table id", thisBackupFileSet.TableID),
511511
zap.Int64("file table id", file.backupFileSet.TableID),
512512
zap.Reflect("set rewrite rule", thisBackupFileSet.RewriteRules),
513513
zap.Reflect("file rewrite rule", file.backupFileSet.RewriteRules),
514514
)
515+
return errors.Errorf("the overlapped SST must have the same table id(%d<>%d) and rewrite rules",
516+
thisBackupFileSet.TableID, file.backupFileSet.TableID)
515517
}
516518
// update lastEndKey if file.endKey is larger
517519
if bytes.Compare(lastEndKey, file.endKey) < 0 {

br/pkg/restore/snap_client/import.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,8 @@ func (importer *SnapFileImporter) batchDownloadSST(
724724
bytes.Equal(cfReq.RewriteRule.OldKeyPrefix, req.RewriteRule.OldKeyPrefix) &&
725725
cfReq.RewriteRule.IgnoreAfterTimestamp == req.RewriteRule.IgnoreAfterTimestamp &&
726726
cfReq.RewriteRule.IgnoreBeforeTimestamp == req.RewriteRule.IgnoreBeforeTimestamp) {
727-
log.Panic("rewrite rule mismatch", zap.Reflect("cfReq", cfReq.RewriteRule), zap.Reflect("req", req.RewriteRule))
727+
log.Error("rewrite rule mismatch", zap.Reflect("cfReq", cfReq.RewriteRule), zap.Reflect("req", req.RewriteRule))
728+
return nil, errors.Errorf("rewrite rules mismatch from the overlapped SST files")
728729
}
729730
cfReq.Ssts[req.Name] = &sstMeta
730731
}

0 commit comments

Comments
 (0)