Problem Description
When using the JDBC driver and performing a select query, the following error is being reported :-Error -1: Aerospike asynchronous command failure
Explanation
There are 2 possible scenarios that could lead to this error being reported :-1) This has been caused by a bug relating to secondary indexes.
If a bin within a set was being queried that didn't have a secondary index, but the bin with the same name in another set does have a secondary index, then the driver would get these mixed up and try and perform a secondary index scan.
2) There is an actual timeout
In this scenario, the data has taken a while to start coming back and so this has led to a timeout.
Solution
For 1)The JDBC driver needs updating to at least 1.8.0 where this issue was resolved
For 2)
It is possible to add a timeout parameter recordSetTimeoutMs which has a default of 1000 to a higher value.
Driver parameters can be specified on the JDBC URL, so for this parameter, here is an example URL :-
jdbc:aerospike:172.17.0.3:3000/test?recordSetTimeoutMs=15000