Skip to content

Commit b4dd196

Browse files
julietteOvaxvms
andcommitted
Rebase and complete per-sample ha deduplication
Signed-off-by: juliette.orain <juliette.orain@ovhcloud.com> Co-authored-by: Nicolas DUPEUX <nicolas.dupeux@ovhcloud.com>
1 parent d7ba540 commit b4dd196

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
* [ENHANCEMENT] OTLP: Add metric `cortex_distributor_otlp_requests_by_content_type_total` to track content type (json or proto) of OTLP packets. #13525
7070
* [ENHANCEMENT] OTLP: Add experimental metric `cortex_distributor_otlp_array_lengths` to better understand the layout of OTLP packets in practice. #13525
7171
* [ENHANCEMENT] Ruler: gRPC errors without details are classified as `operator` errors, and rule evaluation failures (such as duplicate labelsets) are classified as `user` errors. #13586
72+
* [ENHANCEMENT] HA: Deduplicate per sample instead of per batch. #13665
7273
* [BUGFIX] Compactor: Fix potential concurrent map writes. #13053
7374
* [BUGFIX] Query-frontend: Fix issue where queries sometimes fail with `failed to receive query result stream message: rpc error: code = Canceled desc = context canceled` if remote execution is enabled. #13084
7475
* [BUGFIX] Query-frontend: Fix issue where query stats, such as series read, did not include the parameters to the `histogram_quantile` and `histogram_fraction` functions if remote execution was enabled. #13084
@@ -97,7 +98,6 @@
9798
* [BUGFIX] Rename `cortex_bucket_store_cached_postings_compression_time_seconds`, `cortex_query_frontend_regexp_matcher_count`, and `cortex_query_frontend_regexp_matcher_optimized_count` to follow naming conventions. #13599
9899
* [BUGFIX] Query-frontend: Fix incorrect query results when running sharding inside MQE is enabled and the query contains a subquery eligible for subquery spin-off wrapped in a shardable aggregation. #13619
99100
* [BUGFIX] Memberlist: Fix occasional nil pointer dereference panics. #13635
100-
* [ENHANCEMENT] HA: Deduplication per sample instead of per batch. #xxxxx
101101

102102
### Mixin
103103

pkg/distributor/distributor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1331,8 +1331,8 @@ func (d *Distributor) prePushHaDedupeMiddleware(next PushFunc) PushFunc {
13311331

13321332
if len(req.Timeseries) > 0 {
13331333
err = next(ctx, pushReq)
1334+
errs.Add(err)
13341335
}
1335-
errs.Add(err)
13361336

13371337
return errs.Err()
13381338
})

pkg/distributor/distributor_test.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2445,7 +2445,7 @@ func BenchmarkDistributor_Push(b *testing.B) {
24452445

24462446
return metrics, samples
24472447
},
2448-
expectedErr: "replicas did not mach, rejecting sample:",
2448+
expectedErr: "",
24492449
},
24502450
}
24512451

@@ -5192,7 +5192,10 @@ func TestHaDedupeMiddleware(t *testing.T) {
51925192
},
51935193
expectedReqs: []*mimirpb.WriteRequest{makeWriteRequestForGenerators(5, labelSetGenWithCluster(cluster1), nil, nil)},
51945194
expectedNextCalls: 1,
5195-
expectErrs: []*status.Status{nil, status.New(codes.AlreadyExists, newReplicasDidNotMatchError(replica2, replica1).Error())},
5195+
expectErrs: []*status.Status{
5196+
nil,
5197+
status.New(codes.AlreadyExists, newReplicasDidNotMatchError(replica2, replica1).Error()),
5198+
},
51965199
expectDetails: []*mimirpb.ErrorDetails{nil, replicasDidNotMatchDetails},
51975200
}, {
51985201
name: "exceed max ha clusters limit",

0 commit comments

Comments
 (0)