From 47257b761354bb358a2d51cac1f0ca200b1ff857 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20Zi=C4=99ba?= Date: Wed, 4 May 2022 09:55:22 +0000 Subject: [PATCH] Reduce number of buckets in ttl controller for 2k+ nodes clusters --- pkg/controller/ttl/ttl_controller.go | 3 +-- pkg/controller/ttl/ttl_controller_test.go | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/pkg/controller/ttl/ttl_controller.go b/pkg/controller/ttl/ttl_controller.go index d1317b8b7ba..495b2fce6d9 100644 --- a/pkg/controller/ttl/ttl_controller.go +++ b/pkg/controller/ttl/ttl_controller.go @@ -108,8 +108,7 @@ var ( {sizeMin: 90, sizeMax: 500, ttlSeconds: 15}, {sizeMin: 450, sizeMax: 1000, ttlSeconds: 30}, {sizeMin: 900, sizeMax: 2000, ttlSeconds: 60}, - {sizeMin: 1800, sizeMax: 10000, ttlSeconds: 300}, - {sizeMin: 9000, sizeMax: math.MaxInt32, ttlSeconds: 600}, + {sizeMin: 1800, sizeMax: math.MaxInt32, ttlSeconds: 300}, } ) diff --git a/pkg/controller/ttl/ttl_controller_test.go b/pkg/controller/ttl/ttl_controller_test.go index cabd6c4a58b..91b038be7f7 100644 --- a/pkg/controller/ttl/ttl_controller_test.go +++ b/pkg/controller/ttl/ttl_controller_test.go @@ -211,6 +211,20 @@ func TestDesiredTTL(t *testing.T) { boundaryStep: 1, expectedTTL: 0, }, + { + deleteNode: true, + nodeCount: 1800, + desiredTTL: 300, + boundaryStep: 4, + expectedTTL: 60, + }, + { + deleteNode: true, + nodeCount: 10000, + desiredTTL: 300, + boundaryStep: 4, + expectedTTL: 300, + }, } for i, testCase := range testCases {