mirror of
https://github.com/kemko/nomad.git
synced 2026-01-07 10:55:42 +03:00
scheduler: fix a bug where we subtract reserved node resources twice (#23386)
Fixes a bug in the nodeResources.Comparable method, where CPU resources were accidentally offset with reserved resources, whereas functions that use this field expect total CPU resources.
This commit is contained in:
committed by
GitHub
parent
c84b4ad67b
commit
8f80bd505f
3
.changelog/23386.txt
Normal file
3
.changelog/23386.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
```release-note:bug
|
||||
scheduler: Fix a bug where reserved resources are not calculated correctly
|
||||
```
|
||||
@@ -105,6 +105,7 @@ func node2k() *Node {
|
||||
Grade: numalib.Performance,
|
||||
BaseSpeed: 1000,
|
||||
}},
|
||||
OverrideWitholdCompute: 1000, // set by client reserved field
|
||||
},
|
||||
},
|
||||
Memory: NodeMemoryResources{
|
||||
|
||||
@@ -3191,7 +3191,7 @@ func (n *NodeResources) Comparable() *ComparableResources {
|
||||
c := &ComparableResources{
|
||||
Flattened: AllocatedTaskResources{
|
||||
Cpu: AllocatedCpuResources{
|
||||
CpuShares: int64(n.Processors.Topology.UsableCompute()),
|
||||
CpuShares: int64(n.Processors.Topology.TotalCompute()),
|
||||
ReservedCores: reservableCores,
|
||||
},
|
||||
Memory: AllocatedMemoryResources{
|
||||
|
||||
Reference in New Issue
Block a user