From 3aa69c6ffac40b16aa2bc9bdab6b0b7671e0b5a0 Mon Sep 17 00:00:00 2001 From: Jakob Ackermann Date: Thu, 19 Mar 2026 17:13:15 +0100 Subject: [PATCH] [k8s] clsi-cache: double the number of shards (#32323) * [k8s] clsi-cache: double the number of shards * [monorepo] add missing clsi-cache env vars to dev-env * [clsi] flip direction of clsi-cache shard migration * [clsi] remove upper bound from clsi-cache shard migration GitOrigin-RevId: a325a11c3ac9e22a12ad2d8ea802b91d2e175e24 --- services/clsi/app/js/CLSICacheHandler.js | 7 +++---- services/clsi/config/settings.defaults.cjs | 4 ++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/services/clsi/app/js/CLSICacheHandler.js b/services/clsi/app/js/CLSICacheHandler.js index 0f97a889b1..c9de59d52f 100644 --- a/services/clsi/app/js/CLSICacheHandler.js +++ b/services/clsi/app/js/CLSICacheHandler.js @@ -34,8 +34,8 @@ const MAX_ENTRIES_IN_OUTPUT_TAR = 100 const MAX_BLG_FILES = 50 const OBJECT_ID_REGEX = /^[0-9a-f]{24}$/ -const MIGRATE_FROM = new Date('2026-01-14').getTime() -const MIGRATE_UNTIL = new Date('2026-01-21').getTime() +const MIGRATE_FROM = Settings.apis.clsiCache.reshardFrom +const MIGRATE_UNTIL = Settings.apis.clsiCache.reshardUntil /** * @param {string} projectId @@ -55,8 +55,7 @@ function getAvailableShard(projectId) { const now = Date.now() if ( now > MIGRATE_FROM && - now < MIGRATE_UNTIL && - (counter % 100) / 100 < + (counter % 100) / 100 > (MIGRATE_UNTIL - now) / (MIGRATE_UNTIL - MIGRATE_FROM) ) { shards = Settings.apis.clsiCache.shards.slice( diff --git a/services/clsi/config/settings.defaults.cjs b/services/clsi/config/settings.defaults.cjs index 693194c1f4..bf0e7df63c 100644 --- a/services/clsi/config/settings.defaults.cjs +++ b/services/clsi/config/settings.defaults.cjs @@ -61,6 +61,10 @@ module.exports = { shards: JSON.parse(process.env.CLSI_CACHE_INSTANCES || '[]').filter( ({ zone, readOnly }) => zone === process.env.ZONE && !readOnly ), + currentShards: parseInt(process.env.CLSI_CACHE_CURRENT_SHARDS, 10), + desiredShards: parseInt(process.env.CLSI_CACHE_DESIRED_SHARDS, 10), + reshardFrom: new Date(process.env.CLSI_CACHE_RESHARD_FROM), + reshardUntil: new Date(process.env.CLSI_CACHE_RESHARD_UNTIL), }, filestore: { url: