Aerospike Client Go

Overview

Aerospike Go Client

Aerospike Client Go Build Status Godoc

An Aerospike library for Go.

This library is compatible with Go 1.9+ and supports the following operating systems: Linux, Mac OS X (Windows builds are possible, but untested).

Up-to-date documentation is available in the Godoc.

You can refer to the test files for idiomatic use cases.

Please refer to CHANGELOG.md for release notes, or if you encounter breaking changes.

Notice:

We have released the Go Client v2, with some breaking API changes. Most changes are minor, and can be fixed with relative ease.

The only major issue is that the behavior of the client when a key does not exist has changed.

It used to return no error, but a nil Record.Bins. Now it returns ErrKeyNotFound error.

This is a significant changes, and you should search your code for all instances of Bins == nil and adapt the code accordingly.

Please refer to the CHANGELOG.md for details.

Usage:

The following is a very simple example of CRUD operations in an Aerospike database.

package main

import (
  "fmt"

  aero "github.com/aerospike/aerospike-client-go"
)

// This is only for this example.
// Please handle errors properly.
func panicOnError(err error) {
  if err != nil {
    panic(err)
  }
}

func main() {
  // define a client to connect to
  client, err := aero.NewClient("127.0.0.1", 3000)
  panicOnError(err)

  key, err := aero.NewKey("test", "aerospike", "key")
  panicOnError(err)

  // define some bins with data
  bins := aero.BinMap{
    "bin1": 42,
    "bin2": "An elephant is a mouse with an operating system",
    "bin3": []interface{}{"Go", 2009},
  }

  // write the bins
  err = client.Put(nil, key, bins)
  panicOnError(err)

  // read it back!
  rec, err := client.Get(nil, key)
  panicOnError(err)

  // delete the key, and check if key exists
  existed, err := client.Delete(nil, key)
  panicOnError(err)
  fmt.Printf("Record existed before delete? %v\n", existed)
}

More examples illustrating the use of the API are located in the examples directory.

Details about the API are available in the docs directory.

Prerequisites

Go version v1.12+ is required.

To install the latest stable version of Go, visit http://golang.org/dl/

Aerospike Go client implements the wire protocol, and does not depend on the C client. It is goroutine friendly, and works asynchronously.

Supported operating systems:

  • Major Linux distributions (Ubuntu, Debian, Red Hat)
  • Mac OS X
  • Windows (untested)

Installation:

  1. Install Go 1.9+ and setup your environment as Documented here.
  2. Get the client in your GOPATH : go get github.com/aerospike/aerospike-client-go
  • To update the client library: go get -u github.com/aerospike/aerospike-client-go

Using gopkg.in is also supported: go get -u gopkg.in/aerospike/aerospike-client-go.v1

Some Hints:

  • To run a go program directly: go run <filename.go>
  • to build: go build -o <output> <filename.go>
  • example: go build -o benchmark tools/benchmark/benchmark.go

Performance Tweaking

We are bending all efforts to improve the client's performance. In our reference benchmarks, Go client performs almost as good as the C client.

To read about performance variables, please refer to docs/performance.md

Tests

This library is packaged with a number of tests. Tests require Ginkgo and Gomega library.

Before running the tests, you need to update the dependencies:

$ go get .

To run all the test cases with race detection:

$ ginkgo -r -race

Examples

A variety of example applications are provided in the examples directory.

Tools

A variety of clones of original tools are provided in the tools directory. They show how to use more advanced features of the library to re-implement the same functionality in a more concise way.

Benchmarks

Benchmark utility is provided in the tools/benchmark directory. See the tools/benchmark/README.md for details.

API Documentation

A simple API documentation is available in the docs directory. The latest up-to-date docs can be found in Godoc.

Google App Engine

To build the library for App Engine, build it with the build tag app_engine. Aggregation functionality is not available in this build.

Reflection, and Object API

To make the library both flexible and fast, we had to integrate the reflection API (methods with [Get/Put/...]Object names) tightly in the library. In case you wanted to avoid mixing those API in your app inadvertently, you can use the build tag as_performance to remove those APIs from the build.

License

The Aerospike Go Client is made available under the terms of the Apache License, Version 2, as stated in the file LICENSE.

Individual files may be made available under their own specific license, all compatible with Apache License, Version 2. Please see individual files for details.

Issues
  • DNS lookup issue when used with Kubernetes

    DNS lookup issue when used with Kubernetes

    In Kubernetes service and pods IPs are dynamic and move around when deploying new services/pods. This causes an issue when using the aerospike client.

    In node_validation.go the host name is resolved to the IP address (using net.LookupHost). However when used in Kubernetes where the service IP changes with new deployments this results in an unusable aerospike connection since the retries are all pointing to the old IP.

    Initial start:-

    2016/10/02 00:46:51 Seeding the cluster. Seeds count: 1 2016/10/02 00:46:51 Node Validator has 1 nodes. 2016/10/02 00:46:51 Node BB90459140A4202 partition generation -1 changed to 1 2016/10/02 00:46:51 Tend finished. Live node count: 1 2016/10/02 00:46:51 New cluster initialized and ready to be used...

    After deleting the aerospike service and deploying a new one, the old IP address is still being used to make the connection:- 2016/10/02 00:47:23 Node BB90459140A4202 10.32.0.132:3000 refresh failed: EOF 2016/10/02 00:47:53 Connection to address 10.32.0.132:3000 failed to establish with error: dial tcp 10.32.0.132:3000: i/o timeout 2016/10/02 00:47:53 Node BB90459140A4202 10.32.0.132:3000: dial tcp 10.32.0.132:3000: i/o timeout 2016/10/02 00:47:53 Connection to address 10.32.0.132:3000 failed to establish with error: dial tcp 10.32.0.132:3000: i/o timeout 2016/10/02 00:47:53 Connection to address 10.32.0.132:3000 failed to establish with error: dial tcp 10.32.0.132:3000: i/o timeout 2016/10/02 00:47:53 Connection to address 10.32.0.132:3000 failed to establish with error: dial tcp 10.32.0.132:3000: i/o timeout 2016/10/02 00:47:53 Node BB90459140A4202 10.32.0.132:3000: dial tcp 10.32.0.132:3000: i/o timeout 2016/10/02 00:47:53 Connection to address 10.32.0.132:3000 failed to establish with error: dial tcp 10.32.0.132:3000: i/o timeout

    opened by deepakprabhakara 41
  • Any ideas to warmup connections?

    Any ideas to warmup connections?

    When starting a service we got many errors like:

    last error: No available connections to the node. Connection Pool was empty, and limited to certain number of connections.
    

    We have like 40k qps per instance into Aerospike, so connections are not warmed up at the start. It takes a lot of time to initiate the new ones. Increasing queue length helps a bit.

    So it will be good to warm up conn. queue at the start by setting some options.

    opened by un000 35
  • Growing active connections

    Growing active connections

    Hello! I have a problem. I have a cluster aerospike servers, it consists of 5 nodes. My problem is that the number of active connections is growing and my go service is fall upon reaching a certain number of active connections.

    Driver version -- github.com/aerospike/aerospike-client-go v4.5.2+incompatible Version aerospike server - 5.5.0.3

    Please tell me what could be the problem.

    opened by dAvagimyan 34
  • cannot use (type string) as type aerospike.Value in argument to lmap.Put

    cannot use (type string) as type aerospike.Value in argument to lmap.Put

    It seems the lmap.Put wont accept my key and value as it is expecting aerospike.Value as type but when i try asserting the type into aerospike.Value, it wont accept it as well. lmap.PutMap works fine

    opened by supafoundation 29
  • Aerospike-go-cilent: High latency and Connections stuck in CLOSE_WAIT

    Aerospike-go-cilent: High latency and Connections stuck in CLOSE_WAIT

    I am trying to run a server written in Golang which internally calls aerospike client (latest version).

    Initially after server start latencies measured from the client side of aerospike were under control but after some time latencies are getting high and not coming down.

    Based on my observation during high latencies, many connections from aerospike client to aerospike server are in close_wait state

    I am using default parameters for client policy i.e, ConnectionQueueSize = 256 and LimitConnectionsToQueueSize = true

    My guess is since many connections are in close_wait state and we are limiting connections it is waiting for connection to close and create a new one and because of that latencies are high

    If that is correct, How can we close the connections faster that are in the close_wait state? Otherwise, What can be the reason for this?

    P.S,

    1. We measured latency on aerospike server (v3.12.1.2) and it was under 1ms (using asloglatency,which is as expected)
    2. No Network congestion from aerospike server side as well as aerospike client side.
    opened by onlynishant 28
  • Put() results in a Invalid node exception after CP update

    Put() results in a Invalid node exception after CP update

    Hi @khaf,

    After https://github.com/aerospike/aerospike-client-go/commit/c4fa10e1a2c8f4d19f57d54c28b9c5fe0dac2fe6 , calling Put() with a client that is directly connected to a single node results in a Invalid node exception. This was working prior to this commit. Get() still works as expected and CP mode is not enabled. Is this expected behavior? Would it be possible to reenable the old behavior? The old behavior is extremely convenient when talking to a cluster in a separate network.

    Thanks, Chiam

    opened by tchiam 23
  • v1.32.0 results in lots of i/o timeouts

    v1.32.0 results in lots of i/o timeouts

    I updated from v1.31.0 to v1.32.0 and notice a lot of "read tcp 10.20.105.2:47888->10.20.73.2:3000: i/o timeout" errors. Are there any configuration changes needed to migrate from v1.31.0 to v1.32.0?

    opened by deepakprabhakara 21
  • ExecuteUDF OnComplete() returns EOF

    ExecuteUDF OnComplete() returns EOF

    I run a batch job like this:

        res, err := c.ExecuteUDF(
            nil,
            as.NewStatement("my_ns", ""),
            "my_module",
            "my_function",
            as.NewValue(my_first_value),
            as.NewValue(my_second_value),
        )
        if err != nil {
            return err
        }
        return <-res.OnComplete()
    

    This works, the job runs successfully according to AMC, but it returns an EOF error. The job takes about 12 minutes to finish. In a previous version of the Go client the error wasn't there. This is with the latest Go client, and server 3.10.0.3. Any ideas?

    opened by alicebob 21
  • Using Client.GetObject fails with

    Using Client.GetObject fails with "interface conversion: interface {} is bool, not int"

    I'm trying to use GetObject to marshal the bin data into a struct containing a handful of bool values. The error comes from the lines below in read_command_reflect.go, where value is apparently already a bool, so trying to convert it to an int fails.

    case reflect.Bool:
    	f.SetBool(value.(int) == 1)
    

    I assume this could also happen with the other more complicated case reflect.Bool in the switch under the reflect.Ptr case further down.

    When I replace the first bool case with the following, everything seems to work:

    case reflect.Bool:
    	switch v := value.(type) {
    	case int:
    		f.SetBool(int(v) == 1)
    	default:
    		f.SetBool(bool(value.(bool)))
    	}
    

    I'm not sure if this is an optimal solution, but I'm happy to put up a PR if it seems okay.

    opened by EmmaSimon 17
  • Need 'omitempty' functionality with 'as' struct tag.

    Need 'omitempty' functionality with 'as' struct tag.

    The issue I am facing is :

    type Category struct {
    	Code string `as:"code"`
    	Description string `as:"description"`
    }
    

    I write a record and populate category Code and Description :

    cat := Category{Code:"NB", Description:"NB is the best"}
    policy := as.NewWritePolicy(0,0)
    err = client.PutObject(policy, someKey, cat)
    

    Now, if I just wish to update Description field of the struct, I donot enter Code value and update the document ( call PutObject with WritePolicy having RecordExistsAction = as.UPDATE)

    But, obviously, my code gets rewritten to empty string. Something like omitempty (like in json struct tag) will fix this.

    Is there a better solution at the moment ?

    enhancement 
    opened by kartavya-ramnani 17
  • Memory leak

    Memory leak

    After updating aerospike-client-go telegraf started leaking memory in aerospike plugin (influxdata/telegraf#4195). The cause is probably related to changes done in between 1.25.0 and 1.32.0.

    opened by deric 17
  • Use Bytes() instead of Interface().([]byte) for reflect.Slice marshalling

    Use Bytes() instead of Interface().([]byte) for reflect.Slice marshalling

    When trying to marshal field with custom type that has bytearray underneath (like datatypes.JSON from GORM) I get this: interface conversion: interface {} is datatypes.JSON, not []uint8

    In our mocks I replaced the following line: [/marshal.go](https://github.com/aerospike/aerospike-client-go/blob/b936c147db0d7ac5f881c3bde9df87e9a6829dfa/marshal.go#L113)

    with: return f.Bytes()

    And everything seems to work well.

    Is this possible to do the same in aerospike-client? Return bytes without type assertion seems quiet safe because (reflect.Value).Bytes says: Bytes returns v's underlying value. It panics if v's underlying value is not a slice of bytes.

    opened by slobodyanyuk 0
  • : in partition table" error when using a closed client">

    "Node not found for partition : in partition table" error when using a closed client

    If by mistake a client is closed "too early", and still used afterward, a "Node not found for partition :<some_number> in partition table" error is returned. To save troubleshooting time, in such a case, a specific error should be returned (ex. "Closed client usage attempt", or something similar) instead of a cryptic and misleading error, as described above!

    opened by marius-nicolae 0
  • About ClientPolicy.MinConnectionsPerNode vs server's proto-fd-idle-ms

    About ClientPolicy.MinConnectionsPerNode vs server's proto-fd-idle-ms

    Client

    • Go 1.15.3
    • Aerospike: v4.5.0

    Issue

    Here is the drop-idle-connections logic.

    https://github.com/aerospike/aerospike-client-go/blob/b936c147db0d7ac5f881c3bde9df87e9a6829dfa/connection_heap.go#L237

    For example, if we set ClientPolicy.MinConnectionPerNode to 5, these 5 idle connections may have no chance to check if it is idle or already timeout. Of course, This case is under not busy Aerospike access scenario.

    For these idle conns, if it already exceeds server's proto-fd-idle-ms, Aerospike server may proactively close the conn and client conn hasn't realized that. Then the client will get such error

    Node BB9353C99FXXX 10.y.y.y:3000: write tcp 10.x.x.x:46554->10.y.y.y:3000: write: broken pipe
    

    Question

    Is it possible to fully iterate the conns pool and clean up the idle ones?

    opened by xqzhang2015 11
  • BatchGet  MAX_RETRIES_EXCEEDED error code

    BatchGet MAX_RETRIES_EXCEEDED error code

    Hi, I have a cluster with 3 nodes and replica factor 2. Client version is 5.8.0 When I get a single bin - everything is successful, but getting butch always return MAX_RETRIES_EXCEEDED error code.

    // success
    client.Get(nil, key, valueBinName)
    
    // MAX_RETRIES_EXCEEDED
    client.BatchGet(nil, []*as.Key{key}, valueBinName)
    

    Maybe I'm doing something wrong:) pls help

    opened by Pickausernaame 1
  • Update Changelogs to clearly

    Update Changelogs to clearly

    For version v3.0.0 release on June 8 2020,

    ClientPolicy.LinearizeRead == true
    

    is no longer available. My understanding is the option has been removed and can be replaced with

    policy.ReadModeSC = as.ReadModeSCLinearize
    

    Can this be made more clear in the change logs.

    opened by bubunyo 1
Releases(v6.2.1)
  • v6.2.1(Jul 27, 2022)

    This is mostly a re-release of v6.2.0, with one added minor change. It seems that we bungled the Github tag somehow for that release. Upgrade from v6.2.0 to this version for the changes in that version to be applied to your code.

    • Fixes
      • Add a nil check for error in batch retry to be on the safe side.
    Source code(tar.gz)
    Source code(zip)
  • v6.2.0(Jun 30, 2022)

    NOTE: It seems that the tag reference for this release was incorrect on Github, or we somehow confused the Go mod. Do not use this version. Use v6.2.1 instead.

    This is a major fix release. We recommend upgrading to this release if you are using BatchOperate or Scan/Queries.

    • Fixes

      • [CLIENT-1783] Client crashes when tracker is nil during Scan/Queries.
      • [CLIENT-1782] BatchOperate doesn't return error BATCH_MAX_REQUESTS_EXCEEDED.
      • [CLIENT-1781] Fix BatchOperate: use offset index to pick correct record.
    Source code(tar.gz)
    Source code(zip)
  • v5.9.0(Jun 30, 2022)

    This is a major fix release. We recommend upgrading to this release if you are using Scan/Queries.

    • Fixes
      • [CLIENT-1783] Fix client crashes when tracker is nil during Scan/Queries. PR #379, thanks to adumovic
      • Fix client.Get when policy.FilterExpression and bin names are both provided.
    Source code(tar.gz)
    Source code(zip)
  • v6.1.0(Jun 23, 2022)

    NOTE: This release contains a bug in BatchOperate command. If you are using that command, we strongly recommend you upgrade to v6.2.1.

    • New Features

      • [CLIENT-1747] Add EXISTS return type for CDT read operations.
    • Fixes

      • [CLIENT-1754] Go SDK doesn't support MapIncrementOp for batch write.
      • [CLIENT-1770] Assume background query is complete when the server 6.0+ returns 'not found' in 'query-show' info command. For the old servers, the client will check if it has already observed the job before. If it has, it will also assume the job has finished.
    Source code(tar.gz)
    Source code(zip)
  • v6.0.0(Apr 7, 2022)

    NOTE: This release contains a bug in BatchOperate command. If you are using that command, we strongly recommend you upgrade to v6.2.1.

    This is a major feature release. It adds several new features supported by the server v6, and drops supports for Predicate Expressions.

    • New Features

      • [CLIENT-1699] Support New v6 Queries.
      • [CLIENT-1700] Support New Server v6 Roles and Privileges.
      • [CLIENT-1701] Support New Server v6 Batch Write.
      • [CLIENT-1702] Remove policy.PredExp feature from the client.
    Source code(tar.gz)
    Source code(zip)
  • v5.8.0(Apr 7, 2022)

    This is a major fix release. We recommend upgrading to this release if you are using authentication.

    • Improvements

      • Adds notices regarding Auth issue to CHANGELOG and clarifies how to change code for an old breaking change in v3.
      • Forward compatibility with Server v6 regarding queries and scans not sending a fresh message header per partition.
    • Fixes

      • [CLIENT-1695] Fixes a potential nil deference in sessionInfo.isValid() method.
      • Fixes an issue where with default policies and after certain errors the replica node was not selected on retry.
    Source code(tar.gz)
    Source code(zip)
  • v5.7.0(Dec 6, 2021)

    • Improvements

      • [CLIENT-1635] Allow Preventing Retries on Exhausted Connection Pools.
      • Improve Policy.deadline() logic to use MaxRetries and SocketTimeout to calculate TotalTimeout when it is not set.
      • Do not test PredExp for server v5.8+.
      • Explicitly remove departed nodes from the partition map on cluster change.
    Source code(tar.gz)
    Source code(zip)
  • v5.6.0(Sep 17, 2021)

    • Fixes
      • [CLIENT-1605] An authentication bug was introduced in Go client 5.0.0. As a result, the client may fail to refresh its session token after it expires, requiring the client to be restarted. New connections would then be rejected until the client is restarted. This fix invalidates the Session Token on unsuccessful login, copies token from the connection buffer, and will consider tend interval in session expiration calculations.
    Source code(tar.gz)
    Source code(zip)
  • v5.5.0(Sep 6, 2021)

    [IMPORTANT NOTE] An authentication bug was introduced in Go client 5.0.0. As a result, the client may fail to refresh its session token after it expires, requiring the client to be restarted. If you are using password-based authentication, we highly recommend that you upgrade your client to version 5.6.0+, which you can do safely.

    • New Features

      • [CLIENT-1586] Support Batch Read Operations.
    • Improvements

      • Add authentication to info example.
    • Fixes

      • Fix the wrong UDF name in predexp test.
    Source code(tar.gz)
    Source code(zip)
  • v5.4.0(Aug 16, 2021)

    [IMPORTANT NOTE] An authentication bug was introduced in Go client 5.0.0. As a result, the client may fail to refresh its session token after it expires, requiring the client to be restarted. If you are using password-based authentication, we highly recommend that you upgrade your client to version 5.6.0+, which you can do safely.

    • New Features

      • [CLIENT-1576] Support a list of preferred racks rather than a single rack when replica is PREFER_RACK.
      • [CLIENT-1577] Support PKI authentication where the TLS certificate's common name (CN) specifies the Aerospike user name.
      • [CLIENT-1578] Support scan-show and query-show info commands.
    • Improvements

      • Run fewer iterations for CDT RSHIFTEX and LSHIFTEX.
      • Add PKI authentication to the benchmark utility.
    Source code(tar.gz)
    Source code(zip)
  • v5.3.0(Aug 2, 2021)

    [IMPORTANT NOTE] An authentication bug was introduced in Go client 5.0.0. As a result, the client may fail to refresh its session token after it expires, requiring the client to be restarted. If you are using password-based authentication, we highly recommend that you upgrade your client to version 5.6.0+, which you can do safely.

    • Improvements

      • Improve seeding of cluster nodes in tend. All seeds are discovered and added on the first step.
      • Add -hosts flag to test command arguments.
    • Fixes

      • Fix where Bin names were not sent to the server in GetXXX commands and consequently all bins were retrieved.
    Source code(tar.gz)
    Source code(zip)
  • v5.2.0(Jun 28, 2021)

    [IMPORTANT NOTE] An authentication bug was introduced in Go client 5.0.0. As a result, the client may fail to refresh its session token after it expires, requiring the client to be restarted. If you are using password-based authentication, we highly recommend that you upgrade your client to version 5.6.0+, which you can do safely.

    Major fix release. We recommend updating to this version immediately.

    • New Features

      • Add support for boolean bins in expressions (ExpBoolBin).
      • Add Node.PeersGeneration, Node.PartitionGeneration, Node.RebalanceGeneration.
      • Support TLS connections in benchmark tool. Resolves #313.
      • Expose Partition Health API to the user (Cluster.Healthy()). Resolves #334.
    • Improvements

      • Do not keep connection on all client-side errors.
      • Refactor batch commands to better reflect that keys are not created on batch requests.
      • Mention List/Map WriteFlags in List/Map Policy constructors.
      • Fix ClientPolicy.ErrorRateWindow documentation.
      • Fix benchmark document. Thanks to Koji Miyata
      • Fix unidiomatic variable naming. Thanks to Yevgeny Rizhkov
    • Fixes

      • Fix an issue where batch commands for a single node were not retried. Resolves #355.
    Source code(tar.gz)
    Source code(zip)
  • v5.1.0(Jun 10, 2021)

    [IMPORTANT NOTE] An authentication bug was introduced in Go client 5.0.0. As a result, the client may fail to refresh its session token after it expires, requiring the client to be restarted. If you are using password-based authentication, we highly recommend that you upgrade your client to version 5.6.0+, which you can do safely.

    • Improvements

      • Set the error node on transaction failures.
      • Add compression and minConnsPerNode to benchmark tool options.
    • Fixes

      • Add missing Compress commands.
      • Check if error is not nil before chaining. Resolves issue #353.
      • Handle nil case in Node.String().
      • Correctly handle errors in Connection.Read and Connection.Write. Avoids shadowing of the error. Resolves issue #352.
    Source code(tar.gz)
    Source code(zip)
  • v5.0.2(May 30, 2021)

    [IMPORTANT NOTE] An authentication bug was introduced in Go client 5.0.0. As a result, the client may fail to refresh its session token after it expires, requiring the client to be restarted. If you are using password-based authentication, we highly recommend that you upgrade your client to version 5.6.0+, which you can do safely.

    • Fixes

      • Improve handling and chaining of errors in BatchCommand retries.
      • Don't wrap in chainErrors if outer is nil and the inner error is of type Error.
      • Support reading back keys with original List values.
    Source code(tar.gz)
    Source code(zip)
  • v4.5.2(May 28, 2021)

  • v5.0.1(May 27, 2021)

    [IMPORTANT NOTE] An authentication bug was introduced in Go client 5.0.0. As a result, the client may fail to refresh its session token after it expires, requiring the client to be restarted. If you are using password-based authentication, we highly recommend that you upgrade your client to version 5.6.0+, which you can do safely.

    • Fixes

      • Handle lack of key digests in BatchExists command.
      • Allow and handle nil arguments for chainError.
      • Avoid race condition in chaining prefined errors.
    Source code(tar.gz)
    Source code(zip)
  • v4.5.1(May 27, 2021)

  • v5.0.0(May 11, 2021)

    [IMPORTANT NOTE] An authentication bug was introduced in Go client 5.0.0. As a result, the client may fail to refresh its session token after it expires, requiring the client to be restarted. If you are using password-based authentication, we highly recommend that you upgrade your client to version 5.6.0+, which you can do safely.

    This is a major feature release. It is also a major breaking release. We have adopted Go's module system as recommended by the Go authors, so the new release moves the active branch to v5. As such, the import path changes to github.com/aerospike/aerospike-client-go/v5. The master branch remains in place to allow maintenance for the older v4 classic version until most users get the chance to upgrade.

    This release also changes the way errors work in the client, and invalidates the old way. This allows the client to support Go's somewhat new errors.Is and errors.As API, and properly chain errors together.

    Also note that the Go Client now requires server version 4.9+ and will not work properly with older versions.

    • New Features

      • Adopts module system and changes the import paths to github.com/aerospike/aerospike-client-go/v5
      • [CLIENT-1476] Support new expressions introduced in server version 5.6, including ExpReadOp and ExpWriteOp.
      • [CLIENT-1463] Support boolean particle type and make it opt-in for reflection API via UseNativeBoolTypeInReflection.
      • [CLIENT-1522] Support user quotas and statistics.
      • [CLIENT-1492] Remove ability to use old authentication protocol. This works behind the scenes and doesn't have any impact on user code.
      • [CLIENT-1081] Adds Error interface, changes all API signature to return Error.
      • Exports AdminCommand and its QueryXXX API.
    • Breaking Changes

      • Limits keys to int, string and []byte types. The old ListValue arrays as types are not supported anymore.
      • Remove TLS code support for golang v1.8 and before.
      • Moves AerospikeError from /types to the root of the package, and removes all other error type like NodeError
      • [CLIENT-1526] Removes Policy.Priority, ScanPolicy.ScanPercent and ScanPolicy.FailOnClusterChange
      • Removes Recordset.Read() and avoids multiplexing of Records channel in Recordset.Results(), and unexports the Error channel.
      • Remove legacy client code for old servers. Go client now requires server version 4.9+
      • Remove Statement.PredExp, and only use the Policy.PredExp to avoid confusion. PredExp has been deprecated and replaced by Expression.
      • Renames type FilterExpression to Expression.
      • Client.GetBatchXXX() will return ErrFilteredOut if an expression is passed to the API and some records were filtered out, regardless of BatchPolicy.AllowPartialResults.
      • Client.CreateRole() now requires quota information in the param list.
      • Removed Connection.Authenticate() API.
      • Renamed GetOpForBin() to GetBinOp()
      • Removed ScanPolicy.ConcurrentNodes. Now only uses .MaxConcurrentNodes to avoid confusion.
      • Moves the RequestInfo() under Connection.
    • Improvements

      • Implement GomegaStringer interface to prevent very long error messages in tests.
      • Adds ResultCode.String().
    Source code(tar.gz)
    Source code(zip)
  • v4.5.0(Apr 12, 2021)

    • New Features

      • Allows reading of boolean types from the server, supported in Aerospike server v5.6. The current client will not support writing boolean type to the server. That features will be supported in the upcoming Go client v5.
    • Improvements

      • [CLIENT-1495] Tentatively check if a connection is allowed to avoid launching too many goroutines.
    • Fixes

      • Implements correct and re-triable Scans for the Reflection API.
      • Fixes an obscure var shadowing bug in TLS connection handshake error logging.
    Source code(tar.gz)
    Source code(zip)
  • v4.4.0(Mar 12, 2021)

    • Fixes

      • Fixes an issue where the client's reflection API expected certain int value types returned from the database. That assumption was wrong for CDTs and free form Lists and Maps. The client will now convert types to each other per Go's conversion rules where possible.
    • Improvements

      • Use a global TLS setting everywhere in tests.
    Source code(tar.gz)
    Source code(zip)
  • v4.3.0(Mar 1, 2021)

    While there aren't many user facing changes, the quality of the code has been markedly improved. This release puts us on a good footing for the next few big releases.

    • New Features:

      • [CLIENT-1457] Support scan pagination through ScanPartitions() with PartitionFilter
    • Fixes

      • Fixes an issue where if errors and filtered records happened at the same time in Batch requests, no error would be returned to the user.
    • Improvements

      • Makes the code samples more readable in the docs.
      • Fixes a lot of code samples in documentation, along with typos, etc.
      • Fixes copy/paste naming errors in the documentation. Thanks to Yevgeny Rizhkov
      • Removes a few unreachable lines from the code. Thanks to Yevgeny Rizhkov
      • Handles a few TLS connection related issues in tests.
    Source code(tar.gz)
    Source code(zip)
  • v4.2.0(Feb 12, 2021)

    • New Features:

      • [CLIENT-1192] Adds Support for partition scans. Queries which lack a Statement.Filter will be automatically converted to partition scans. If the cluster supports partition scans, all Scans and Queries will use the new protocol to allow retrying in case of some errors.
      • [CLIENT-1237] Adds Support for MultiPolicy.MaxRecords in scans and queries without Statement.Filter.
      • Adds NewHosts convenience function. (Github #320) thanks to Yegor Myskin
    • Improvements

      • Adds a few missing error checks.
      • Moves examples files to dedicated folders to avoid multiple main function errors for new users.
      • Some documentation clean up. (Github #314) thanks to Shin Uozumi
      • Fix typo in example NewKey(). (Github #331) thanks to Patrick Kuca
      • Adds an example to list operations (using operate and list policy).
      • Runs the XDR tests only when XDR is configured on the server.
      • Add TLS config to test params.
      • Mark NewPredExpXXX return value as the PredExp interface instead of concrete type. It will now group them under the PredExp interface in the docs.
    • Changes

      • Only use Policy.Priority and MultiPolicy.FailOnClusterChange on server versions < 4.9. Priority is now deprecated and replaced with MultiPolicy.RecordPerSecond.
      • Statement.TaskID is deprecated and will be removed in the next major version.
      • ScanPolicy.ConcurrentNodes is deprecated and will be removed in the next major version.
    Source code(tar.gz)
    Source code(zip)
  • v4.1.0(Jan 26, 2021)

    • New Features:

      • [CLIENT-1417] Adds Circuit-Breaker. Rejects command when assigned node's error rate exceeds ClientPolicy.MaxErrorRate over ClientPolicy.ErrorRateWindow.
      • [CLIENT-1410] Adds Client.SetXDRFilter().
      • [CLIENT-1433] Adds ExpMemorySize() to expression filters.
    • Improvements

      • [CLIENT-1434] Reset peers, partition and rebalance generations on node tend errors.
      • Use named fields in LimitedReader initialization.
      • Skip device_total_bytes tests in Expressions for memory-only namespaces
      • Change unexported field check in marshaller in anticipation of go 1.16 changes
    • Changes

      • Pack byte array header with string header codes when using msgpack to be consistent with server.
      • Adds ResultCode.LOST_CONFLICT
      • Change log level from Debug to Error for partition validation failures
    • Fixes

      • Fix remainder calculation in ConnectionHeap.
    Source code(tar.gz)
    Source code(zip)
  • v4.0.0(Nov 27, 2020)

    This release deprecates PredExp filters and replaces them with the far more capable Expressions.

    • New Features:

      • [CLIENT-1361] Replace predicate filters with new Aerospike Expressions.
    • Fixes

      • Allows unmarshalling of bool fields to sub objects in reflection API. (Github #325)
      • Fixes an issue where BatchIndexGet commands were not retried in some circumstances.
    • Incompatible changes:

      • Changes the BitResizeFlagsXXX enum types to BitResizeFlags type. This should not affect any code if the enums were used.
      • Changes the ListSortFlagsXXX enum types toListSortFlags are now typed. This should not affect any code if the enums were used.
    Source code(tar.gz)
    Source code(zip)
  • v3.1.1(Nov 9, 2020)

    We recommend upgrading to this version, or cherry-picking the changeset to your vendored version if possible.

    • Fixes

      • Handle cleanup cases in Offer and DropIdleTail for singleConnectionHeap. (Github #318)
      • Unlock the mutex in singleConnectionHeap.Poll if called after cleanup. (Github #323) thanks to linchuan4028
    • Changes

      • Removes support for versions prior to Go v1.12 due to incompatibility in the testing library we use. Go v1.9+ should still work, though they will not be tested in our tests.
    Source code(tar.gz)
    Source code(zip)
  • v3.1.0(Sep 10, 2020)

  • v3.0.5(Aug 19, 2020)

    • Fixes

      • Corrects the maximum bin name size in error message.
      • Fixes geo coordinates in predexp tests due to more strict server validation.
      • Fixes misspelled words and doc links. PR #311, thanks to Abhay
    Source code(tar.gz)
    Source code(zip)
  • v3.0.4(Jul 7, 2020)

  • v3.0.3(Jul 3, 2020)

  • v3.0.2(Jun 29, 2020)

    • Fixes

      • Fixes an issue where if a slice was pre-assigned on a struct, the data would not be allocated to it in reflection API. PR #302, thanks to gdm85
      • Fixes an issue where Node.GetConnection() could in some circumstances return no connection without an error. This would potentially cause a panic in VERY slow production servers.
    • Improvements

      • Converts a few panics to errors in wire protocol encoding/decoding. Resolves issue #304.
    Source code(tar.gz)
    Source code(zip)
Owner
Aerospike
Aerospike
Go client library for Pilosa

Go Client for Pilosa Go client for Pilosa high performance distributed index. What's New? See: CHANGELOG Requirements Go 1.12 and higher. Install Down

Pilosa 53 Jun 9, 2022
Golang client for redislabs' ReJSON module with support for multilple redis clients (redigo, go-redis)

Go-ReJSON - a golang client for ReJSON (a JSON data type for Redis) Go-ReJSON is a Go client for ReJSON Redis Module. ReJSON is a Redis module that im

Nitish Malhotra 274 Aug 5, 2022
redis client implement by golang, inspired by jedis.

godis redis client implement by golang, refers to jedis. this library implements most of redis command, include normal redis command, cluster command,

piaohao 105 Jul 20, 2022
Go Memcached client library #golang

About This is a memcache client library for the Go programming language (http://golang.org/). Installing Using go get $ go get github.com/bradfitz/gom

Brad Fitzpatrick 1.5k Aug 5, 2022
Neo4j Rest API Client for Go lang

neo4j.go Implementation of client package for communication with Neo4j Rest API. For more information and documentation please read Godoc Neo4j Page s

Cihangir 27 Jan 26, 2022
Neo4j REST Client in golang

DEPRECATED! Consider these instead: https://github.com/johnnadratowski/golang-neo4j-bolt-driver https://github.com/go-cq/cq Install: If you don't ha

null 76 Mar 14, 2022
Neo4j client for Golang

neoism - Neo4j client for Go Package neoism is a Go client library providing access to the Neo4j graph database via its REST API. Status System Status

Jason McVetta 388 Aug 2, 2022
Go client for Redis

Redigo Redigo is a Go client for the Redis database. Features A Print-like API with support for all Redis commands. Pipelining, including pipelined tr

null 9.2k Aug 9, 2022
Type-safe Redis client for Golang

Redis client for Golang ❤️ Uptrace.dev - distributed traces, logs, and errors in one place Join Discord to ask questions. Documentation Reference Exam

null 15k Aug 2, 2022
Go Redis Client

xredis Built on top of github.com/garyburd/redigo with the idea to simplify creating a Redis client, provide type safe calls and encapsulate the low l

Raed Shomali 18 Jan 23, 2022
godis - an old Redis client for Go

godis Implements a few database clients for Redis. There is a stable client and an experimental client, redis and exp, respectively. To use any of the

Simon Zimmermann 86 Apr 16, 2022
Google Go Client and Connectors for Redis

Go-Redis Go Clients and Connectors for Redis. The initial release provides the interface and implementation supporting the (~) full set of current Red

Joubin Houshyar 440 Jul 9, 2022
Redis client library for Go

go-redis go-redis is a Redis client library for the Go programming language. It's built on the skeleton of gomemcache. It is safe to use by multiple g

Alexandre Fiori 45 Jul 15, 2020
Type-safe Redis client for Golang

Redis client for Golang ❤️ Uptrace.dev - distributed traces, logs, and errors in one place Join Discord to ask questions. Documentation Reference Exam

null 15.1k Aug 11, 2022
Redis client Mock Provide mock test for redis query

Redis client Mock Provide mock test for redis query, Compatible with github.com/go-redis/redis/v8 Install Confirm that you are using redis.Client the

null 129 Aug 2, 2022
GoBigdis is a persistent database that implements the Redis server protocol. Any Redis client can interface with it and start to use it right away.

GoBigdis GoBigdis is a persistent database that implements the Redis server protocol. Any Redis client can interface with it and start to use it right

Riccardo 5 Apr 27, 2022
HDFS for Go - This is a native golang client for hdfs.

HDFS for Go This is a native golang client for hdfs. It connects directly to the namenode using the protocol buffers API. It tries to be idiomatic by

Colin Marc 1.2k Aug 4, 2022
PostgreSQL API Client

PostgreSQL API language search PostgreSQL API functions response: We don't use PostgreSQL in the usual way. We do everything through API functions, wh

Derek Sivers 14 May 9, 2022
Isomorphic Go client for PostgREST.

Postgrest GO Golang client for PostgREST. The goal of this library is to make an "ORM-like" restful interface. Documentation Full documentation can be

Supabase Community 84 Aug 2, 2022