ruanwenjun commented on issue #5525:
URL: 
https://github.com/apache/dolphinscheduler/issues/5525#issuecomment-844025537


   @wangxj3 I think it is hard to get the exact time when the server down, the 
time that each instance gets this event may be different.
   Use lock on zookeeper does not seem to be a good solution for this issue, 
because some instances may get this event late.
   The best solution may be when we insert to the t_ds_alert table, check 
whether there is the same content in the database for sending, the SQL like 
below
   ```sql
   INSERT INTO t_ds_alert(instance, user, item) 
       SELECT xx, xxx, xxxx FROM t_ds_alert
           WHERE NOT EXISTS (SELECT * FROM t_ds_alert WHERE content ='' AND 
alert_status = WAIT_EXECUTION)
   ```
   I didn't test this SQL, but this should be work.
   In this way, there will be only one unsent alert for each instance in the 
database. But I think this is reasonable.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to