UBERF-8425: Improve parallel ws upgrade logging within one ws service (#9118)

Signed-off-by: Alexey Zinoviev <alexey.zinoviev@xored.com>
This commit is contained in:
Alexey Zinoviev
2025-05-28 22:58:33 +07:00
committed by GitHub
parent ae0d06ef5f
commit 70c704d468
20 changed files with 163 additions and 171 deletions
+5 -1
View File
@@ -268,6 +268,7 @@ export async function upgradeModel (
const { hierarchy, modelDb, model } = await buildModel(ctx, newModel)
const { migrateClient: preMigrateClient } = await prepareMigrationClient(
ctx,
pipeline,
hierarchy,
modelDb,
@@ -302,6 +303,7 @@ export async function upgradeModel (
})
const { migrateClient, migrateState } = await prepareMigrationClient(
ctx,
pipeline,
hierarchy,
modelDb,
@@ -390,6 +392,7 @@ export async function upgradeModel (
}
async function prepareMigrationClient (
ctx: MeasureContext,
pipeline: Pipeline,
hierarchy: Hierarchy,
model: ModelDb,
@@ -410,7 +413,8 @@ async function prepareMigrationClient (
storageAdapter,
accountClient,
wsIds,
queue
queue,
ctx
)
const states = await migrateClient.find<MigrationState>(DOMAIN_MIGRATION, { _class: core.class.MigrationState })
const sts = Array.from(groupByArray(states, (it) => it.plugin).entries())
+3 -2
View File
@@ -36,13 +36,14 @@ export class MigrateClientImpl implements MigrationClient {
readonly storageAdapter: StorageAdapter,
readonly accountClient: AccountClient,
readonly wsIds: WorkspaceIds,
readonly queue: PlatformQueueProducer<QueueWorkspaceMessage>
readonly queue: PlatformQueueProducer<QueueWorkspaceMessage>,
ctx?: MeasureContext
) {
if (this.pipeline.context.lowLevelStorage === undefined) {
throw new Error('lowLevelStorage is not defined')
}
this.lowLevel = this.pipeline.context.lowLevelStorage
this.ctx = new MeasureMetricsContext('migrateClient', {})
this.ctx = ctx ?? new MeasureMetricsContext('migrateClient', {})
}
migrateState = new Map<string, Set<string>>()