@@ -233,8 +233,9 @@ type Ingester struct {
233
233
TSDBState TSDBState
234
234
235
235
// Rate of pushed samples. Only used by V2-ingester to limit global samples push rate.
236
- ingestionRate * util_math.EwmaRate
237
- inflightPushRequests atomic.Int64
236
+ ingestionRate * util_math.EwmaRate
237
+ inflightPushRequests atomic.Int64
238
+ maxInflightPushRequests util_math.MaxTracker
238
239
239
240
inflightQueryRequests atomic.Int64
240
241
maxInflightQueryRequests util_math.MaxTracker
@@ -710,7 +711,7 @@ func New(cfg Config, limits *validation.Overrides, registerer prometheus.Registe
710
711
cfg .ActiveSeriesMetricsEnabled ,
711
712
i .getInstanceLimits ,
712
713
i .ingestionRate ,
713
- & i .inflightPushRequests ,
714
+ & i .maxInflightPushRequests ,
714
715
& i .maxInflightQueryRequests ,
715
716
cfg .BlocksStorageConfig .TSDB .PostingsCache .Blocks .Enabled || cfg .BlocksStorageConfig .TSDB .PostingsCache .Head .Enabled )
716
717
i .validateMetrics = validation .NewValidateMetrics (registerer )
@@ -792,7 +793,7 @@ func NewForFlusher(cfg Config, limits *validation.Overrides, registerer promethe
792
793
false ,
793
794
i .getInstanceLimits ,
794
795
nil ,
795
- & i .inflightPushRequests ,
796
+ & i .maxInflightPushRequests ,
796
797
& i .maxInflightQueryRequests ,
797
798
cfg .BlocksStorageConfig .TSDB .PostingsCache .Blocks .Enabled || cfg .BlocksStorageConfig .TSDB .PostingsCache .Head .Enabled ,
798
799
)
@@ -918,8 +919,8 @@ func (i *Ingester) updateLoop(ctx context.Context) error {
918
919
metadataPurgeTicker := time .NewTicker (metadataPurgePeriod )
919
920
defer metadataPurgeTicker .Stop ()
920
921
921
- maxInflightRequestResetTicker := time .NewTicker (maxInflightRequestResetPeriod )
922
- defer maxInflightRequestResetTicker .Stop ()
922
+ maxTrackerResetTicker := time .NewTicker (maxInflightRequestResetPeriod )
923
+ defer maxTrackerResetTicker .Stop ()
923
924
924
925
for {
925
926
select {
@@ -937,8 +938,9 @@ func (i *Ingester) updateLoop(ctx context.Context) error {
937
938
938
939
case <- activeSeriesTickerChan :
939
940
i .updateActiveSeries (ctx )
940
- case <- maxInflightRequestResetTicker .C :
941
+ case <- maxTrackerResetTicker .C :
941
942
i .maxInflightQueryRequests .Tick ()
943
+ i .maxInflightPushRequests .Tick ()
942
944
case <- userTSDBConfigTicker .C :
943
945
i .updateUserTSDBConfigs ()
944
946
case <- ctx .Done ():
@@ -1068,6 +1070,7 @@ func (i *Ingester) Push(ctx context.Context, req *cortexpb.WriteRequest) (*corte
1068
1070
1069
1071
// We will report *this* request in the error too.
1070
1072
inflight := i .inflightPushRequests .Inc ()
1073
+ i .maxInflightPushRequests .Track (inflight )
1071
1074
defer i .inflightPushRequests .Dec ()
1072
1075
1073
1076
gl := i .getInstanceLimits ()
0 commit comments