Skip to content
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

[DSIP-80][Scheduler] Fix scheduler duplicate fired #16816

Open
2 tasks done
Tracked by #14102
ruanwenjun opened this issue Nov 18, 2024 · 0 comments
Open
2 tasks done
Tracked by #14102

[DSIP-80][Scheduler] Fix scheduler duplicate fired #16816

ruanwenjun opened this issue Nov 18, 2024 · 0 comments
Assignees

Comments

@ruanwenjun
Copy link
Member

ruanwenjun commented Nov 18, 2024

Search before asking

  • I had searched in the DSIP and found no similar DSIP.

Motivation

I sometimes find the scheduler might be duplicate triggered.
image

This might happen when ProcessScheduleTask has a bad performance or the isolation levels is incorrect or we use incorrect quartz parameters.

The said thing is that we don't have any metrics to monitor whether there exist duplicate fired.

Design Detail

Add a new table t_ds_schedule_instance to record the scheduler fired instance.

CREATE TABLE `t_ds_schedule_instance` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT 'key',
  `schedule_id` int NOT NULL,
   `workflow_instance_id` int NOT NULL,
  `expect_fire_time` bigint NOT NULL,
  `actual_fire_time` bigint NOT NULL,
  `create_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_t_ds_schedule_si_eft` (`schedule_id`,`expect_fire_time`)
) ENGINE=InnoDB AUTO_INCREMENT=60 DEFAULT CHARSET=utf8mb3

Each record in this table represend a success fired of quartz.

Once the scheduler triggered success we will insert a ScheduleInstance, if there exist duplicate record will throw exception from db.

image

Compatibility, Deprecation, and Migration Plan

Compatibility with previous version, since the table is newly created.

Test Plan

Test by IT.

Code of Conduct

@ruanwenjun ruanwenjun added Waiting for reply Waiting for reply DSIP labels Nov 18, 2024
@ruanwenjun ruanwenjun self-assigned this Nov 18, 2024
@ruanwenjun ruanwenjun added 3.3.0 and removed Waiting for reply Waiting for reply labels Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant