From 44325428ae71ccf50a15279b8df7bc6679b2e120 Mon Sep 17 00:00:00 2001 From: dcaputo-harmoni <65166251+dcaputo-harmoni@users.noreply.github.com> Date: Tue, 1 Oct 2024 03:17:47 -0400 Subject: [PATCH 1/3] Fix newline in last set filename, also change s3 label to storage because it applies to all storage types (#1811) Co-authored-by: Viacheslav Sarzhan --- cmd/pitr/collector/collector.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmd/pitr/collector/collector.go b/cmd/pitr/collector/collector.go index 89bee47d15..36d3be474e 100644 --- a/cmd/pitr/collector/collector.go +++ b/cmd/pitr/collector/collector.go @@ -486,7 +486,7 @@ func (c *Collector) manageBinlog(ctx context.Context, binlog pxc.Binlog) (err er return errors.Wrapf(err, "put %s object", binlog.Name) } - log.Println("Successfully written binlog file", binlog.Name, "to s3 with name", binlogName) + log.Println("Successfully wrote binlog file", binlog.Name, "to storage with name", binlogName) err = cmd.Wait() if err != nil { @@ -502,7 +502,13 @@ func (c *Collector) manageBinlog(ctx context.Context, binlog pxc.Binlog) (err er // nolint:errcheck setBuffer.WriteString(binlog.GTIDSet.Raw()) - err = c.storage.PutObject(ctx, lastSetFilePrefix+strings.Split(gtidSet, ":")[0], &setBuffer, int64(setBuffer.Len())) + lastSetName := lastSetFilePrefix+strings.Split(gtidSet, ":")[0] + + // remove any newline characters from the last set name + lastSetName = strings.ReplaceAll(lastSetName, "\n", "") + lastSetName = strings.ReplaceAll(lastSetName, "\r", "") + + err = c.storage.PutObject(ctx, lastSetName, &setBuffer, int64(setBuffer.Len())) if err != nil { return errors.Wrap(err, "put last-set object") } From 3313bd8f05bcadc5100f1823810ff5838cc1ba61 Mon Sep 17 00:00:00 2001 From: Natalia Marukovich Date: Tue, 1 Oct 2024 14:52:13 +0200 Subject: [PATCH 2/3] K8SPXC-1392 fix KubeAPIWarningLogger .metadata.ownerReferences contains duplicate entries (#1833) * fix pmm version * fix KubeAPIWarningLogger --------- Co-authored-by: Viacheslav Sarzhan --- pkg/controller/pxc/controller.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pkg/controller/pxc/controller.go b/pkg/controller/pxc/controller.go index 4621463b5f..ef371a4173 100644 --- a/pkg/controller/pxc/controller.go +++ b/pkg/controller/pxc/controller.go @@ -503,19 +503,15 @@ func (r *ReconcilePerconaXtraDBCluster) reconcileHAProxy(ctx context.Context, cr if cr.HAProxyReplicasServiceEnabled() { svc := pxc.NewServiceHAProxyReplicas(cr) - err := setControllerReference(cr, svc, r.scheme) - if err != nil { - return errors.Wrapf(err, "%s setControllerReference", svc.Name) - } if cr.CompareVersionWith("1.14.0") >= 0 { e := cr.Spec.HAProxy.ExposeReplicas - err = r.createOrUpdateService(ctx, cr, svc, len(e.ServiceExpose.Labels) == 0 && len(e.ServiceExpose.Annotations) == 0) + err := r.createOrUpdateService(ctx, cr, svc, len(e.ServiceExpose.Labels) == 0 && len(e.ServiceExpose.Annotations) == 0) if err != nil { return errors.Wrapf(err, "%s upgrade error", svc.Name) } } else { - err = r.createOrUpdateService(ctx, cr, svc, len(podSpec.ReplicasServiceLabels) == 0 && len(podSpec.ReplicasServiceAnnotations) == 0) + err := r.createOrUpdateService(ctx, cr, svc, len(podSpec.ReplicasServiceLabels) == 0 && len(podSpec.ReplicasServiceAnnotations) == 0) if err != nil { return errors.Wrapf(err, "%s upgrade error", svc.Name) } From 54b9fd37b296790795567a20e742154ccf2e844a Mon Sep 17 00:00:00 2001 From: dcaputo-harmoni <65166251+dcaputo-harmoni@users.noreply.github.com> Date: Wed, 2 Oct 2024 06:08:27 -0400 Subject: [PATCH 3/3] Fix azure storage restore by removing hardcoded trailing slash (#1813) Co-authored-by: Viacheslav Sarzhan Co-authored-by: Natalia Marukovich --- pkg/pxc/backup/storage/storage.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/pxc/backup/storage/storage.go b/pkg/pxc/backup/storage/storage.go index 81c676d107..8768894450 100644 --- a/pkg/pxc/backup/storage/storage.go +++ b/pkg/pxc/backup/storage/storage.go @@ -235,7 +235,7 @@ func (a *Azure) PutObject(ctx context.Context, name string, data io.Reader, _ in } func (a *Azure) ListObjects(ctx context.Context, prefix string) ([]string, error) { - listPrefix := path.Join(a.prefix, prefix) + "/" + listPrefix := path.Join(a.prefix, prefix) pg := a.client.NewListBlobsFlatPager(a.container, &container.ListBlobsFlatOptions{ Prefix: &listPrefix, })