Caution
This is a breaking release. It is required to allow upgrading your programs to the Aerospike Server v7. This program upgrade process required as a prerequisite to upgrading your cluster, otherwise seemless cluster upgrade will not be possible. The changes and their rationale are documented in the following section.
-
Breaking Changes
-
[CLIENT-2713] Handle Normalized Integers in Maps and Lists.
Before Go client v7.0.0,uint64
types could be stored in lists and maps. To support all versions of the server consistently, the Go client will now behave like other Aerospike smart clients, and automatically convert alluint64
values inside maps and lists into signedint64
values. This means amath.MaxUint64
value in a List or Map will return as two's compliment: -1.
Example:client.Put(wpolicy, key, BinMap{"map": map[any]any{"max": uint64(math.MaxUint64), "typed": uint64(0)}})
will return as:
rec, err := client.Get(rpolicy, key) // rec.Bins will be: // BinMap{"map": map[any]any{"max": int64(-1), "typed": int64(0)}}
This will break all code that used to cast
rec.Bins["map"].(map[any]any)["max].(uin64)
. As a result, all such code should cast to int64 and then convert back touint64
via a sign switch.
If you didn't useuint64
values in Maps and Lists, you should not be affected by this change.
All the test cases that depended on the old behavior have been adapted to the new behavior.-
[CLIENT-2719] Typed
GeoJSON
andHLL
deserialization.
The Go client would read GeoJSON and HLL values back asstring
and[]byte
respectively. So if you read a record with bins of these types and wrote it directly back to the database, the type of these fields would be lost.
The new version addresses this issue, but could be a breaking change if you have code that casts the values to the oldstring
and[]byte
. You now need to cast these values toGeoJSONValue
andHLLValue
types respectively. -
[CLIENT-2484] Add
returnType
to supportedExpMapRemoveBy*
andExpListRemoveBy*
methods. -
[CLIENT-2319] Revise BatchReadAPIs to accept BatchReadPolicy argument.
NewBatchReadOps
no longer takesbinNames
and changes ops parameter to variadic for consistency.Changes the following Public API:
func NewBatchRead(key *Key, binNames []string) *BatchRead { func NewBatchReadOps(key *Key, binNames []string, ops []*Operation) *BatchRead { func NewBatchReadHeader(key *Key) *BatchRead {
to
func NewBatchRead(policy *BatchReadPolicy, key *Key, binNames []string) *BatchRead { func NewBatchReadOps(policy *BatchReadPolicy, key *Key, ops ...*Operation) *BatchRead { func NewBatchReadHeader(policy *BatchReadPolicy, key *Key) *BatchRead {
-
Replace
WritePolicy
withInfoPolicy
inclient.Truncate
. -
Remove the deprecated
ClientPolicy.RackId
. UsePolicy.RackIds
instead.
-
-
New Features
- [CLIENT-2712] [CLIENT-2710] Support read replica policy in scan/query.
This includesPREFER_RACK
which allows scan/query to be directed at local rack nodes when possible. - [CLIENT-2434] Use 'sindex-exists' command in
DropIndexTask
. - [CLIENT-2573] Support
ExpRecordSize()
. - [CLIENT-2588] SINDEX Support for 'Blob' Type Elements.
- [CLIENT-2712] [CLIENT-2710] Support read replica policy in scan/query.
-
Improvements
- [CLIENT-2694] Use RawURLEncoding instead of RawStdEncoding in proxy authenticator.
- [CLIENT-2616] Update dependencies to the latest, require Go 1.21
- Remove HyperLogLog tests from the Github Actions suite
- Remove Go v1.18-v1.20 from the Github Actions Matrix
- Rename grpc proto definition files due to compiler limitations. Resolves #414
-
Fixes
- [CLIENT-2318] Fixes an issue where Expression in
BatchPolicy
takes precedence rather thanBatchDeletePolicy
inBatchDelete
.
- [CLIENT-2318] Fixes an issue where Expression in