From eb497d4017f931e3f371d352b7921c4c064cda7f Mon Sep 17 00:00:00 2001 From: Daniel Deluiggi Date: Tue, 1 Nov 2022 16:00:42 -0700 Subject: [PATCH] Upload global marker before local Signed-off-by: Daniel Deluiggi --- CHANGELOG.md | 1 + pkg/storage/tsdb/bucketindex/markers_bucket_client.go | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 368a385fa4e..e3a0806d859 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -72,6 +72,7 @@ * [BUGFIX] QueryFrontend: fixed query_range requests when query has `start` equals to `end`. #4877 * [BUGFIX] AlertManager: fixed issue introduced by #4495 where templates files were being deleted when using alertmanager local store. #4890 * [BUGFIX] Ingester: fixed incorrect logging at the start of ingester block shipping logic. #4934 +* [BUGFIX] Storage/Bucket: fixed global mark missing on deletion. #4949 ## 1.13.0 2022-07-14 diff --git a/pkg/storage/tsdb/bucketindex/markers_bucket_client.go b/pkg/storage/tsdb/bucketindex/markers_bucket_client.go index 4858e3e2c0b..e175f10f90b 100644 --- a/pkg/storage/tsdb/bucketindex/markers_bucket_client.go +++ b/pkg/storage/tsdb/bucketindex/markers_bucket_client.go @@ -37,13 +37,13 @@ func (b *globalMarkersBucket) Upload(ctx context.Context, name string, r io.Read return err } - // Upload it to the original location. - if err := b.parent.Upload(ctx, name, bytes.NewBuffer(body)); err != nil { + // Upload it to the global marker's location. + if err := b.parent.Upload(ctx, globalMarkPath, bytes.NewBuffer(body)); err != nil { return err } - // Upload it to the global markers location too. - return b.parent.Upload(ctx, globalMarkPath, bytes.NewBuffer(body)) + // Upload it to the original location too. + return b.parent.Upload(ctx, name, bytes.NewBuffer(body)) } // Delete implements objstore.Bucket.