Issue with aerospike ordered_map

Hi, I am using aerospike KEY_ORDERED map for a usecase. When I am trying to get value of a key which does not exist in the map, I am getting “Error Code 4: Parameter error” error. Below is the code snippet

Key key = new Key(namespace, set, primarykey);
Record record = client.operate(null, key, MapOperation.getByKey("data", Value.get(keyname), MapReturnType.VALUE));

However the same code works fine and returns null for unordered_map. Please let me know if I am missing something here. I want the KEY_ORDERED map to return a null value instead of the exception “Error Code 4: Parameter error”.

Thanks for the help in advance.

What is your Aerospike server version? Verified, I get the same failure on Server ver 3.16.0.6. I get the exception with KEY_VALUE_ORDERED also.

Exception in thread "main" com.aerospike.client.AerospikeException: Error Code 4: Parameter error
	at com.aerospike.client.command.ReadCommand.parseResult(ReadCommand.java:111)
	at com.aerospike.client.command.SyncCommand.execute(SyncCommand.java:84)
	at com.aerospike.client.AerospikeClient.operate(AerospikeClient.java:1277)

I am using aerospike server version 4.0.0.5

This was a bug in server version 4.0.0.5. In the latest server version, both unordered and ordered maps return null values (no error) when the map key does not exist.

1 Like

Hi Brian, What is the latest server version in which this bug is solved? Is it 4.3.0.4 server version?

Also will only updating the client version help?

The bug was fixed in server version 4.1.0.1 (AER-5855)

https://www.aerospike.com/download/server/notes.html#4.1.0.1

This is not a client bug.

1 Like