From d40ff5e4a485f131a1f6d4614867129813215ade Mon Sep 17 00:00:00 2001 From: "siddarth.msv" Date: Fri, 27 Dec 2024 16:18:17 +0530 Subject: [PATCH] fix: wrong terminal counts calculated during migration check --- jobsdb/migration.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jobsdb/migration.go b/jobsdb/migration.go index 37594d6175..b89bb99e01 100644 --- a/jobsdb/migration.go +++ b/jobsdb/migration.go @@ -568,7 +568,7 @@ func (jd *Handle) checkIfMigrateDS(ds dataSetT) ( `with combinedResult as ( select (select count(*) from %[1]q) as totalJobCount, - (select count(*) from %[2]q where job_state = ANY($1)) as terminalJobCount, + (select count(*) from "v_last_%[2]s" where job_state = ANY($1)) as terminalJobCount, (select created_at from %[1]q order by job_id desc limit 1) as maxCreatedAt, COALESCE((select exec_time < $2 from %[2]q where job_state = ANY($1) order by id asc limit 1), false) as retentionExpired )