@@ -120,21 +120,26 @@ func verifyChecksum(ctx context.Context, taskMeta *TaskMeta, subtaskMeta *PostPr
120120 }
121121 remoteChecksum , err := checksumTable (ctx , globalTaskManager , taskMeta , logger )
122122 if err != nil {
123- return err
123+ if taskMeta .Plan .Checksum != config .OpLevelOptional {
124+ return err
125+ }
126+ logger .Warn ("checksumTable failed, will skip this error and go on" , zap .Error (err ))
124127 }
125- if ! remoteChecksum .IsEqual (& localChecksum ) {
126- err2 := common .ErrChecksumMismatch .GenWithStackByArgs (
127- remoteChecksum .Checksum , localChecksum .Sum (),
128- remoteChecksum .TotalKVs , localChecksum .SumKVS (),
129- remoteChecksum .TotalBytes , localChecksum .SumSize (),
130- )
131- if taskMeta .Plan .Checksum == config .OpLevelOptional {
132- logger .Warn ("verify checksum failed, but checksum is optional, will skip it" , zap .Error (err2 ))
133- err2 = nil
128+ if remoteChecksum != nil {
129+ if ! remoteChecksum .IsEqual (& localChecksum ) {
130+ err2 := common .ErrChecksumMismatch .GenWithStackByArgs (
131+ remoteChecksum .Checksum , localChecksum .Sum (),
132+ remoteChecksum .TotalKVs , localChecksum .SumKVS (),
133+ remoteChecksum .TotalBytes , localChecksum .SumSize (),
134+ )
135+ if taskMeta .Plan .Checksum == config .OpLevelOptional {
136+ logger .Warn ("verify checksum failed, but checksum is optional, will skip it" , zap .Error (err2 ))
137+ err2 = nil
138+ }
139+ return err2
134140 }
135- return err2
141+ logger . Info ( "checksum pass" , zap . Object ( "local" , & localChecksum ))
136142 }
137- logger .Info ("checksum pass" , zap .Object ("local" , & localChecksum ))
138143 return nil
139144}
140145
0 commit comments