My main problem now is on the read path. When I try to query for the records by other bins, I’m getting AEROSPIKE_ERR_INDEX_NOT_FOUND when I can clearly see the secondary index on my namespace/set in AMC…
>>> query = as_client.query(AS_NS, AS_SET)
>>> query.select('value', 'ts')
>>> from aerospike import predicates as p
>>> query.where( p.equals('channel', "WEB") )
>>> def print_result((key, metadata, record)):
... print (key, record)
...
>>> query.foreach( print_result)
Traceback (most recent call last):
File "", line 1, in
Exception: (201L, 'AEROSPIKE_ERR_INDEX_NOT_FOUND', 'src/main/aerospike/aerospike_query.c', 223)
I would check to see if the secondary index is on the correct namespace and set and with similar bin type or not. In your case secondary index should be on AS_NS, AS_SET of TEXT type.
Show indexes shows the indexes present on all the nodes … Here I see only two tables and your’s is a 3 node cluster. Is the output truncated ?
If not then problem is one of the node not in sync with other nodes in terms of index metadata … To identify why would that happen can you share the log from the node where the secondary is missing. To identify which nodes does not have index you can run the following command
$> asinfo -v 'sindex-list:' -p <port> -h <ip>
Default value of port is 3000 you may not specify is if servers are running on default port