Aerospike Go client version 2.0.0 was released on March 20, 2019.
This is the first major breaking release of the Aerospike Go Client in 5 years.
Most breaking changes are minor and specific, and will either not hit you, or will be fixable with relative ease.
The only major change is that the behavior of the client when a key does not exist has changed.
It used to return no errors, but a nil Record.Bins. Now it returns ErrKeyNotFound error.
This is a significant change, and you should search your code for all instances of .Bins == nil (or equivalent) and adapt the code accordingly.
Breaking Changes
-
Get/Put/Touch/OperateandExecuteUDFcommands will return anErrKeyNotFounderror when the key does not exist in the database. The old behavior used to be not to return an error, but have an emptyRecord.Bins. - Renames
Statement.AddfiltertoStatement.SetFilter, changes the name and type ofStatement.FilterstoStatement.Filter. - Remove
ClientPolicy.RequestProleReplicas. The client will always request them. - Removes
ScanPolicy.ServerSocketTimeoutandQueryPolicy.ServerSocketTimeoutin favor of the already existingPolicy.SocketTimeout. - Renames
Policy.TimeouttoPolicy.TotalTimeoutto make the naming consistent with other clients. - Moves
atomicpackage to internal. - Moves
ParticleTypepackage to internal. - Moves
RequestNodeInfoandRequestNodeStatsto methods on Node object, and addsInfoPolicyto the relevant API signatures. - Removes
WaitUntilMigrationIsFinishedfromScan/Querypolicies. - Changes
NewConnectionmethod signature - Makes
LoginCommandprivate. - Makes
OperationTypeprivate. - Remove long deprecated method for pool management.
- Removes unused
ReadNmethod inConnection. - Embeds Policies as values and not pointers inside
MultiPolicy,ScanPolicy,QueryPolicy
Improvements
- Optimizes connection creation out of the transaction pipeline and makes it async.
- Puts a threshold on the number of connections allowed to open simultaneously. Controlled via
ClientPolicy.OpeningConnectionThreshold. - Do not clear partition map entry when a node reports that it no longer owns that partition entry.
- Uses rolling timeout instead of strict timeout for connections. This means that every time a connection is read, the timeout is set to
policy.SocketTimeoutagain, unless it will take longer than the whole transactionTotalTimeout. - Remove
ToValueArrayandToValueSlicemethods to discourage such sub-optimal use. ChangesQueryAggregatesignature to remove the need for those methods. - Remove unnecessary conversion from
BinMaptoBins in reflection API to speed up the command and avoid unnecessary memory allocations. - Use shorter intervals with exponential back-off for tasks.
- Fixes a race condition in the
AdminCommand. - Synchronize the
XORShiftto avoid race conditions. - Completely removes deprecated LDT code.