Skip to content

Commit

Permalink
fix(ha-tracker): set electedAtTime to now when the received replicaDe…
Browse files Browse the repository at this point in the history
…sc ha deletedAt higher than zero

Signed-off-by: Nikos Angelopoulos <[email protected]>
  • Loading branch information
NickAnge committed Jan 20, 2025
1 parent 59868b5 commit ee985d4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/distributor/ha_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,10 @@ func (h *defaultHaTracker) updateKVStore(ctx context.Context, userID, cluster, r
} else {
if desc == nil && electedAtTime == 0 {
electedAtTime = timestamp.FromTime(now)
} else if desc != nil && desc.DeletedAt > 0 {
// if we receive a ReplicaDesc that have been marked as deleted but not deleted from the kvStore yet,
// we need to set the value to electedAtTime, otherwise it's going be zero 0
electedAtTime = timestamp.FromTime(now)
}
}
// Attempt to update KVStore to our timestamp and replica.
Expand Down

0 comments on commit ee985d4

Please sign in to comment.