Skip to content

Commit

Permalink
lightning: make OpLevelOptional suppress the error of DoChecksum
Browse files Browse the repository at this point in the history
  • Loading branch information
lyzx2001 committed Jul 24, 2023
1 parent bfc940a commit 39d8c16
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions br/pkg/lightning/importer/table_import.go
Original file line number Diff line number Diff line change
Expand Up @@ -1042,12 +1042,11 @@ func (tr *TableImporter) postProcess(
err = status.Error(codes.Unknown, "Checksum meets error.")
})

Check warning on line 1043 in br/pkg/lightning/importer/table_import.go

View check run for this annotation

Codecov / codecov/patch

br/pkg/lightning/importer/table_import.go#L1039-L1043

Added lines #L1039 - L1043 were not covered by tests
if err != nil {
if rc.cfg.PostRestore.Checksum == config.OpLevelOptional {
tr.logger.Warn("do checksum failed, will skip this error and go on", log.ShortError(err))
err = nil
if rc.cfg.PostRestore.Checksum != config.OpLevelOptional {
return false, err
}
} else {
return false, err
tr.logger.Warn("do checksum failed, will skip this error and go on", log.ShortError(err))
err = nil

Check warning on line 1049 in br/pkg/lightning/importer/table_import.go

View check run for this annotation

Codecov / codecov/patch

br/pkg/lightning/importer/table_import.go#L1045-L1049

Added lines #L1045 - L1049 were not covered by tests
}
if remoteChecksum != nil {
err = tr.compareChecksum(remoteChecksum, localChecksum)
Expand Down

0 comments on commit 39d8c16

Please sign in to comment.