Batch_get_header returns incorrect metadata for all records

Hi,

I’ve noticed that on querying using the ruby client, the record’s metadata is correctly retrieved when using the method for single record i.e. get(). However, batch_get() returns records with incorrect metadata. Exactly, the user_key in key obj is nil and expiration is always zero in the returned records. Is this a bug or am I doing things differently?

client = Client.new(Host.new('127.0.0.1', 3000))
key = Key.new("users", "data", "test")
bin = Bin.new("binName", "value")
client.put(key, bin)

record = client.get(key)
records = client.batch_get([key])

Expecting records[0] to be the same as record. But, other than bins and generation, the metadata seem different.

record.expiration is hugely different from records[0].expiration. Most of the times records[0].expiration is zero and other times there is a huge difference from the correct expiration. Also, record.key.user_key gives the correct user_key but records[0].key.user_key gives nil. Please, help me out here. Am I doing it wrongly? Is it a bug?

Seems like a bug. Please open a new issue in the aerospike/aerospike-client-ruby repo in GitHub. Add the OS and client version, please.

Yes, it’s indeed a bug. For the batch command the expiry time sent by the server is not interpreted correctly by the client. I’ll have a fix ready for the next release of the client.

@zingoba, would be great if you could file that ticket on Github so that I can credit you in the release notes.

Cheers, Jan

@zingoba, please give v2.1.1 a try which I have just released to Ruby Gems.

1 Like

@Jan Thank you very much for the quick response and the fix. I’ve tested at my end and everything seems to be working as desired. Cheers.