We need to do multiple operations on a large hashmap bin; essentially, multiple get by keys. The keys are in no order lexicographically. So we send multiple get_key operations on the same bin with different keys but contrary to the expectation the result contains the value for just the last operation and not the values for all the keys.
Expectation :
result.bins to be {'map' => {'a' => 1, 'b' => 2, 'c' => 3}}
What really happens is that result.bins contains only the value for the last operation i.e. {'map' => {'c' => 3}}.
This thing happens for list data type as well. We tried doing these same operations using the java client and the returned data is correct for both map and list. In ruby only the last operation is returned.
The different Aerospike clients are unfortunately not consistent in this behaviour. The server actually returns the values for all operations, but the Ruby client currently only retains the last value when it aggregates all the values into the result Hash map.
I’m thinking of adopting the Java client behaviour of simply wrapping multiple values for the same bin name in an array. This would be a fairly easy change to make. There are some draw backs to this approach, esp. that it would be difficult to tell whether a returned array value is the result of a single operation or multiple operations that got combined. The alternative would be to use a true multimap implementation [1].
If you don’t mind, can you please open a feature request at our Github repo and I will consider this for the next release.
You will need to pass an OperatePolicy with record_bin_multiplicity set to the value RecordBinMultiplicity::ARRAY on your Client#operate call in order to receive all results for multiple read operations on the same record bin.