mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
[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
This commit is contained in:
@@ -34,8 +34,8 @@ const MAX_ENTRIES_IN_OUTPUT_TAR = 100
|
|||||||
const MAX_BLG_FILES = 50
|
const MAX_BLG_FILES = 50
|
||||||
const OBJECT_ID_REGEX = /^[0-9a-f]{24}$/
|
const OBJECT_ID_REGEX = /^[0-9a-f]{24}$/
|
||||||
|
|
||||||
const MIGRATE_FROM = new Date('2026-01-14').getTime()
|
const MIGRATE_FROM = Settings.apis.clsiCache.reshardFrom
|
||||||
const MIGRATE_UNTIL = new Date('2026-01-21').getTime()
|
const MIGRATE_UNTIL = Settings.apis.clsiCache.reshardUntil
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} projectId
|
* @param {string} projectId
|
||||||
@@ -55,8 +55,7 @@ function getAvailableShard(projectId) {
|
|||||||
const now = Date.now()
|
const now = Date.now()
|
||||||
if (
|
if (
|
||||||
now > MIGRATE_FROM &&
|
now > MIGRATE_FROM &&
|
||||||
now < MIGRATE_UNTIL &&
|
(counter % 100) / 100 >
|
||||||
(counter % 100) / 100 <
|
|
||||||
(MIGRATE_UNTIL - now) / (MIGRATE_UNTIL - MIGRATE_FROM)
|
(MIGRATE_UNTIL - now) / (MIGRATE_UNTIL - MIGRATE_FROM)
|
||||||
) {
|
) {
|
||||||
shards = Settings.apis.clsiCache.shards.slice(
|
shards = Settings.apis.clsiCache.shards.slice(
|
||||||
|
|||||||
@@ -61,6 +61,10 @@ module.exports = {
|
|||||||
shards: JSON.parse(process.env.CLSI_CACHE_INSTANCES || '[]').filter(
|
shards: JSON.parse(process.env.CLSI_CACHE_INSTANCES || '[]').filter(
|
||||||
({ zone, readOnly }) => zone === process.env.ZONE && !readOnly
|
({ 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: {
|
filestore: {
|
||||||
url:
|
url:
|
||||||
|
|||||||
Reference in New Issue
Block a user