Closed luizkowalski closed 23 hours ago
Sorry about that! What version were previously upgrading from?
4.4.2
alright, good news, it is not good_job. I tried to downgrade GJ, PG, etc, nothing worked. then I realized it actually looks like Rails' fault and I tracked it down to this commit not sure if GJ needs to adjust something or this is actually a regression on Rails
Ooof! Thank you so much for tracking this down.
Sounds like the solution when upgrading to Rails 8 is to use the rails-v8.0 release branch?
Oh wait, are you saying that commit newly breaks it? Or that it fixes it?
breaks, yeah
Ohhh! Can you share the whole SQL query? I was imagining that would help me leave a comment to the PR associated with the commit, but you could also do so. I think it would be good to report this as a regression in Rails
SELECT "good_jobs"."id",
"good_jobs"."queue_name",
"good_jobs"."priority",
"good_jobs"."serialized_params",
"good_jobs"."scheduled_at",
"good_jobs"."performed_at",
"good_jobs"."finished_at",
"good_jobs"."error",
"good_jobs"."created_at",
"good_jobs"."updated_at",
"good_jobs"."active_job_id",
"good_jobs"."concurrency_key",
"good_jobs"."cron_key",
"good_jobs"."cron_at",
"good_jobs"."batch_id",
"good_jobs"."batch_callback_id",
"good_jobs"."executions_count",
"good_jobs"."job_class",
"good_jobs"."error_event",
"good_jobs"."labels",
"good_jobs"."locked_by_id",
"good_jobs"."locked_at"
FROM "good_jobs"
WHERE "good_jobs"."id" IN
(WITH "rows" AS MATERIALIZED
(SELECT "good_jobs"."id", "good_jobs"."id"
FROM "good_jobs"
WHERE "good_jobs"."queue_name" = 'default'
AND "good_jobs"."finished_at" IS NULL
AND ("good_jobs"."scheduled_at" <= '2024-11-26 09:31:31.736649'
OR "good_jobs"."scheduled_at" IS NULL)
ORDER BY priority ASC NULLS LAST, "good_jobs"."created_at" ASC) SELECT "rows"."id"
FROM "rows"
WHERE pg_try_advisory_lock(('x' || substr(md5('good_jobs' || '-' || "rows"."id"::text), 1, 16))::bit(64)::bigint)
LIMIT 1)
ORDER BY priority ASC NULLS LAST,
"good_jobs"."created_at" ASC
I opened an issue on Rails too
That whole function is doing a bunch of arel stuff and may not end up in the right codepath now to dedupe these. Arel is supposed to be rails-internals only, though in practice it often isn't so.
tested main
branch, can confirm it is working. thank you all <3
hey 👋🏻
After upgrading to 4.5.0, I'm seeing this error
I can't tell exactly what's going on because the output is just messy
I vaguely remember dealing with something similar in the past, but I haven't found anything in issues or PRs. I will keep looking
I'm using PG 17.2 and Rails from
main