mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[Upgrade Assistant] Fix watermark calculation (#154420)
This commit is contained in:
parent
ee123ac5e9
commit
cc52e132f3
2 changed files with 6 additions and 5 deletions
|
@ -113,7 +113,7 @@ describe('Disk space API', () => {
|
|||
.getSettings as jest.Mock
|
||||
).mockResolvedValue({
|
||||
defaults: {},
|
||||
transient: { 'cluster.routing.allocation.disk.watermark.low': '80%' },
|
||||
transient: { 'cluster.routing.allocation.disk.watermark.low': '79%' },
|
||||
persistent: { 'cluster.routing.allocation.disk.watermark.low': '85%' },
|
||||
});
|
||||
|
||||
|
@ -128,7 +128,7 @@ describe('Disk space API', () => {
|
|||
nodeName: 'node_name',
|
||||
nodeId: '1YOaoS9lTNOiTxR1uzSgRA',
|
||||
available: '20%',
|
||||
lowDiskWatermarkSetting: '80%',
|
||||
lowDiskWatermarkSetting: '79%',
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
@ -186,7 +186,7 @@ describe('Disk space API', () => {
|
|||
.getSettings as jest.Mock
|
||||
).mockResolvedValue({
|
||||
defaults: {
|
||||
'cluster.routing.allocation.disk.watermark.low': '10%',
|
||||
'cluster.routing.allocation.disk.watermark.low': '85%',
|
||||
},
|
||||
transient: {},
|
||||
persistent: {},
|
||||
|
|
|
@ -88,9 +88,10 @@ export function registerNodeDiskSpaceRoute({ router, lib: { handleEsError } }: R
|
|||
const rawLowDiskWatermarkPercentageValue = Number(
|
||||
lowDiskWatermarkSetting!.replace('%', '')
|
||||
);
|
||||
// ES interprets this setting as a threshold for used disk space; we want free disk space
|
||||
const freeDiskSpaceAllocated = 100 - rawLowDiskWatermarkPercentageValue;
|
||||
|
||||
// If the percentage available is < the low disk watermark setting, mark node as having low disk space
|
||||
if (percentageAvailable < rawLowDiskWatermarkPercentageValue) {
|
||||
if (percentageAvailable < freeDiskSpaceAllocated) {
|
||||
nodesWithLowDiskSpace.push({
|
||||
nodeId,
|
||||
nodeName: node.name || nodeId,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue