Query on secondary index returns null via Java client

I am facing a weird situation while querying data on secondary index using Java client.

I have a 2 node aerospike cluster with data replication set to 2 which means both the node should contain all the data.Lets say my Nodes are Node1 and Node2. When i initialise the Java client using only Node1 as seed node and query the data on secondary index using the “equals” filter the resultant recordset is null,whereas when i perform the same query using Node2 as the seed node i get the expected result.

I tried querying using aql by logigng into both the nodes and i get the expected result on both hosts.

Using Node 1 as seed node when i try to query the same data on the key instead of secondary index it works fine. Initially i though my cluster must be going through some rebalancing but even after waiting for long i still face the same problem. I checked the status of index on both the nodes and it shows state as"RW" and “sync_state” as “synced”.

I have tried dropping and re-creating the index but even that doesn’t help. Any pointers?

I believe i have figured out the issue,it was to do something with the network connectivity between client and aerospike servers.

Will keep posted if i again see this issue

1 Like