cybozu-go / moco

MySQL operator on Kubernetes using GTID-based semi-synchronous replication.

Home Page:https://cybozu-go.github.io/moco/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A backup of another sourcename with the same prefix is restored.

yoheinbb opened this issue · comments

Describe the bug
If there are backups with sourcename xx-1 and xx-11, restoring by specifying xx-1 and after the last date and time of the xx-1 backup will restore xx-11.

Expected behavior
If sourcename is xx-1, only the backup of xx-1 is restored.

Additional context
Backup paths xx-1 and xx-11 are both listed because the object is retrieved by prefix.

moco/pkg/bucket/s3.go

Lines 112 to 120 in 1e5089d

func (b s3Bucket) List(ctx context.Context, prefix string) ([]string, error) {
li := &s3.ListObjectsV2Input{
Bucket: &b.name,
}
if len(prefix) > 0 {
li.Prefix = &prefix
}
p := s3.NewListObjectsV2Paginator(b.client, li)

Resolved by #648.