简体   繁体   English

如何使用/编码存储过程来停止 MYSQL 当前正在运行的任务?

[英]How to use/code stored procedure to stop MYSQL currently running task?

Here is my node, which sometimes freezes by the last INSERT command:这是我的节点,它有时会被最后一个 INSERT 命令冻结:

在此处输入图片说明

This process sometimes will freeze because the functionality for this node is to truncate the table.此过程有时会冻结,因为此节点的功能是截断表。 But sometimes the previous inserting command is not finished and the truncate is triggered, which will cause this node freeze for 2 hours to complete (originally should be 2 seconds to finish).但是有时候之前的插入命令没有完成,触发了truncate,会导致这个节点冻结2小时才能完成(本来应该是2秒完成)。

So my solution is to set up a timer condition if this node take too long then run the Stored procedure stop all MySQL current database tasks (the inserting Action which insert data to this table).所以我的解决方案是设置一个计时器条件,如果这个节点花费的时间太长,然后运行存储过程停止所有MySQL当前数据库任务(插入数据到这个表的插入操作)。

What stored procedure can do this work?什么存储过程可以做这个工作?

Is the previous node that is doing the insert, configured to run multiple instances?执行插入的前一个节点是否配置为运行多个实例? If it is then it is probably configured to "Move on when: Each time an instance finishes".如果是,那么它可能被配置为“在以下时间移动:每次实例完成时”。 If that is the case then you can configure the previous node to "Move on when: All instances are done".如果是这种情况,那么您可以将前一个节点配置为“在以下时间继续前进:所有实例都已完成”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM