-
Notifications
You must be signed in to change notification settings - Fork 495
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
Spring shedlock table update row commit getting failed when the backend DB (Mysql InnoDB cluster) is running in multi-primary mode #1779
Comments
Hi, thanks for the report. ShedLock is actually catching the exception and is just logging it. Does it log it every time or just sometimes? In general, this will be hard to solve. I do not have any experience with MySQL in multi-primary mode, I do not know what its transaction properties are. Can you please share your lock provider config? Do you use |
Hi @lukas-krecan Thanks for responding to the issue. Please find my comments below: Does it log it every time or just sometimes? Can you please share your lock provider config? Do you use .usingDbTime() setting? |
Can you please try |
Hi @lukas-krecan , |
Hi, can you please try |
Would this be helpful to you? It allows you to configure the lock provider in a way that throws the unexpected exception. You can then wrap the lock provider and retry the execution in case of MySql conflict. |
#1779 Ability to rethrow unexpected exception in JdbcTemplateStorageAccessor
A spring boot microservice deployed in OCP and makes connection to the backend database using mysql-router image. This service contains a scheduler class (using @scheduled annotation) to do certain workflows based on a cron expression. This microservice is running with multiple nodes.
In order to stop the scheduler class getting executed from all the nodes, SHEDLOCK implementation was done. This setup was working perfectly when the backend database (Mysql Inno DB cluster) is running in Single-primary mode.
Recently, we have changed the database mode from single-primary to multi-primary mode, Similarly mysql-router configurations were also changed from first available mode to round robin mode. Post this implementation, when the SHEDLOCK library is trying to update the lock timings in SHEDLOCK table, the jdbc execution gets failed with below error. Kindly help for solving this issue.
Exception details:
The text was updated successfully, but these errors were encountered: