forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
130026: storeliveness: intergrate with store and server r=nvanbenschoten a=miraradeva This commit initializes the Store Liveness `Transport` upon starting the server, initializes the Store Liveness `SupportManager`, and sets up the store's `SupportManager` as a message handler in the node's `Transport`. The `SupportManager` does not start heartbeating other stores until support from them is requested via `SupportFrom`. Fixes: cockroachdb#125064 Release note: None Co-authored-by: Mira Radeva <[email protected]>
- Loading branch information
Showing
13 changed files
with
116 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright 2024 The Cockroach Authors. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file licenses/BSL.txt. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0, included in the file | ||
// licenses/APL.txt. | ||
|
||
package storeliveness | ||
|
||
import "time" | ||
|
||
// Options includes all Store Liveness durations needed by the SupportManager. | ||
type Options struct { | ||
// HeartbeatInterval determines how often Store Liveness sends heartbeats. | ||
HeartbeatInterval time.Duration | ||
// LivenessInterval determines the Store Liveness support expiration time. | ||
LivenessInterval time.Duration | ||
// SupportExpiryInterval determines how often Store Liveness checks if support | ||
// should be withdrawn. | ||
SupportExpiryInterval time.Duration | ||
// IdleSupportFromInterval determines how ofter Store Liveness checks if any | ||
// stores have not appeared in a SupportFrom call recently. | ||
IdleSupportFromInterval time.Duration | ||
// SupportWithdrawalGracePeriod determines how long Store Liveness should | ||
// wait after restart before withdrawing support. It helps prevent support | ||
// churn until the first heartbeats are delivered. | ||
SupportWithdrawalGracePeriod time.Duration | ||
} | ||
|
||
// NewOptions instantiates the Store Liveness Options. | ||
func NewOptions( | ||
heartbeatInterval time.Duration, | ||
livenessInterval time.Duration, | ||
supportWithdrawalGracePeriod time.Duration, | ||
) Options { | ||
return Options{ | ||
HeartbeatInterval: heartbeatInterval, | ||
LivenessInterval: livenessInterval, | ||
SupportExpiryInterval: 1 * time.Second, | ||
IdleSupportFromInterval: 1 * time.Minute, | ||
SupportWithdrawalGracePeriod: supportWithdrawalGracePeriod, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters