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.

Comments
  • 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
  • Reference to issue number - #388 ,

    Reference to issue number - #388 ,

    asKey, err := aerospike.NewKey(asNamespace, set, key)
    listPolicy := aerospike.NewListPolicy(aerospike.ListOrderUnordered, aerospike.ListWriteFlagsAddUnique|aerospike.ListWriteFlagsNoFail)	
    
    ops := []*aerospike.Operation{
    		aerospike.AddOp(aerospike.NewBin(count, 1)),
    		aerospike.AddOp(aerospike.NewBin(points, points)),
    		aerospike.ListAppendWithPolicyOp(listPolicy, ids, id),
    		aerospike.MapIncrementOp(aerospike.DefaultMapPolicy(), mapId, count, 1),
    		aerospike.MapIncrementOp(aerospike.DefaultMapPolicy(), mapId, points, points),
                    aerospike.GetOp()
    	}
    
    wp := as.NewWritePolicy(0, 0)
    wp.RespondPerEachOp = false
    record, err := asClient.Operate(wp, asKey, ops...)
    fmt.Println("result->:", record, ",", err)
    

    // output - error is coming as parameter error, Error is not coming after removing aerospike.GetOp() Can you please help with this?

    As you told write_master: read-all op can't have respond-all-ops flag error is coming in this , but still same error is coming

    opened by artman92 1
  • Supporting `QueryPartitions` with non-nil filter (secondary index query)

    Supporting `QueryPartitions` with non-nil filter (secondary index query)

    I see the current v6 version does not support QueryPartitions while the filter is non-nil, while the Java library already supports it (I guess?), is there any plan to support it in the near future?

    Go library: https://github.com/aerospike/aerospike-client-go/blob/v6/client.go#L1027

    Java Library: https://github.com/aerospike/aerospike-client-java/blob/68f41e28ebc8de32c372b366b098579b39b11586/client/src/com/aerospike/client/AerospikeClient.java#L2956

    opened by chengc-sa 1
  • multiple cluster nodes is showing cluster timeout

    multiple cluster nodes is showing cluster timeout

    Client side code:

    client, err := aerospike.NewClientWithPolicyAndHost(
        aerospike.NewClientPolicy(),
        aerospike.NewHost("127.0.0.1", 3000),
        aerospike.NewHost("127.0.0.1", 4000),
    )
    

    added aerospike configs as well:

    service {
            user root
            group root
    
            pidfile /var/run/aerospike/asd.pid
            proto-fd-max 15000
    }
    logging {
            file /dev/null {
                    context any info
            }
            console {
                    context any info 
            }
    }
    network {
            service {
                    address any
                    port 3000
                    access-address 172.18.0.3
            }
            heartbeat {
                address any
                mode mesh
                port 3002
                mesh-seed-address-port host.docker.internal 3002 # OK to have local node
                mesh-seed-address-port host.docker.internal 4002
                interval 150
                timeout 10
            }
            fabric {
                address any
                    port 3001
            }
    }
    namespace abcd {
            replication-factor 2
            memory-size 1024M
            default-ttl 0 # 5 days, use 0 to never expire/evict.
            nsup-period 120
            storage-engine memory
            # To use file storage backing, comment out the line above and use the
            # following lines instead.
            storage-engine device {
                    file /opt/aerospike/data/abcd.dat
                    filesize 1G
                    data-in-memory true # Store data in memory in addition to file.
            }
    }
    
    opened by artman92 1
  • 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
  • Client occasionally crashes with index out of bounds when getting a node from a partition

    Client occasionally crashes with index out of bounds when getting a node from a partition

    Occasionally when writing to Aerospike, a service crashes in the Aerospike client when attempting to get a node from the current partition. The length of the array is always 0 when the crash occurs.

    The code here could be modified to ensure it's not getting exceeding the bounds of replicas, but I'm trying to understand why this is happening. Any thoughts?

    Client version: 5.7.0

    Example stack trace (excluding service specific code):

    github.com/aerospike/aerospike-client-go/v5.(*Partition).getSequenceNode(0x46d5d3, 0x61f9685e)
    	/go/pkg/mod/github.com/aerospike/aerospike-client-go/[email protected]/partition.go:195 +0xfc
    github.com/aerospike/aerospike-client-go/v5.(*Partition).GetNodeWrite(0xc01b79eef8, 0x48c6d7)
    	/go/pkg/mod/github.com/aerospike/aerospike-client-go/[email protected]/partition.go:165 +0x53
    github.com/aerospike/aerospike-client-go/v5.(*operateCommand).getNode(0xc07677f782a295c3, {0x4e94324576a4, 0x1d0a1c0})
    	/go/pkg/mod/github.com/aerospike/aerospike-client-go/[email protected]/operate_command.go:43 +0x2d
    github.com/aerospike/aerospike-client-go/v5.(*baseCommand).executeAt(0xc03018ae10, {0x13db778, 0xc03018ae10}, 0xc001fabb90, 0x80, {0xc001fabb90, 0x0, 0x1d0a1c0}, 0x0, 0x0)
    	/go/pkg/mod/github.com/aerospike/aerospike-client-go/[email protected]/command.go:2058 +0x532
    github.com/aerospike/aerospike-client-go/v5.(*baseCommand).execute(0xc001fabb90, {0x13db778, 0xc03018ae10}, 0x4)
    	/go/pkg/mod/github.com/aerospike/aerospike-client-go/[email protected]/command.go:1991 +0x8a
    github.com/aerospike/aerospike-client-go/v5.(*operateCommand).Execute(...)
    	/go/pkg/mod/github.com/aerospike/aerospike-client-go/[email protected]/operate_command.go:60
    github.com/aerospike/aerospike-client-go/v5.(*Client).Operate(0xc0001fc840, 0x0, 0x0, {0xc01cf073e0, 0xfc4500, 0xc01cf13eb0})
    	/go/pkg/mod/github.com/aerospike/aerospike-client-go/[email protected]/client.go:515 +0x3be
    
    opened by asecondo 2
