@@ -992,7 +992,7 @@ func (i *Ingester) v2Query(ctx context.Context, req *client.QueryRequest) (*clie
992
992
993
993
i .metrics .queries .Inc ()
994
994
995
- if i .checkIfTSDBClosed () {
995
+ if i .checkIfAllTSDBClosing () {
996
996
return & client.QueryResponse {}, nil
997
997
}
998
998
@@ -1052,7 +1052,7 @@ func (i *Ingester) v2QueryExemplars(ctx context.Context, req *client.ExemplarQue
1052
1052
1053
1053
i .metrics .queries .Inc ()
1054
1054
1055
- if i .checkIfTSDBClosed () {
1055
+ if i .checkIfAllTSDBClosing () {
1056
1056
return & client.ExemplarQueryResponse {}, nil
1057
1057
}
1058
1058
@@ -1101,7 +1101,7 @@ func (i *Ingester) v2LabelValues(ctx context.Context, req *client.LabelValuesReq
1101
1101
return nil , err
1102
1102
}
1103
1103
1104
- if i .checkIfTSDBClosed () {
1104
+ if i .checkIfAllTSDBClosing () {
1105
1105
return & client.LabelValuesResponse {}, nil
1106
1106
}
1107
1107
@@ -1137,7 +1137,7 @@ func (i *Ingester) v2LabelNames(ctx context.Context, req *client.LabelNamesReque
1137
1137
return nil , err
1138
1138
}
1139
1139
1140
- if i .checkIfTSDBClosed () {
1140
+ if i .checkIfAllTSDBClosing () {
1141
1141
return & client.LabelNamesResponse {}, nil
1142
1142
}
1143
1143
@@ -1173,7 +1173,7 @@ func (i *Ingester) v2MetricsForLabelMatchers(ctx context.Context, req *client.Me
1173
1173
return nil , err
1174
1174
}
1175
1175
1176
- if i .checkIfTSDBClosed () {
1176
+ if i .checkIfAllTSDBClosing () {
1177
1177
return & client.MetricsForLabelMatchersResponse {}, nil
1178
1178
}
1179
1179
@@ -1244,7 +1244,7 @@ func (i *Ingester) v2UserStats(ctx context.Context, req *client.UserStatsRequest
1244
1244
return nil , err
1245
1245
}
1246
1246
1247
- if i .checkIfTSDBClosed () {
1247
+ if i .checkIfAllTSDBClosing () {
1248
1248
return & client.UserStatsResponse {}, nil
1249
1249
}
1250
1250
@@ -1260,7 +1260,7 @@ func (i *Ingester) v2AllUserStats(ctx context.Context, req *client.UserStatsRequ
1260
1260
i .userStatesMtx .RLock ()
1261
1261
defer i .userStatesMtx .RUnlock ()
1262
1262
1263
- if i .checkIfTSDBClosed () {
1263
+ if i .checkIfAllTSDBClosing () {
1264
1264
return & client.UsersStatsResponse {}, nil
1265
1265
}
1266
1266
@@ -1308,7 +1308,7 @@ func (i *Ingester) v2QueryStream(req *client.QueryRequest, stream client.Ingeste
1308
1308
1309
1309
i .metrics .queries .Inc ()
1310
1310
1311
- if i .checkIfTSDBClosed () {
1311
+ if i .checkIfAllTSDBClosing () {
1312
1312
return nil
1313
1313
}
1314
1314
@@ -1820,7 +1820,7 @@ func (i *Ingester) getMemorySeriesMetric() float64 {
1820
1820
1821
1821
count := uint64 (0 )
1822
1822
1823
- if i .checkIfTSDBClosed () {
1823
+ if i .checkIfAllTSDBClosing () {
1824
1824
return 0
1825
1825
}
1826
1826
@@ -2283,7 +2283,7 @@ func (i *Ingester) getInstanceLimits() *InstanceLimits {
2283
2283
return l
2284
2284
}
2285
2285
2286
- func (i * Ingester ) checkIfTSDBClosed () bool {
2286
+ func (i * Ingester ) checkIfAllTSDBClosing () bool {
2287
2287
if i .State () == services .Stopping {
2288
2288
level .Debug (i .logger ).Log ("msg" , "TSDB is unavailable, as the Ingester is in the process of stopping and closing all TSDB" )
2289
2289
return true
0 commit comments