Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecating vparquet v1 #3377

Merged
merged 4 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
* [BUGFIX] Fix TLS when GRPC is enabled on HTTP [#3300](https://github.com/grafana/tempo/pull/3300) (@joe-elliott)
* [BUGFIX] Correctly return 400 when max limit is requested on search. [#3340](https://github.com/grafana/tempo/pull/3340) (@joe-elliott)
* [BUGFIX] Fix autocomplete filters sometimes returning erroneous results. [#3339](https://github.com/grafana/tempo/pull/3339) (@joe-elliott)
* [CHANGE] **Breaking Change** Deprecating vParquet v1 [#3377](https://github.com/grafana/tempo/pull/3377) (@ie-pham)

## v2.3.1 / 2023-11-28

Expand Down
2 changes: 1 addition & 1 deletion docs/sources/tempo/configuration/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,7 @@ storage:

# block configuration
block:
# block format version. options: v2, vParquet, vParquet2, vParquet3
# block format version. options: v2, vParquet2, vParquet3
[version: <string> | default = vParquet3]

# bloom filter false positive rate. lower values create larger filters but fewer false positives
Expand Down
4 changes: 2 additions & 2 deletions docs/sources/tempo/configuration/parquet.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ You can still use the previous format `vParquet2`.
To enable it, set the block version option to `vParquet2` in the Storage section of the configuration file.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is weird advice. we should likely not be advising anyone to set their version to vParquet2 at this point.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, the full context was. Default = vParquet3. But "You can still use the previous format vParquet2."


```yaml
# block format version. options: v2, vParquet, vParquet2, vParquet3
# block format version. options: v2, vParquet2, vParquet3
[version: vParquet2]
```

In some cases, you may choose to disable Parquet and use the old `v2` block format. Using the `v2` block format disables all forms of search, but also reduces resource consumption, and may be desired for a high-throughput cluster that does not need these capabilities. To make this change, set the block version option to `v2` in the Storage section of the configuration file.

```yaml
# block format version. options: v2, vParquet, vParquet2, vParquet3
# block format version. options: v2, vParquet2, vParquet3
[version: v2]
```

Expand Down
85 changes: 83 additions & 2 deletions tempodb/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/grafana/tempo/tempodb/encoding/common"
"github.com/grafana/tempo/tempodb/wal"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

Expand Down Expand Up @@ -92,7 +93,7 @@ func TestValidateConfig(t *testing.T) {
{
cfg: &Config{
WAL: &wal.Config{
Version: "vParquet",
Version: "vParquet2",
},
Block: &common.BlockConfig{
IndexDownsampleBytes: 1,
Expand All @@ -104,7 +105,7 @@ func TestValidateConfig(t *testing.T) {
},
expectedConfig: &Config{
WAL: &wal.Config{
Version: "vParquet",
Version: "vParquet2",
},
Block: &common.BlockConfig{
IndexDownsampleBytes: 1,
Expand All @@ -127,6 +128,86 @@ func TestValidateConfig(t *testing.T) {
}
}

func TestDeprecatedVersions(t *testing.T) {
errorMessage := "this version of vParquet has been deprecated, please use vParquet2 or higher"
tests := []struct {
cfg *Config
expectedConfig *Config
err string
}{
// block version not copied to wal if populated
{
cfg: &Config{
WAL: &wal.Config{
Version: "vParquet2",
},
Block: &common.BlockConfig{
IndexDownsampleBytes: 1,
IndexPageSizeBytes: 1,
BloomFP: 0.01,
BloomShardSizeBytes: 1,
Version: "vParquet3",
},
},
expectedConfig: &Config{
WAL: &wal.Config{
Version: "vParquet2",
},
Block: &common.BlockConfig{
IndexDownsampleBytes: 1,
IndexPageSizeBytes: 1,
BloomFP: 0.01,
BloomShardSizeBytes: 1,
Version: "vParquet3",
},
},
},
{
cfg: &Config{
WAL: &wal.Config{
Version: "vParquet",
},
Block: &common.BlockConfig{
IndexDownsampleBytes: 1,
IndexPageSizeBytes: 1,
BloomFP: 0.01,
BloomShardSizeBytes: 1,
Version: "v2",
},
},
err: errorMessage,
},
{
cfg: &Config{
WAL: &wal.Config{
Version: "vParquet2",
},
Block: &common.BlockConfig{
IndexDownsampleBytes: 1,
IndexPageSizeBytes: 1,
BloomFP: 0.01,
BloomShardSizeBytes: 1,
Version: "vParquet",
},
},
err: errorMessage,
},
}

for _, test := range tests {
err := validateConfig(test.cfg)
if test.err == "" {
require.Equal(t, nil, err)
} else {
assert.Contains(t, err.Error(), test.err)
}

if test.expectedConfig != nil {
require.Equal(t, test.expectedConfig, test.cfg)
}
}
}

func TestValidateCompactorConfig(t *testing.T) {
compactorConfig := CompactorConfig{
MaxCompactionRange: 0,
Expand Down
4 changes: 4 additions & 0 deletions tempodb/encoding/common/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,9 @@ func ValidateConfig(b *BlockConfig) error {
return fmt.Errorf("positive value required for bloom-filter shard size")
}

if b.Version == "vParquet" {
joe-elliott marked this conversation as resolved.
Show resolved Hide resolved
return fmt.Errorf("this version of vParquet has been deprecated, please use vParquet2 or higher")
}

return b.DedicatedColumns.Validate()
}
1 change: 0 additions & 1 deletion tempodb/encoding/versioned.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ func LatestEncoding() VersionedEncoding {
func AllEncodings() []VersionedEncoding {
return []VersionedEncoding{
v2.Encoding{},
vparquet.Encoding{},
vparquet2.Encoding{},
vparquet3.Encoding{},
}
Expand Down
5 changes: 5 additions & 0 deletions tempodb/wal/wal.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/grafana/tempo/tempodb/backend/local"
"github.com/grafana/tempo/tempodb/encoding"
"github.com/grafana/tempo/tempodb/encoding/common"
"github.com/grafana/tempo/tempodb/encoding/vparquet"
)

const (
Expand All @@ -36,6 +37,10 @@ type Config struct {
}

func ValidateConfig(c *Config) error {
if c.Version == vparquet.VersionString {
return fmt.Errorf("this version of vParquet has been deprecated, please use vParquet2 or higher")
}

if _, err := encoding.FromVersion(c.Version); err != nil {
return fmt.Errorf("failed to validate block version %s: %w", c.Version, err)
}
Expand Down
Loading