Add EmergencyLeaderTimeout parameter, ignore throttling nodes, implement NodeRecoverTimeout, introduce processNodeMap in cluster DB

This commit is contained in:
Ingo Oppermann
2023-06-07 22:08:07 +02:00
parent bd75a5ad0f
commit 7e7d1caca7
12 changed files with 746 additions and 295 deletions

View File

@@ -41,6 +41,7 @@ type NodeReader interface {
IPs() []string
About() NodeAbout
Version() NodeVersion
Resources() NodeResources
Files() NodeFiles
ProcessList() ([]Process, error)
@@ -495,6 +496,22 @@ func (n *node) About() NodeAbout {
return nodeAbout
}
func (n *node) Resources() NodeResources {
n.stateLock.RLock()
defer n.stateLock.RUnlock()
r := NodeResources{
IsThrottling: n.resources.throttling,
NCPU: n.resources.ncpu,
CPU: n.resources.cpu,
CPULimit: n.resources.cpuLimit,
Mem: n.resources.mem,
MemLimit: n.resources.memLimit,
}
return r
}
func (n *node) Version() NodeVersion {
about, err := n.AboutPeer()
if err != nil {