Browse Source

[Fix-5351][K8s] Fix quartz cron task cannot take effect in K8s (#5353)

pull/3/MERGE
Shiwen Cheng 4 years ago committed by GitHub
parent
commit
3a7006a796
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      sql/dolphinscheduler_mysql.sql
  2. 2
      sql/dolphinscheduler_postgre.sql
  3. 20
      sql/upgrade/1.3.6_schema/mysql/dolphinscheduler_ddl.sql
  4. 18
      sql/upgrade/1.3.6_schema/postgresql/dolphinscheduler_ddl.sql

2
sql/dolphinscheduler_mysql.sql

@ -74,7 +74,7 @@ CREATE TABLE `QRTZ_CRON_TRIGGERS` (
DROP TABLE IF EXISTS `QRTZ_FIRED_TRIGGERS`;
CREATE TABLE `QRTZ_FIRED_TRIGGERS` (
`SCHED_NAME` varchar(120) NOT NULL,
`ENTRY_ID` varchar(95) NOT NULL,
`ENTRY_ID` varchar(200) NOT NULL,
`TRIGGER_NAME` varchar(200) NOT NULL,
`TRIGGER_GROUP` varchar(200) NOT NULL,
`INSTANCE_NAME` varchar(200) NOT NULL,

2
sql/dolphinscheduler_postgre.sql

@ -114,7 +114,7 @@ alter table QRTZ_PAUSED_TRIGGER_GRPS add primary key(SCHED_NAME,TRIGGER_GROUP);
CREATE TABLE QRTZ_FIRED_TRIGGERS (
SCHED_NAME character varying(120) NOT NULL,
ENTRY_ID character varying(95) NOT NULL,
ENTRY_ID character varying(200) NOT NULL,
TRIGGER_NAME character varying(200) NOT NULL,
TRIGGER_GROUP character varying(200) NOT NULL,
INSTANCE_NAME character varying(200) NOT NULL,

20
sql/upgrade/1.3.6_schema/mysql/dolphinscheduler_ddl.sql

@ -38,3 +38,23 @@ d//
delimiter ;
CALL uc_dolphin_T_t_ds_worker_group_R_ip_list;
DROP PROCEDURE uc_dolphin_T_t_ds_worker_group_R_ip_list;
-- uc_dolphin_T_qrtz_fired_triggers_R_entry_id
drop PROCEDURE if EXISTS uc_dolphin_T_qrtz_fired_triggers_R_entry_id;
delimiter d//
CREATE PROCEDURE uc_dolphin_T_qrtz_fired_triggers_R_entry_id()
BEGIN
IF EXISTS (SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_NAME='QRTZ_FIRED_TRIGGERS'
AND TABLE_SCHEMA=(SELECT DATABASE())
AND COLUMN_NAME ='entry_id')
THEN
ALTER TABLE QRTZ_FIRED_TRIGGERS MODIFY COLUMN `entry_id` varchar(200);
END IF;
END;
d//
delimiter ;
CALL uc_dolphin_T_qrtz_fired_triggers_R_entry_id;
DROP PROCEDURE uc_dolphin_T_qrtz_fired_triggers_R_entry_id;

18
sql/upgrade/1.3.6_schema/postgresql/dolphinscheduler_ddl.sql

@ -36,6 +36,24 @@ delimiter ;
SELECT uc_dolphin_T_t_ds_worker_group_A_ip_list();
DROP FUNCTION IF EXISTS uc_dolphin_T_t_ds_worker_group_A_ip_list();
-- uc_dolphin_T_qrtz_fired_triggers_A_entry_id
delimiter d//
CREATE OR REPLACE FUNCTION uc_dolphin_T_qrtz_fired_triggers_A_entry_id() RETURNS void AS $$
BEGIN
IF EXISTS (SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_NAME='qrtz_fired_triggers'
AND COLUMN_NAME ='entry_id')
THEN
ALTER TABLE qrtz_fired_triggers ALTER COLUMN entry_id type varchar(200);
END IF;
END;
$$ LANGUAGE plpgsql;
d//
delimiter ;
SELECT uc_dolphin_T_qrtz_fired_triggers_A_entry_id();
DROP FUNCTION IF EXISTS uc_dolphin_T_qrtz_fired_triggers_A_entry_id();
-- Add foreign key constraints for t_ds_task_instance --
delimiter ;
ALTER TABLE t_ds_task_instance ADD CONSTRAINT foreign_key_instance_id FOREIGN KEY(process_instance_id) REFERENCES t_ds_process_instance(id) ON DELETE CASCADE;

Loading…
Cancel
Save