is there a way to have oban read jobs from Read replica ? As Job is picked from primary node but the dadta is not replicated on the replica yet and job fails at times and goes in to retry to pass. If Oban Job would read from replica this should solve the problem.
No, it’s not possible to have Oban use a read replica for standard operation (running jobs), because fetching and executing jobs is a write operation. Fetching records that an attempt happened, where it happened, and at what time. Then, when execution finishes, it records the status. All of those are write operations.
You’ll need to handle that situation in your workers or by scheduling jobs slightly in the future to compensate for the lag.
2 Likes
Thanks, yes already handling it on the job side. Tried the scheduled_in option but due to timezone issues it didn’t quite workout. We are good for now and thanks for such an amazing piece of tech.
1 Like