Skip to content

Commit 414758c

Browse files
authored
Merge pull request #1152 from percona/PBM-1238-parse-phys-restore-status-err
PBM-1238: Add guard when parsing HB during physical restore
2 parents 642e68b + efcdcc6 commit 414758c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

pbm/restore/storage.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,11 @@ func parsePhysRestoreCond(stg storage.Storage, fname, restoreName string) (*Cond
268268
return &cond, nil
269269
}
270270

271-
cond.Timestamp, err = strconv.ParseInt(string(b), 10, 0)
272-
if err != nil {
273-
return nil, errors.Wrapf(err, "read ts from %s", fname)
271+
if len(b) != 0 {
272+
cond.Timestamp, err = strconv.ParseInt(string(b), 10, 0)
273+
if err != nil {
274+
return nil, errors.Wrapf(err, "read ts from %s", fname)
275+
}
274276
}
275-
276277
return &cond, nil
277278
}

0 commit comments

Comments
 (0)