Skip to content

Commit 62b2513

Browse files
authored
Merge pull request #5960 from cortexproject/prepare-release-1.17.1
Prepare release 1.17.1
2 parents fcb227a + 22cc7d2 commit 62b2513

File tree

8 files changed

+68
-12
lines changed

8 files changed

+68
-12
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
## master / unreleased
44

5+
## 1.17.1 2024-05-20
6+
7+
* [CHANGE] Query Frontend/Ruler: Omit empty data, errorType and error fields in API response. #5953 #5954
8+
* [ENHANCEMENT] Ingester: Added `upload_compacted_blocks_enabled` config to ingester to parameterize uploading compacted blocks. #5959
9+
* [BUGFIX] Querier: Select correct tenant during query federation. #5943
10+
511
## 1.17.0 2024-04-30
612

713
* [CHANGE] Azure Storage: Upgraded objstore dependency and support Azure Workload Identity Authentication. Added `connection_string` to support authenticating via SAS token. Marked `msi_resource` config as deprecating. #5645

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.17.0
1+
1.17.1

docs/configuration/config-file-reference.md

+4
Original file line numberDiff line numberDiff line change
@@ -2916,6 +2916,10 @@ lifecycler:
29162916
# CLI flag: -ingester.active-series-metrics-idle-timeout
29172917
[active_series_metrics_idle_timeout: <duration> | default = 10m]
29182918
2919+
# Enable uploading compacted blocks.
2920+
# CLI flag: -ingester.upload-compacted-blocks-enabled
2921+
[upload_compacted_blocks_enabled: <boolean> | default = true]
2922+
29192923
instance_limits:
29202924
# Max ingestion rate (samples/sec) that ingester will accept. This limit is
29212925
# per-ingester, not per-tenant. Additional push requests will be rejected.

