thanos-io / thanos

Highly available Prometheus setup with long term storage capabilities. A CNCF Incubating project.
https://thanos.io
Apache License 2.0
13.05k stars 2.09k forks source link

Invalid `--marker` enum value: `no-downsample-mark.json` #6166

Open RohitKochhar opened 1 year ago

RohitKochhar commented 1 year ago

Thanos, Prometheus and Golang version used: Thanos v0.30.2

Object Storage Provider: AWS

What happened:

Following my contribution with https://github.com/thanos-io/thanos/pull/5945, there is new functionality to mark a block for no-downsample in the same way that blocks can be marked for no-compact.

When running the command: thanos tools bucket mark --objstore.config="..." --marker=no-downsample-mark.json --details="..." --id=BLOCK_ID, the following error is given:

enum value must be one of deletion-mark.json,no-compact-mark.json, got 'no-downsample-mark.json

This is unexpected, as the line with checks the enum value is as follows (cmd/thanos/tools_bucket.go:242): cmd.Flag("marker", "Marker to be put.").Required().EnumVar(&tbc.marker, metadata.DeletionMarkFilename, metadata.NoCompactMarkFilename, metadata.NoDownsampleMarkFilename). The value of metadata.NoDownsampleMarkFilename is "no-downsample-mark.json", so I am not sure why the enum check is not including this as an allowed value for this command.

What you expected to happen:

The --marker flag should accept no-downsample-mark.json the same way that it accepts deletion-mark.json or no-compact-mark.json

How to reproduce it (as minimally and precisely as possible):

Mark any block with no-downsample-mark.json using the following command:

thanos tools bucket mark --objstore.config="..." --marker=no-downsample-mark.json --details="..." --id=BLOCK_ID

RohitKochhar commented 1 year ago

This issue can be assigned to me, I just need some advice on what might be the issue

RohitKochhar commented 1 year ago

Looking for some help on this @yeya24

jimethn commented 1 year ago

This is impacting us, we need a way to mark blocks for no-downsample. It looks like the code exists server-side, but the cli tool errors when I try to use it.

michalschott commented 1 year ago

Similar issue https://github.com/thanos-io/thanos/issues/6179