Forum: Building VoltDB Applications

Post: Cancelling currently working sql

Cancelling currently working sql
hayatoa
Dec 9, 2011
Hi,
Is there any way that I can cancel working sql. Working sql means that voltdb is currently processing.
Strange question?
rbetts
Dec 9, 2011
No - there is not. Why are you asking? You can quiesce a cluster by entering admin-mode by using the @Pause system procedure. All outstanding transactions on the client interface TCP/IP port will finish but all new transactions received on that port will be rejected. When Paused, you can interact with the cluster only through the admin TCP/IP port.

Ryan.
Is this strange question?
hayatoa
Dec 9, 2011
No - there is not. Why are you asking? You can quiesce a cluster by entering admin-mode by using the @Pause system procedure. All outstanding transactions on the client interface TCP/IP port will finish but all new transactions received on that port will be rejected. When Paused, you can interact with the cluster only through the admin TCP/IP port.

Ryan.


Ok thank you for information. That helps a lot ;)

I will use "@Pause system procedure" reject all new transactions, and wait currently running sql to finish.

Actually, I am a bit surprised that you think my question is strange. Maybe I did not describe well enough.

While I was writing my code, I run into a situation where my stored procedure was taking long time to complete.

This was due to a bug in my stored procedure code, but anyways there was a situation that I was needed to cancel my stored procedure.

So I wonder if there is any way to cancel running stored procedure "LIKE OTHER RDBMS SUCH AS MYSQL".

Of course, database concept is different so there might not be way to cancel in voltdb. That is fine.
This might be very stupid situation. If I write forever loop in my stored procedure as below, such stored procedure will never complete, I think.

In such case, then I need to restart my voltdb clusters. This example is stupid but I would expect there will be a situation with a bug in stored procedure so that the stored procedure acts strangely.

In such situation, voltdb user might want to cancel the running stored procedure.

import org.voltdb.*;
@ProcInfo(
singlePartition = false
)
public class HowManySeats extends VoltProcedure {
public long run( )
throws VoltAbortException {
while(true){}
return null;
}
}
Timeout/ENG-1249
jpiekos
Dec 9, 2011
We've got ENG-1249 logged - that, when implemented, would address your concern. Most VoltDB queries execute in sub millisecond speed, making user/application-initiated cancellation often impractical. ENG-1249 would allow longer running transactions to timeout at some user-defined value.

I'm curious as to the type of application you are building - can you share some details or an overview?

Thanks,
John Piekos