-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quarkus Quartz: Quarkus 1.13.x scheduler is not updated in DB when updated after upgrading to Quarkus 2.x #22479
Comments
/cc @machi1990, @mkouba |
The removal of the
Quarkus's Quartz extension does not clean the phantom triggers for you. You could do so with a script using Flyway or Liquibase extensions. |
I don't remember. It was probably not documented because we did not think of this use case? |
Thanks for the quick feedback. I'll test the addition of |
I changed the
|
I think I will:
Do you have another idea/suggestion? Or do you see any problem with this approach? |
I am pretty sure that the
The other idea was to recreate the quartz table via a database migration using Flyway/Liqubase extensions, since at this point I suspect the corresponding tables might have been corrupted if you did manual modifications. |
Hi! |
Glad you had the issue fixed. |
@machi1990 It would be nice if this could be documented somewhere (maybe in the 2.1 migration guides or somewhere else) for others to be aware of this situation |
We have added a note on 2.1 about the migration. Furthermore, once this #23634 is merged. The quartz extension will provide a smooth migration for this case. |
Describe the bug
Hi everyone!
Some months ago, some schedulers were created using Quarkus 1.13.x and were deployed to production. Everything worked fine. Some weeks ago, we had the need to update the cron job of one of the scheduler but found out that the scheduler was updated in local tests but not in production. Currently we're running Quarkus 2.5.1.
After some digging in Quartz scheduler code, we found out that Quartz is not able to find the trigger because trigger name has changed from Quarkus 1.13.x to 2.x.
The query performed by Quartz is (from org.quartz.impl.jdbcjobstore.StdJDBCDelegate#selectTrigger)
"SELECT * FROM QUARTZ_TRIGGERS WHERE SCHED_NAME = 'QuarkusQuartzScheduler' AND TRIGGER_NAME = ? AND TRIGGER_GROUP = ?"
Below one can see that the column
trigger_name
fromQUARTZ_TRIGGERS
table has different values when the schedulers are created in Quarkus 1.13.x and 2.5.1: _trigger was added to the identity of the schedulerQuarkus 1.13.7
Quarkus 2.5.1
When doing the query to find the trigger, none is found and no update is done. Since the job_name is the same, no new scheduler is created. Also we deleted one of the scheduler from the code but the trigger is still in the table. I think it's not deleted due to the same problem.
I checked the migration guide to 2.x and I didn't see any mention about this changes in Quartz.
Can you tell me if this is a known issue?
I didn't yet try any workaround but I will try some solution and post it here.
Expected behavior
Schedulers created with Quarkus 1.13.x should be updated when the update is done running the app with Quarkus 2.x.
Actual behavior
Schedulers are not updated
How to Reproduce?
Output of
uname -a
orver
No response
Output of
java -version
openjdk 11.0.11 2021-04-20 OpenJDK Runtime Environment AdoptOpenJDK-11.0.11+9 (build 11.0.11+9) OpenJDK 64-Bit Server VM AdoptOpenJDK-11.0.11+9 (build 11.0.11+9, mixed mode)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.5.1.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
No response
The text was updated successfully, but these errors were encountered: