Skip to content

Commit 07cf4cb

Browse files
Merge pull request #1313 from percona/main
Release 2.14.0
2 parents 7228b8b + dfd9b27 commit 07cf4cb

4 files changed

Lines changed: 19 additions & 17 deletions

File tree

e2e-tests/pkg/pbm/pbm_ctl.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ func (c *Ctl) waitForRestore(rinlist string, waitFor time.Duration) error {
248248

249249
// Restore starts restore and returns the name of op
250250
func (c *Ctl) Restore(bcpName string, options []string) (string, error) {
251-
command := append([]string{"pbm", "restore", bcpName, "-o", "json"}, options...)
251+
command := append([]string{"pbm", "restore", bcpName, "-o", "json", "--yes"}, options...)
252252
o, err := c.RunCmd(command...)
253253
if err != nil {
254254
return "", errors.Wrap(err, "run meta")
@@ -275,12 +275,12 @@ func (c *Ctl) ReplayOplog(a, b time.Time) error {
275275
}
276276

277277
func (c *Ctl) PITRestore(t time.Time) error {
278-
_, err := c.RunCmd("pbm", "restore", "--time", t.Format("2006-01-02T15:04:05"))
278+
_, err := c.RunCmd("pbm", "restore", "--time", t.Format("2006-01-02T15:04:05"), "--yes")
279279
return err
280280
}
281281

282282
func (c *Ctl) PITRestoreClusterTime(t, i uint32) error {
283-
_, err := c.RunCmd("pbm", "restore", "--time", fmt.Sprintf("%d,%d", t, i))
283+
_, err := c.RunCmd("pbm", "restore", "--time", fmt.Sprintf("%d,%d", t, i), "--yes")
284284
return err
285285
}
286286

e2e-tests/run-new-cluster

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ wait_noop
6969
pbm_run list
7070

7171
desc 'Restore'
72-
pbm_run restore --time $PITR_Time
72+
pbm_run restore --time $PITR_Time --yes
7373
wait_restore
7474
pbm_run logs -t 35
7575

pbm/backup/physical.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ func (b *Backup) uploadPhysical(
557557
// maintain uncompressed size just for the files that have a disk footprint,
558558
// backup meta might contains files which are unchanged from the previous
559559
// inc/base backup
560-
sizeUncompressed += f.Size
560+
sizeUncompressed += f.StgSizeUncompressed
561561
}
562562
}
563563

@@ -761,11 +761,12 @@ func writeFile(
761761
}
762762

763763
return &File{
764-
Name: src.Name,
765-
Size: sz,
766-
Fmode: fstat.Mode(),
767-
StgSize: finf.Size,
768-
Off: src.Off,
769-
Len: src.Len,
764+
Name: src.Name,
765+
Size: fstat.Size(),
766+
Fmode: fstat.Mode(),
767+
StgSize: finf.Size,
768+
StgSizeUncompressed: sz,
769+
Off: src.Off,
770+
Len: src.Len,
770771
}, nil
771772
}

pbm/backup/types.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,13 @@ type Condition struct {
147147
}
148148

149149
type File struct {
150-
Name string `bson:"filename" json:"filename"`
151-
Off int64 `bson:"offset" json:"offset"` // offset for incremental backups
152-
Len int64 `bson:"length" json:"length"` // length of chunk after the offset
153-
Size int64 `bson:"fileSize" json:"fileSize"`
154-
StgSize int64 `bson:"stgSize" json:"stgSize"`
155-
Fmode os.FileMode `bson:"fmode" json:"fmode"`
150+
Name string `bson:"filename" json:"filename"`
151+
Off int64 `bson:"offset" json:"offset"` // offset for incremental backups
152+
Len int64 `bson:"length" json:"length"` // length of chunk after the offset
153+
Size int64 `bson:"fileSize" json:"fileSize"`
154+
StgSize int64 `bson:"stgSize" json:"stgSize"`
155+
StgSizeUncompressed int64 `bson:"stgSizeUncompressed" json:"stgSizeUncompressed"`
156+
Fmode os.FileMode `bson:"fmode" json:"fmode"`
156157
}
157158

158159
func (f File) String() string {

0 commit comments

Comments
 (0)