Releases(v6.7.0)
  • v6.7.0(Dec 5, 2022)

    • Improvements

      • Improves testing for float64 precision formatting between amd64 and aarch64.
    • Fixes

      • [CLIENT-2019] Write Batch operation with an invalid namespace record causes all batch transactions to fail.
      • [CLIENT-2020] Support QueryPartitions with non-nil filter (secondary index query)
    Source code(tar.gz)
    Source code(zip)
  • v6.6.0(Nov 8, 2022)

    • Improvements

      • [CLIENT-1959] Retry a foreground scan/query partition to a different replica when a partition unavailable error occurs.
      • [CLIENT-1957] Handle Query, QueryExecute and QueryAggregate on non-existing sets without timing out.
      • [CLIENT-1956] Return an error when a read operation is used in a background query.
    • Fixes

      • [CLIENT-1958] Prevent division by zero if the node array is empty in Cluster.GetRandomNode().
      • [CLIENT-1955] Allow BatchPolicy.SendKey to be applied to all batch keys in all batch commands. Batch commands used in BatchOperate take an independent policy object. We used to ignore the SendKey attribute in those policies.
    Source code(tar.gz)
    Source code(zip)
  • v6.5.0(Oct 26, 2022)

    • New Features

      • [CLIENT-1852] Add ListSetWithPolicyOp to list operations.
    • Fixes

      • [CLIENT-1852] Fix ListRemoveByIndexRangeOp index param type.
      • [CLIENT-1855] Fix an issue where ListGetByValueRangeOp, ListRemoveByValueRangeOp with nil end value return empty slice.
      • [CLIENT-1867] Fix an issue where BatchOperate returns unexpected ResultCode for successful records when a record within a batch returns an error.
    Source code(tar.gz)
    Source code(zip)
  • v6.4.0(Sep 16, 2022)

    This is a Major fix release. We recommend you update to this version ASAP. A bug might occur when a client performing a scan hits a "Partition Unavailable" during an unstable cluster (in both high availability (AP) and strong consistency (CP) modes). Previous versions of the client aborted the scan and put the connection back into the pool, which might cause unprocessed results to be sent to a different transaction (of the same client), possibly resulting in incorrect application behavior. This has been fixed by Go Client v5.10.0 and v6.4.0.

    • Fixes

      • [CLIENT-1827] IdleTimeout new default 0 may be missing tend thread reaping.
      • [CLIENT-1822] Scan/Query/Other streaming commands, including some Batch could put a faulty connection back to the pool after a cluster event where in certain conditions its buffer contents would end up in another scan and mix the results.
      • Update go.mod, redact buggy versions and update required Go version to v1.16
    • Improvements

      • Update the examples for the new scan/queries
      • Avoid indirection for []byte conversion during reflection. Resolves #382.
      • Change v5 to v6 in some outdated documentation.
    Source code(tar.gz)
    Source code(zip)
  • v5.10.0(Sep 16, 2022)

    This is a Major fix release. We recommend you update to this version ASAP. A bug might occur when a client performing a scan hits a "Partition Unavailable" during an unstable cluster (in both high availability (AP) and strong consistency (CP) modes). Previous versions of the client aborted the scan and put the connection back into the pool, which might cause unprocessed results to be sent to a different transaction (of the same client), possibly resulting in incorrect application behavior. This has been fixed by Go Client v5.10.0 and v6.4.0.

    • Fixes

      • [CLIENT-1822] Scan/Query/Other streaming commands, including some Batch could put a faulty connection back to the pool after a cluster event where in certain conditions its buffer contents would end up in another scan and mix the results.
      • Update go.mod, redact buggy versions and update required Go version to v1.16
      • Fixes a few test errors for server v6.1+.
      • Adds a nil check for error in the execution retry.
    • Improvements

      • Update the examples for the new scan/queries.
      • Avoid indirection for []byte conversion during reflection. Resolves #382.
    Source code(tar.gz)
    Source code(zip)
  • v6.3.0(Aug 29, 2022)

    • New Features

      • [CLIENT-1802] Support creating a secondary index on elements within a CDT using context. Supported by server v6.1+.
      • [CLIENT-1773] Change client configuration defaults:
        • Set ClientPolicy.ConnectionQueueSize from 256 to 100.
        • Set ClientPolicy.IdleTimeout from 55 to 0 secs.
        • Set ClientPolicy.MaxErrorRate from 0 to 100.
        • Set Policy.TotalTimeout from 0 to 1000ms for all commands except scan/query.
    • Fixes

      • Fixed a few Linter warnings.
    • Improvements

      • Documented a few constraints in HLL API docs.
      • Documented that PartitionFilter is both a filter and a cursor in the API docs.
    Source code(tar.gz)
    Source code(zip)
  • 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.1(Sep 7, 2022)

  • 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)
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 57 Dec 3, 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 296 Dec 25, 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 109 Dec 6, 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.6k Jan 8, 2023
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 Nov 9, 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 Nov 9, 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 387 Dec 30, 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.4k Jan 1, 2023
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 16.1k Jan 1, 2023
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 19 Sep 26, 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 442 Oct 25, 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 Nov 8, 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 16.2k Jan 4, 2023
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 155 Dec 27, 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 Dec 24, 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 96 Dec 5, 2022