Skip to content

Commit 312b610

Browse files
authored
Merge pull request #6561 from cortexproject/cherry-pick-5921
Cherry pick 5921 and release v1.17.2
2 parents 62b2513 + f7d7d59 commit 312b610

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
lines changed

.github/workflows-doc.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ As of October 2020, GitHub Actions do not persist between different jobs in the
6969
- name: Compressing Images
7070
run: tar -zcvf images.tar.gz /tmp/images
7171
- name: Cache Images
72-
uses: actions/upload-artifact@v2
72+
uses: actions/upload-artifact@v4
7373
with:
7474
name: Docker Images
7575
path: ./images.tar.gz

.github/workflows/test-build-deploy.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ jobs:
107107
touch build-image/.uptodate
108108
make BUILD_IN_CONTAINER=false web-build
109109
- name: Upload Website Artifact
110-
uses: actions/upload-artifact@v2
110+
uses: actions/upload-artifact@v4
111111
with:
112112
name: website public
113113
path: website/public/
@@ -119,7 +119,7 @@ jobs:
119119
- name: Create Docker Images Archive
120120
run: tar -cvf images.tar /tmp/images
121121
- name: Upload Docker Images Artifact
122-
uses: actions/upload-artifact@v2
122+
uses: actions/upload-artifact@v4
123123
with:
124124
name: Docker Images
125125
path: ./images.tar
@@ -152,7 +152,7 @@ jobs:
152152
sudo mkdir -p /go/src/github.com/cortexproject/cortex
153153
sudo ln -s $GITHUB_WORKSPACE/* /go/src/github.com/cortexproject/cortex
154154
- name: Download Docker Images Artifacts
155-
uses: actions/download-artifact@v2
155+
uses: actions/download-artifact@v4
156156
with:
157157
name: Docker Images
158158
- name: Extract Docker Images Archive
@@ -205,7 +205,7 @@ jobs:
205205
- name: Install Docker Client
206206
run: sudo ./.github/workflows/scripts/install-docker.sh
207207
- name: Download Docker Images Artifact
208-
uses: actions/download-artifact@v2
208+
uses: actions/download-artifact@v4
209209
with:
210210
name: Docker Images
211211
- name: Extract Docker Images Archive
@@ -239,7 +239,7 @@ jobs:
239239
mkdir -p /go/src/github.com/cortexproject/cortex
240240
ln -s $GITHUB_WORKSPACE/* /go/src/github.com/cortexproject/cortex
241241
- name: Download Website Artifact
242-
uses: actions/download-artifact@v2
242+
uses: actions/download-artifact@v4
243243
with:
244244
name: website public
245245
path: website/public
@@ -280,7 +280,7 @@ jobs:
280280
mkdir -p /go/src/github.com/cortexproject/cortex
281281
ln -s $GITHUB_WORKSPACE/* /go/src/github.com/cortexproject/cortex
282282
- name: Download Docker Images Artifact
283-
uses: actions/download-artifact@v2
283+
uses: actions/download-artifact@v4
284284
with:
285285
name: Docker Images
286286
- name: Extract Docker Images Archive

CHANGELOG.md

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

33
## master / unreleased
44

5+
## 1.17.2 2025-01-28
6+
* [BUGFIX] Fix single distributor latency #5921
7+
58
## 1.17.1 2024-05-20
69

710
* [CHANGE] Query Frontend/Ruler: Omit empty data, errorType and error fields in API response. #5953 #5954

VERSION

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

pkg/ring/http.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ func (r *Ring) ServeHTTP(w http.ResponseWriter, req *http.Request) {
156156

157157
storageLastUpdate := r.KVClient.LastUpdateTime(r.key)
158158
var ingesters []ingesterDesc
159+
numTokens, ownedByAz := r.countTokensByAz()
160+
_, owned := r.countTokens()
161+
159162
for _, id := range ingesterIDs {
160163
ing := r.ringDesc.Ingesters[id]
161164
heartbeatTimestamp := time.Unix(ing.Timestamp, 0)
@@ -174,12 +177,10 @@ func (r *Ring) ServeHTTP(w http.ResponseWriter, req *http.Request) {
174177
var deltaOwnership float64
175178

176179
if r.cfg.ZoneAwarenessEnabled {
177-
numTokens, ownedByAz := r.countTokensByAz()
178180
ownership = (float64(ownedByAz[id]) / float64(math.MaxUint32+1)) * 100
179181
expectedOwnership := 1 / float64(len(numTokens[ing.Zone])) * 100
180182
deltaOwnership = (1 - expectedOwnership/ownership) * 100
181183
} else {
182-
_, owned := r.countTokens()
183184
ownership = (float64(owned[id]) / float64(math.MaxUint32+1)) * 100
184185
expectedOwnership := 1 / float64(len(owned)) * 100
185186
deltaOwnership = (1 - expectedOwnership/ownership) * 100

0 commit comments

Comments
 (0)