Nikolay Izhikov
IDIEP-39
Author
Sponsor
Created 04.02.2020
Status

IMPLEMENTED


Motivation

Ignite provides many API to deploy and execute user-provided code on the server nodes inside the same JVM as the Ignite process runs.
Ignite has many APIs that allocate many resources on the server nodes, also. 
In case of some buggy code that consumes many system resources(CPU, RAM, flood network) or heavy query the whole cluster can become unstable.

We should provide to the cluster administrator the ability to stop any user deployed task.

Description

JMX beans to cancel listed tasks should be introduced:

  • Compute task
  • Service
  • Continuous query
  • Transactions
  • Queries(SQL, Scan, Text)

In the scope of IEP-35 System view API introduced.
A new API should use the same identifier that is used in corresponding System View.

Public API changes:

  • Cancel of Scan(text) queries should work similarly to the SQL.
  • Cancel of compute task should invoke `ComputeTaskInternalFuture#cancel` for the corresponding task.
  • Cancel of service should be the same as `IgniteServices#cancel`
  • Cancel of a transaction should work the same as in `TransactionMXBean#getActiveTransaction(kill=true)`.
  • Cancel of a continuous query should work the same as `QueryCursor#close` execution.


public API
interface QueryMXBean {
    boolean cancelSQL(Long queryId); //Already implemented in IGNITE-4436.
    boolean cancelScan(Long queryId);
    boolean cancelText(Long queryId);
}   

interface ComputeMXBean {
    boolean cancel(IgniteUuid id);
}   

interface ServiceMXBean {
    boolean cancel(IgniteUuid id);
}   

interface TransactionMXBean {
    boolean cancel(IgniteUuid xid);
}

interface ContinuousQueryMXBean {
	boolean cancel(UUID id);
}

control.sh

control.sh
./control.sh --kill scan b2d221ca-ab08-4544-b8dc-8475538ed42f default 63
./control.sh --kill compute 58b48c3e071-b2d221ca-ab08-4544-b8dc-8475538ed42f
./control.sh --kill tx 30058c3e071-00000000-0bac-6d33-0000-000000000003
./control.sh --kill sql b2d221ca-ab08-4544-b8dc-8475538ed42f_7
./control.sh --kill service my-svc
./control.sh --kill continuous bfca668d-5df8-4879-b97f-bd1712ad01c9

SQL

SQL
KILL SCAN_QUERY 'b2d221ca-ab08-4544-b8dc-8475538ed42f' 'default' 63
KILL TX '30058c3e071-00000000-0bac-6d33-0000-000000000003'
KILL CONTINUOUS_QUERY 'bfca668d-5df8-4879-b97f-bd1712ad01c9'
KILL COMPUTE_TASK '58b48c3e071-b2d221ca-ab08-4544-b8dc-8475538ed42f'
KILL SERVICE 'my-svc'



Risks and Assumptions

We can identify any specific heavy process with the unique identifier.

Discussion Links

// Links to discussions on the devlist, if applicable.

Tickets

key summary type created updated due assignee reporter priority status resolution

JQL and issue key arguments for this macro require at least one Jira application link to be configured

  • No labels