aerospike / aerospike-client-go

Aerospike Client Go
Apache License 2.0
430 stars 199 forks source link

Export BatchWrite, Expressions and Operation fields #427

Closed noam-ma-ma closed 2 months ago

noam-ma-ma commented 3 months ago

When using Batch write, the returned BatchWrite result fields are not sufficient for clients to understand what happen.

Given the Map Bin:

{
   "key1": [3, "val1"],
   "key2": [2, "val2"]
}

and 2 batch write operations with filter expressions pseudo code

  1. if mapbin["key1"][0] < 2 {
    mapbin["key1"][1] = "newVal1"
    mapbin["key1"][0] = 2
    }   
  2. if mapbin["key2"][0] < 3 {
    mapbin["key2"][1] = "newVal2"
    mapbin["key2"][0] = 3
    }

Given these operations - the result will be:

{
   "key1": [3, "val1"], 
   "key2": [3, "newVal2"]
}

The first batch write was filtered out, while the second executed.

Aerospike client returns: [](aerospike.BatchRecordIfc|*BatchWrite) with very minimal exported fields - mostly the Key and the Err.

In our example - we can notify: "primaryKey1: success, primaryKey1: filtered out", without any notion of what was filtered out.

Why does all the fields in the BatchWrite, Expressions, Operation struct are unexported? Clients want to know more details about what exactly failed using the data on the BatchWrite like policy and ops fields (and their nested structs).

khaf commented 2 months ago

Thanks for your feedback. That's inadvertent and an oversight. All those fields will be exported in the next release next week.

khaf commented 2 months ago

Fixed in v7.3.0 release. Sorry for the long lead time, this change ended up tangled with another significant release.