I wanted to know which error codes(of c client) are mapped to the server’s error-codes in the scenario when the data is unavailable in the SC mode(unavailable partitions/dead partitions).
The server’s error codes( PARTITION_UNAVAILABLE , INVALID_NODE_ERROR , TIMEOUT and CONNECTION_ERROR) have been described here.
In general, error codes > 0 are server generated error codes. Error codes < 0 are client generated error codes. There are some exceptions like AEROSPIKE_ERR_TIMEOUT (9) which is generated by both client and server.
Server PARTITION_UNAVAILABLE (11) is equivalent to AEROSPIKE_ERR_CLUSTER (11). AEROSPIKE_ERR_INVALID_NODE (-8) and AEROSPIKE_ERR_CONNECTION (-10) is only generated by the client.
Thanks for your reply Vishal, I believe we are tracking this under a support case at present, do you mind confirming with your internal Aerospike folks? If I am thinking of the same issue, ask the team if you can be put in copy and we’ll make sure you are kept updated on the responses.
The AEROSPIKE_ERR_CLIENT (-1) status code with “Node not found for partition” message indicates a there is no active node that currently owns the partition containing the command’s key. This a client generated message when trying to read the client’s data partition map.
The server can also return PARTITION_UNAVAILABLE (11) when the server node is active, but the data partition is not readable in order to adhere to strong consistency. The C client mapping of this code is AEROSPIKE_ERR_CLUSTER (11).
Hi Vishal, the sequence is going to be as follows:
during the time of the partition / node loss you are going to see timeouts.
Once the partition has been marked as unavailable you will see AEROSPIKE_ERR_CLUSTER in the following circumstances:
Partition is unavailable but client has not got new partition map, Aerospike C client versions 4.4.1 and lower
Partition is unavailable and Aerospike C client version >=4.5 no other node has claimed partition ownership and node is running.
In Aerospike C Client 4.4.1 you can get AEROSPIKE_ERR_CLIENT once the partition has been marked as unavailable and the clients have new partition maps. In these versions, if a node did not claim ownership of a partition (due to it being unavailable) the entry would be removed from the partition map.
Quick update, the next client version will actually return AEROSPIKE_ERR_INVALID_NODE for the specific error when the client doesn’t have any node mapping for a given partition. The AEROSPIKE_ERR_CLIENT will remain a generic client error. We will also update the documentation for AEROSPIKE_ERR_CLUSTER which is actually not a generic cluster error, but the very specific error code 11 (partition unavailable).