Skip to content

Commit

Permalink
liveness: write LastUpTimestamp only on self-heartbeat
Browse files Browse the repository at this point in the history
See cockroachdb#107265 (comment).

Epic: none
Release note: none
  • Loading branch information
tbg authored and kvoli committed Jul 26, 2023
1 parent 9657947 commit 52c21e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/kv/kvserver/liveness/liveness.go
Original file line number Diff line number Diff line change
Expand Up @@ -1408,7 +1408,7 @@ func (nl *NodeLiveness) updateLivenessAttempt(
nl.mu.RLock()
cb := nl.mu.onSelfLive
nl.mu.RUnlock()
if cb != nil {
if nl.gossip.NodeID.Get() == update.newLiveness.NodeID && cb != nil {
cb(ctx)
}
return Record{Liveness: update.newLiveness, raw: v.TagAndDataBytes()}, nil
Expand Down

0 comments on commit 52c21e0

Please sign in to comment.