[ 
https://issues.apache.org/jira/browse/KYLIN-6068?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17930217#comment-17930217
 ] 

Guoliang Sun commented on KYLIN-6068:
-------------------------------------

h3. Dev Design

- Disable the scheduled cleanup task related to SpringSession:  
  - Set `spring.session.jdbc.cleanup-flag` to `false` to disable the scheduled 
cleanup task (`spring.session.jdbc.cleanup-cron-task`).
  - Retain the original setting `spring.session.jdbc.cleanup-cron=-` to disable 
the default scheduled cleanup task of SpringSession itself.  
- Based on Kylin5's scheduling mechanism (where only tasks annotated with 
`@Scheduled` and `JdbcJobScheduler.isMaster=true` are executed), schedule the 
SpringSession cleanup task (default interval: 30 minutes via 
`spring.session.jdbc.cleanup-cron-task`). The Master node is responsible for 
submitting the cleanup task, which may be executed on any node.  
h4. Boundary Conditions

- Could multiple cleanup tasks exist simultaneously?  
  - Normally, no. Before submitting a task, the system checks if a task of the 
same type already exists. If it does, the new task will not be submitted. 
However, since there is no unique index in the database, multiple tasks might 
be submitted under extreme conditions.

> Spring Session Cleanup to Avoid MySQL Deadlock Warnings
> -------------------------------------------------------
>
>                 Key: KYLIN-6068
>                 URL: https://issues.apache.org/jira/browse/KYLIN-6068
>             Project: Kylin
>          Issue Type: Improvement
>    Affects Versions: 5.0.0
>            Reporter: Guoliang Sun
>            Assignee: Guoliang Sun
>            Priority: Major
>             Fix For: 5.0.2
>
>
> Spring Session Cleanup to Avoid MySQL Deadlock Warnings  
> The fix for Kylin4 relies on epoch, while Kylin5 requires a redesigned 
> solution.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to