Jgroups nodes failed to add unique value to custom column of JGROUPSPING table

138 Views Asked by At

Hope you all are doing well.

We are using Infinispan distributed caching using jgroups. The JDBC_PING protocol is used for registering and synchronizing nodes. We are adding one custom column (node_name) in jgroupsping table to uniquely identify each nodes. Here, it is expected that, each node should add unique identifier to custom column (unique identifier is the unique value set to environment property of each node).

But post nodes are registered to the JDBC_PING table, we see custom column value is same for all the nodes. Can anybody please let me know why this custom_column value is duplicated? Basically, first node value is used by all other nodes.

**create table sql : **

CREATE TABLE IF NOT EXISTS jgroupsping (
   own_addr varchar(200) NOT NULL, 
   cluster_name varchar(200) NOT NULL, 
   ping_data varbinary(5000) DEFAULT NULL, 
   node_name varchar(50), 
   PRIMARY KEY (own_addr, cluster_name)) 
   DEFAULT CHARSET=utf8"

Jgroups-tcp.xml insert-sql :

insert_single_sql="INSERT INTO JGROUPSPING (own_addr, cluster_name, ping_data, node_name) values (?, ?, ?,'${UNIQUE_NODE_NAME}' )"

Files:

infinispan-configs.xml : enter image description here jgroups-tcp.xml : enter image description here

Thanks in advance,

jgroupsping table status post 2 nodes started in distributed mode:

enter image description here

Here, you can see same node_name is inserted for both the nodes even when nodes has unique value.

Why Jgroups does so? What is the way to insert unique value in node_name column of jgroupping table.

1

There are 1 best solutions below

1
Bela Ban On

I can only support Pedro's answer: if you see unique values on the different members, then debug the insert_single_sql statement execution in all nodes. If the insert is successful, then the values must be unique. Have you defined the other sql statements in JDBC_PING? e.g. select_all_ping_data?