pkg/ingester/ingester.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ type Config struct {
110110
// Use blocks storage.
111111
BlocksStorageConfig cortex_tsdb.BlocksStorageConfig `yaml:"-"`
112112

113+
// UploadCompactedBlocksEnabled enables uploading compacted blocks.
114+
UploadCompactedBlocksEnabled bool `yaml:"upload_compacted_blocks_enabled"`
115+
113116
// Injected at runtime and read from the distributor config, required
114117
// to accurately apply global limits.
115118
DistributorShardingStrategy string `yaml:"-"`
@@ -143,6 +146,7 @@ func (cfg *Config) RegisterFlags(f *flag.FlagSet) {
143146
f.DurationVar(&cfg.ActiveSeriesMetricsUpdatePeriod, "ingester.active-series-metrics-update-period", 1*time.Minute, "How often to update active series metrics.")
144147
f.DurationVar(&cfg.ActiveSeriesMetricsIdleTimeout, "ingester.active-series-metrics-idle-timeout", 10*time.Minute, "After what time a series is considered to be inactive.")
145148

149+
f.BoolVar(&cfg.UploadCompactedBlocksEnabled, "ingester.upload-compacted-blocks-enabled", true, "Enable uploading compacted blocks.")
146150
f.Float64Var(&cfg.DefaultLimits.MaxIngestionRate, "ingester.instance-limits.max-ingestion-rate", 0, "Max ingestion rate (samples/sec) that ingester will accept. This limit is per-ingester, not per-tenant. Additional push requests will be rejected. Current ingestion rate is computed as exponentially weighted moving average, updated every second. This limit only works when using blocks engine. 0 = unlimited.")
147151
f.Int64Var(&cfg.DefaultLimits.MaxInMemoryTenants, "ingester.instance-limits.max-tenants", 0, "Max users that this ingester can hold. Requests from additional users will be rejected. This limit only works when using blocks engine. 0 = unlimited.")
148152
f.Int64Var(&cfg.DefaultLimits.MaxInMemorySeries, "ingester.instance-limits.max-series", 0, "Max series that this ingester can hold (across all tenants). Requests to create additional series will be rejected. This limit only works when using blocks engine. 0 = unlimited.")
@@ -2107,9 +2111,7 @@ func (i *Ingester) createTSDB(userID string) (*userTSDB, error) {
21072111
func() labels.Labels { return l },
21082112
metadata.ReceiveSource,
21092113
func() bool {
2110-
// There is no need to upload compacted blocks since OOO blocks
2111-
// won't be compacted due to overlap.
2112-
return false
2114+
return i.cfg.UploadCompactedBlocksEnabled
21132115
},
21142116
true, // Allow out of order uploads. It's fine in Cortex's context.
21152117
metadata.NoneFunc,

pkg/querier/tenantfederation/merge_queryable.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ func (m *mergeQuerier) Select(ctx context.Context, sortSeries bool, hints *stora
339339
return fmt.Errorf("unexpected type %T", jobIntf)
340340
}
341341
// Based on parent ctx here as we are using lazy querier.
342-
newCtx := user.InjectOrgID(parentCtx, ids[job.pos])
342+
newCtx := user.InjectOrgID(parentCtx, job.id)
343343
seriesSets[job.pos] = &addLabelsSeriesSet{
344344
upstream: job.querier.Select(newCtx, sortSeries, hints, filteredMatchers...),
345345
labels: labels.Labels{

pkg/querier/tenantfederation/merge_queryable_test.go

+44
Original file line numberDiff line numberDiff line change
@@ -446,11 +446,42 @@ func TestMergeQueryable_Select(t *testing.T) {
446446
name: "should return only series for team-a and team-c tenants when there is a not-equals matcher for the team-b tenant",
447447
matchers: []*labels.Matcher{{Name: defaultTenantLabel, Value: "team-b", Type: labels.MatchNotEqual}},
448448
expectedSeriesCount: 4,
449+
expectedLabels: []labels.Labels{
450+
{
451+
{Name: "__tenant_id__", Value: "team-a"},
452+
{Name: "instance", Value: "host1"},
453+
{Name: "tenant-team-a", Value: "static"},
454+
},
455+
{
456+
{Name: "__tenant_id__", Value: "team-a"},
457+
{Name: "instance", Value: "host2.team-a"},
458+
},
459+
{
460+
{Name: "__tenant_id__", Value: "team-c"},
461+
{Name: "instance", Value: "host1"},
462+
{Name: "tenant-team-c", Value: "static"},
463+
},
464+
{
465+
{Name: "__tenant_id__", Value: "team-c"},
466+
{Name: "instance", Value: "host2.team-c"},
467+
},
468+
},
449469
},
450470
{
451471
name: "should return only series for team-b when there is an equals matcher for the team-b tenant",
452472
matchers: []*labels.Matcher{{Name: defaultTenantLabel, Value: "team-b", Type: labels.MatchEqual}},
453473
expectedSeriesCount: 2,
474+
expectedLabels: []labels.Labels{
475+
{
476+
{Name: "__tenant_id__", Value: "team-b"},
477+
{Name: "instance", Value: "host1"},
478+
{Name: "tenant-team-b", Value: "static"},
479+
},
480+
{
481+
{Name: "__tenant_id__", Value: "team-b"},
482+
{Name: "instance", Value: "host2.team-b"},
483+
},
484+
},
454485
},
455486
{
456487
name: "should return one series for each tenant when there is an equals matcher for the host1 instance",
@@ -516,6 +547,19 @@ func TestMergeQueryable_Select(t *testing.T) {
516547
name: "should return only series for team-b when there is an equals matcher for team-b tenant",
517548
matchers: []*labels.Matcher{{Name: defaultTenantLabel, Value: "team-b", Type: labels.MatchEqual}},
518549
expectedSeriesCount: 2,
550+
expectedLabels: []labels.Labels{
551+
{
552+
{Name: "__tenant_id__", Value: "team-b"},
553+
{Name: "instance", Value: "host1"},
554+
{Name: "original___tenant_id__", Value: "original-value"},
555+
{Name: "tenant-team-b", Value: "static"},
556+
},
557+
{
558+
{Name: "__tenant_id__", Value: "team-b"},
559+
{Name: "instance", Value: "host2.team-b"},
560+
{Name: "original___tenant_id__", Value: "original-value"},
561+
},
562+
},
519563
},
520564
{
521565
name: "should return all series when there is an equals matcher for the original value of __tenant_id__ using the revised tenant label",

pkg/ruler/api_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -337,15 +337,15 @@ func TestRuler_DeleteNamespace(t *testing.T) {
337337

338338
router.ServeHTTP(w, req)
339339
require.Equal(t, http.StatusAccepted, w.Code)
340-
require.Equal(t, "{\"status\":\"success\",\"data\":null,\"errorType\":\"\",\"error\":\"\"}", w.Body.String())
340+
require.Equal(t, "{\"status\":\"success\"}", w.Body.String())
341341

342342
// On Partial failures
343343
req = requestFor(t, http.MethodDelete, "https://localhost:8080/api/v1/rules/namespace2", nil, "user1")
344344
w = httptest.NewRecorder()
345345

346346
router.ServeHTTP(w, req)
347347
require.Equal(t, http.StatusInternalServerError, w.Code)
348-
require.Equal(t, "{\"status\":\"error\",\"data\":null,\"errorType\":\"server_error\",\"error\":\"unable to delete rg\"}", w.Body.String())
348+
require.Equal(t, "{\"status\":\"error\",\"errorType\":\"server_error\",\"error\":\"unable to delete rg\"}", w.Body.String())
349349
}
350350

351351
func TestRuler_LimitsPerGroup(t *testing.T) {
@@ -430,7 +430,7 @@ rules:
430430
- record: up_rule
431431
expr: up{}
432432
`,
433-
output: "{\"status\":\"success\",\"data\":null,\"errorType\":\"\",\"error\":\"\"}",
433+
output: "{\"status\":\"success\"}",
434434
},
435435
{
436436
name: "when exceeding the rule group limit after sending the first group",
@@ -490,7 +490,7 @@ rules:
490490
expr: |2+
491491
up{}
492492
`,
493-
output: "{\"status\":\"success\",\"data\":null,\"errorType\":\"\",\"error\":\"\"}",
493+
output: "{\"status\":\"success\"}",
494494
},
495495
{
496496
name: "when pushing group that CANNOT be safely converted from RuleGroupDesc to RuleGroup yaml",

pkg/util/api/response.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ const (
1919
// Response defines the Prometheus response format.
2020
type Response struct {
2121
Status string `json:"status"`
22-
Data interface{} `json:"data"`
23-
ErrorType v1.ErrorType `json:"errorType"`
24-
Error string `json:"error"`
22+
Data interface{} `json:"data,omitempty"`
23+
ErrorType v1.ErrorType `json:"errorType,omitempty"`
24+
Error string `json:"error,omitempty"`
2525
Warnings []string `json:"warnings,omitempty"`
2626
}
2727

0 commit comments

Comments
 (0)