Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

chore: skip unavailable shards in traces AMT background migration (#8438)

Steffen Schmitz4504530e3d8a
diff --git a/worker/src/backgroundMigrations/migrateTracesToTracesAMTs.ts b/worker/src/backgroundMigrations/migrateTracesToTracesAMTs.ts
index 59d92791c6..4497a78843 100644
--- a/worker/src/backgroundMigrations/migrateTracesToTracesAMTs.ts
+++ b/worker/src/backgroundMigrations/migrateTracesToTracesAMTs.ts
@@ -35,6 +35,7 @@ async function checkQueryExists(
SELECT COUNT(*) > 0 AS exists
FROM ${queryLogTable}
WHERE query_id = '${queryId}'
+ ${env.CLICKHOUSE_CLUSTER_ENABLED === "true" ? " SETTINGS skip_unavailable_shards = 1 " : ""}
`,
format: "JSONEachRow",
});
@@ -60,6 +61,7 @@ async function checkCompletedQuery(
FROM ${queryLogTable}
WHERE query_id = '${queryId}' AND type != 'QueryStart'
LIMIT 1
+ ${env.CLICKHOUSE_CLUSTER_ENABLED === "true" ? " SETTINGS skip_unavailable_shards = 1 " : ""}
`,
format: "JSONEachRow",
});