Skip to content

Commit

Permalink
storepool: set last unavailable on gossip dead
Browse files Browse the repository at this point in the history
Previously, the `LastUnavailable` time was set in most parts of the
storepool when a store was considered either `Unavailable`, `Dead`,
`Decommissioned` or `Draining`. When `LastUnavailable` is within the
last suspect duration (30s default), the node is treated as suspect by
other nodes in the cluster.

`LastUnavailable` was not being set when a store was considered dead due
to the store not gossiping its store descriptor. This commit updates the
`status` storepool function to do just that.

Informs: cockroachdb#98928

Release note: None
  • Loading branch information
kvoli committed Mar 20, 2023
1 parent ea389ff commit f48a32d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/kv/kvserver/allocator/storepool/store_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ func (sd *StoreDetail) status(
// even before the first gossip arrives for a store.
deadAsOf := sd.LastUpdatedTime.Add(deadThreshold)
if now.After(deadAsOf) {
sd.LastUnavailable = now
return storeStatusDead
}
// If there's no descriptor (meaning no gossip ever arrived for this
Expand Down

0 comments on commit f48a32d

Please sign in to comment.