how can i get the lock information in Mysql Cluster

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

how can i get the lock information in Mysql Cluster

陈良
Hi:
------------------
  how can I get the lock  information in Mysql Cluster.
When in Innodb,i can query the table innodb_trx、innodb_locks、innodb_lock_waits,but in cluster,I didn't find the similary tables.so If any problems occured,how can i hand it.
 
  ------------------
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how can i get the lock information in Mysql Cluster

Magnus Blåudd
On 2015-11-10 08:37, 陈良 wrote:
> Hi:
> ------------------
>    how can I get the lock  information in Mysql Cluster.
> When in Innodb,i can query the table innodb_trx、innodb_locks、innodb_lock_waits,but in cluster,I didn't find the similary tables.so If any problems occured,how can i hand it.
>
>    ------------------
>

You can use the tables and views in the ndbinfo database to get more
information about  what's going on inside the cluster. For example, the
ndbinfo.cluster_transactions table shows information about all ongoing
transactions.

https://dev.mysql.com/doc/refman/5.6/en/mysql-cluster-ndbinfo.html
https://dev.mysql.com/doc/refman/5.6/en/mysql-cluster-ndbinfo-cluster-transactions.html 


/ Magnus

--
MySQL Cluster Mailing List
For list archives: http://lists.mysql.com/cluster
To unsubscribe:    http://lists.mysql.com/cluster

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: 回复: how can i get the lock information in Mysql Cluster

Magnus Blåudd
On 2015-11-11 02:14, 陈良 wrote:
>
> hi Magnus Blåudd
> thank you for replying.
> I think my problem was not solved.

Ok, I'm not sure all the information you need is available.

> I observe every tables in ndbinfo,the table what matter most to my
> problem is cluster_transactions witch you recommended,but I can just
> find the state of current transacitons,not the relation between the
> transcations,when the lock happened,I can not known who blocks the others.
> as I do a test.

Did you also try to "drill down" into cluster_operations to see the
operations related to each of those transactions. Perhaps they provide
something making it possible to figure out how they are blocking each other?



> I update a table without commit,and then in another transaction I update
> it aganin,before the mysql throw erro "ERROR 1205 (HY000): Lock wait
> timeout exceeded; try restarting transaction",I make a query:
> select * from cluster_transactions \G;
> the result is just the state of two transactions,so where can i find the
> lock information ?
> *************************** 1. row ***************************
>                 node_id: 2
>          block_instance: 0
>                 transid: 45040394320216230
>                   state: Started
>        count_operations: 5
> outstanding_operations: 0
>        inactive_seconds: 218
>          client_node_id: 4
>        client_block_ref: 32778
> *************************** 2. row ***************************
>                 node_id: 3
>          block_instance: 0
>                 transid: 382811465885040530
>                   state: Scanning
>        count_operations: 1
> outstanding_operations: 0
>        inactive_seconds: 0
>          client_node_id: 5
>        client_block_ref: 32853
> 2 rows in set (0.06 sec)
>

Good example! You see the client_node_id which indicates which mysqld is
running the query and also the transid which is the transaction
identifier for the transaction in the cluster.

There is actually another table called
information_schema.ndb_transid_mysql_connection_map and also there are
two views on top of ndbinfo.cluster_transactions and
ndbinfo.cluster_operations which are called ndbinfo.server_transactions
and ndbinfo.server_operations which " includes only those transactions
in which the current SQL node (MySQL Server) is a participant, while
including the relevant connection IDs".


https://dev.mysql.com/doc/refman/5.6/en/ndb-transid-mysql-connection-map-table.html
https://dev.mysql.com/doc/refman/5.6/en/mysql-cluster-ndbinfo-server-transactions.html
https://dev.mysql.com/doc/refman/5.6/en/mysql-cluster-ndbinfo-server-operations.html

Hope this helps you get further.

/ Magnus

>
>
> ------------------ 原始邮件 ------------------
> *发件人:* "Magnus Blåudd";<[hidden email]>;
> *发送时间:* 2015年11月10日(星期二) 下午5:27
> *收件人:* "陈良"<[hidden email]>; "cluster"<[hidden email]>;
> *主题:* Re: how can i get the lock information in Mysql Cluster
>
> On 2015-11-10 08:37, 陈良 wrote:
>  > Hi:
>  > ------------------
>  >    how can I get the lock  information in Mysql Cluster.
>  > When in Innodb,i can query the table innodb_trx、innodb_locks、
> innodb_lock_waits,but in cluster,I didn't find the similary tables.so If
> any problems occured,how can i hand it.
>  >
>  >    ------------------
>  >
>
> You can use the tables and views in the ndbinfo database to get more
> information about  what's going on inside the cluster. For example, the
> ndbinfo.cluster_transactions table shows information about all ongoing
> transactions.
>
> https://dev.mysql.com/doc/refman/5.6/en/mysql-cluster-ndbinfo.html
> https://dev.mysql.com/doc/refman/5.6/en/mysql-cluster-ndbinfo-cluster-transactions.html
>
>
>
> / Magnus


--
MySQL Cluster Mailing List
For list archives: http://lists.mysql.com/cluster
To unsubscribe:    http://lists.mysql.com/cluster

Loading...