GoodJob v4 #1396
bensheldon
started this conversation in
Updates
GoodJob v4
#1396
Replies: 1 comment 1 reply
-
@bensheldon Hey, I'm wondering if the tracking of jobs latency, etc. should now be performed on the good_jobs table? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
GoodJob version 4.0 has been released! 🎉 GoodJob v4 has breaking changes that should be addressed through a transitionary v3.99 release, but if you've kept up with v3.x releases and migrations, you're likely ready to upgrade 🚀
Breaking changes to job schema
GoodJob v4 changes how job and job execution records are stored in the database; moving from job and executions being commingled in the
good_jobs
table to Jobs (still ingood_jobs
) having many discrete Execution records in thegood_job_executions
table.To safely upgrade, all unfinished jobs must use the new schema relationship, tracked in the
good_jobs.is_discrete
column. This change was transparently introduced in GoodJob v3.15.4 (April 2023), so your application is likely ready-to-upgrade already if you have kept up with GoodJob updates and migrations. You can check by runningv3.99
’sGoodJob.v4_ready?
in production or run the following SQL query on the production database and check it returns zero:SELECT COUNT(*) FROM "good_jobs" WHERE finished_at IS NULL AND is_discrete IS NOT TRUE
. If not all unfinished jobs are stored in the new format, either wait to upgrade until those jobs finish or discard them. If you upgrade prematurely to v4 without allowing those jobs to finish, they may never be performed.Other notable changes
GoodJob v4:
GoodJob::Job
model instead ofGoodJob::Execution
config.good_job.cleanup_interval_jobs
,GOOD_JOB_CLEANUP_INTERVAL_JOBS
,config.good_job.cleanup_interval_seconds
, orGOOD_JOB_CLEANUP_INTERVAL_SECONDS
set tonil
or”
to no longer disable count- or time-based cleanups. Instead, now set tofalse
to disable, or-1
to run a cleanup after every job execution.New Features
GoodJob v4 does not introduce any new features on its own. In the 110 releases since GoodJob v3.0 was released (June, 2022), these new features and improvements have been introduced:
perform_all_later
.GoodJob.current_thread_running?
andGoodJob.current_thread_shutting_down?
to support job iteration.queue_select_limit
 and further options for configuring queue order and performance.systemd
integration, improved health checks.A huge thank you to 88 (!) GoodJob v3.x contributors 🙇🏻 @afn, @ain2108, @aisayo, @Ajmal, @aki77, @alec-c4, @AndersGM, @andyatkinson, @andynu, @arnaudlevy, @baka-san, @benoittgt, @bforma, @BilalBudhani, @binarygit, @bkeepers, @blafri, @blumhardts, @ckdake, @cmcinnes-mdsol, @coreyaus, @DanielHeath, @defkode, @dixpac, @Earlopain, @eric-christian, @erick-tmr, @esasse, @francois-ferrandis, @frans-k, @gap777, @grncdr, @hahwul, @hidenba, @hss-mateus, @Intrepidd, @isaac, @jgrau, @jklina, @jmarsh24, @jpcamara, @jrochkind, @julienanne, @julik, @LucasKendi, @luizkowalski, @maestromac, @marckohlbrugge, @maxim, @mec, @metalelf0, @michaelglass, @mitchellhenke, @mkrfowler, @morgoth, @Mr0grog, @mthadley, @namiwang, @nickcampbell18, @padde, @patriciomacadden, @paul, @Pauloparakleto, @pgvsalamander, @remy727, @rrunyon, @saksham-jain, @sam1el, @sasha-id, @SebouChu, @segiddins, @SemihCag, @shouichi, @simi, @sparshalc, @stas, @steveroot, @TAGraves, @tagrudev, @thepry, @ur5us, @WailanTirajoh, @yenshirak, @ylansegal, @yshmarov, @zarqman
Beta Was this translation helpful? Give feedback.
All reactions