I am seeing an Aerospike Java client read error when reading a record from Aerospike Enterprise server.
Aerospike Java client: 4.0.4 (I agree this is an old version. I will upgrade to later version, but I still want to understand this error, since there is a topic on how the clients are backward compatible - Java client and server compatibility matrix).
Aerospike server: Enterprise Edition 5.7
The record I write into the server has the key - "tl:null:t034001118454:4d7dcd9166211b445fc6890aad2b28192d7b42f8"
.
I verified that the record is added to the server (it is a fresh installation, so there is only one record).
aql> set output json
OUTPUT = JSON
aql> set record_print_metadata true
RECORD_PRINT_METADATA = true
aql> select * from tl;
[
[
{
"edigest": "TX3NkWYhG0RfxokKrSsoGS17Qvg=",
"ttl": 172395,
"gen": 5,
"bins": {
"": "78 9C 63 64 60 60 60 34 36 D1 33 30 D8 A8 6B 68 68 A1 67 62 BA A5 29 1D 2C 66 64 50 61 BA 01 C4 32 00 01 C3 78 30 B5 11 85 C3 C0 C0 74 18 A2 0E 00 F5 C5 0F 91"
}
}
],
[
{
"Status": 0
}
]
]
When I read the record with the Java client (same application, 4.0.4 version client), I get the following error:
2022-02-14 18:10:56.006 ERROR com.cache.AerospikeService Error Code -2: Unexpected batch key returned: null,,0
com.aerospike.client.AerospikeException$Parse: Error Code -2: Unexpected batch key returned: null,,0
at com.aerospike.client.command.Batch$GetArrayCommand.parseRow(Batch.java:109)
at com.aerospike.client.command.MultiCommand.parseGroup(MultiCommand.java:107)
at com.aerospike.client.command.MultiCommand.parseResult(MultiCommand.java:64)
at com.aerospike.client.command.SyncCommand.execute(SyncCommand.java:83)
at com.aerospike.client.command.BatchExecutor.execute(BatchExecutor.java:51)
at com.aerospike.client.AerospikeClient.get(AerospikeClient.java:1023)
at com.cache.AerospikeService.find(AerospikeService.java:179)
What is the reason for this error? I verified the same key is used for the read and write operation.