MCPcopy Create free account
hub / github.com/cortexproject/cortex / done

Method done

pkg/ring/replication_set_tracker.go:123–138  ·  view source on GitHub ↗
(instance *InstanceDesc, result any, err error)

Source from the content-addressed store, hash-verified

121}
122
123func (t *zoneAwareResultTracker) done(instance *InstanceDesc, result any, err error) {
124 if err != nil {
125 t.failuresByZone[instance.Zone]++
126 t.errors = append(t.errors, fmt.Errorf("(%s, %s) %w", instance.GetAddr(), instance.GetZone(), err))
127 } else {
128 if _, ok := t.resultsPerZone[instance.Zone]; !ok {
129 // If it is the first result in the zone, then total number of instances
130 // in this zone should be number of waiting required.
131 t.resultsPerZone[instance.Zone] = make([]any, 0, t.waitingByZone[instance.Zone])
132 }
133 t.resultsPerZone[instance.Zone] = append(t.resultsPerZone[instance.Zone], result)
134 }
135
136 t.waitingByZone[instance.Zone]--
137 t.doneCount++
138}
139
140func (t *zoneAwareResultTracker) finished() bool {
141 return t.doneCount == t.numInstances

Callers

nothing calls this directly

Calls 2

GetAddrMethod · 0.80
GetZoneMethod · 0.80

Tested by

no test coverage detected