Skip to content

Releases: tarantool/go-tarantool

v3.0.0

Choose a tag to compare

@oleg-jukovec oleg-jukovec released this 08 Jun 12:20

v3 redesigns the connector for a simpler, more idiomatic Go experience.

Logging plugs into *slog.Logger — no custom interface.

Error handling now works the way Go expects: errors.Is and errors.As just work — write if errors.Is(err, tarantool.ErrTimeouted) instead of comparing numeric codes. Context cancellation errors carry ctx.Cause(), so the underlying reason is always inspectable.

Request builders return immutable values, safe to share across goroutines without defensive copying.

For high-throughput workloads, the new Allocator interface and Future.Release() give you explicit control over buffer reuse — push allocations out of the hot path. Future and Stream became opaque interfaces, hiding internals and giving us freedom to evolve them.

Requires Go 1.24. See MIGRATION.md for upgrade details.

Added

  • New types for MessagePack extensions compatible with go-option (#459).
  • Added box.MustNew wrapper for box.New without an error (#448).
  • Added missing IPROTO feature flags to greeting negotiation (iproto.IPROTO_FEATURE_IS_SYNC, iproto.IPROTO_FEATURE_INSERT_ARROW) (#466).
  • Added Future.cond (sync.Cond) and Future.finished bool. Added Future.finish() marks Future as done (#496).
  • Added function String() for type datetime (#322).
  • New Future interface (#470).
  • Method Release for Future and Response interface that allows to free used data directly by calling (#493).
  • Resources allocated for a Future object created by the Connection type could be released with the Future.Release() call (#493).
  • Added function String() for type interval (#322).
  • New Allocator interface for custom allocation of response buffers (#493).
  • New PoolAllocator type that implements Allocator using sync.Pool for power-of-two sized byte slices (#493).
  • New Opts.Allocator option to configure a custom allocator for a connection (#493).
  • Method String() for type decimal.Decimal (#322).
  • New T interface compatible with testing.T methods to make testing easier, test_helpers updated with it (#474).
  • New MockDoer interface for custom Doer testing with builder pattern methods: AddResponse, AddResponseRaw, AddResponseError, Requests (#487).
  • New MockRequestNamed type for verifying specific requests in tests (#574).
  • New test_helpers.ExecuteOnAll function to execute operations on all instances in parallel with context support (#485).
  • New (*test_helpers.TarantoolInstance).LogTail() method that returns the last 50 lines of captured tarantool stdout/stderr (#587).
  • New test_helpers.DumpLogsIfFailed(t, inst) helper that prints the captured tarantool log via t.Logf when the test failed — intended for defer test_helpers.DumpLogsIfFailed(t, inst) after a successful StartTarantool (#587).

Changed

  • All top-level New*Request() constructors now return values instead of pointers. All methods on request types use value receivers and return values, enabling immutable builder-style chaining (#584).
  • Renamed value constructors Make* to New* for naming consistency across the connector (#584). Affects crud.Make*Request (now crud.New*Request), datetime.MakeDatetime (now datetime.NewDatetime), decimal.MakeDecimal and decimal.MakeDecimalFromString (now decimal.NewDecimal and decimal.NewDecimalFromString), decimal.MustMakeDecimal (now decimal.MustNewDecimal), arrow.MakeArrow (now arrow.NewArrow), and crud.MakeResult (now crud.NewResult).
  • Removed intermediate spaceRequest, spaceIndexRequest types — space and index fields are now inlined directly into each request struct. The same flattening was applied to crud.spaceRequest (#584).
  • Required Go version is 1.24 now (#456).
  • Error types redesigned around errors.Is / errors.As (#469): tarantool.Error renamed to tarantool.ServerError; the seven legacy client error code constants are now package-level error sentinels (ErrConnectionClosed, ErrTimeouted, ...) with numeric forms exposed as tarantool.Code*; ClientError gained a Cause field that wraps the underlying I/O error; ClientError.Temporary() removed in favour of tarantool.IsRetryableError(err) / errors.Is(err, ErrRetryable). See MIGRATION.md.
  • test_helpers.MockDoer is now an interface instead of a struct (#487). The Requests field became a method Requests(). The NewMockDoer() constructor now returns the interface and uses a builder pattern. Old NewMockDoer(t, ...interface{}) is removed. Use NewMockDoer(t), then chain AddResponseRaw(), AddResponseError(), AddResponse() to configure responses.
  • box.New returns an error instead of panic (#448).
  • Now cases of <-ctx.Done() returns wrapped error provided by ctx.Cause(). Allows you compare it using errors.Is/As (#457).
  • Removed deprecated pool methods, related interfaces and tests are updated (#478).
  • Removed deprecated box.session.push() support: Future.AppendPush() and Future.GetIterator() methods, ResponseIterator and TimeoutResponseIterator types, Future.pushes[], Future.ready (#480, #497).
  • LogAppendPushFailed replaced with LogBoxSessionPushUnsupported (#480).
  • Removed deprecated Connection methods, related interfaces and tests are updated (#479).
  • Replaced the use of optional types in crud with go-option library (#492).
  • Future.done replaced with Future.cond (sync.Cond) + Future.finished bool (#496).
  • Future transform into future that implements interface Future and become private, SetError and SetResponse become private (#470).
  • ConnectionPool.Close() returns a single error value, combining multiple errors using errors.Join() (#540).
  • test_helpers.CheckPoolStatuses and test_helpers.ProcessListenOnInstance now accept typed arguments (CheckStatusesArgs and ListenOnInstanceArgs respectively) instead of interface{} (#485).
  • ConnectionPool.ConnectWithOpts(), ConnectionPool.Connect() and ConnectionPool.Add() now return an error if tarantool.Opts.Reconnect, tarantool.Opts.MaxReconnects or tarantool.Opts.Notify options are set for an instance connection (#581). These options conflict with the pool's own reconnection logic and produce misleading events. Use
    pool.ConnectionHandler to track connection availability instead of tarantool.Opts.Notify. All validation errors are combined using errors.Join and can be checked with errors.Is.
  • Rename pool.ConnectionPool to pool.Pool, pool.ConnectionHandler to pool.Handler, pool.ConnectionInfo to pool.Info, pool.ConnectionInfo.ConnRole to pool.Info.Role (#580).
  • Rename pool.Pool.GetInfo() to pool.Pool.Info() (#580).
  • Rename pool.Pool.DoInstance() to pool.Pool.DoOn() (#580).
  • Rename pool.Connect() to pool.New(), pool.ConnectWithOpts() to pool.NewWithOpts() (#580).
  • Rename pool enum constants to use prefix: ANYModeAny, RWModeRW, ROModeRO, PreferRWModePreferRW, PreferROModePreferRO, UnknownRoleRoleUnknown, MasterRoleRoleMaster,
    ReplicaRoleRoleReplica (#580).
  • Replaced custom Logger interface with *slog.Logger from the standard library (#504). The Logger interface, ConnLogKind type, and its constants (LogReconnectFailed, LogLastReconnectFailed, LogUnexpectedResultId,
    LogWatchEventReadFailed, LogBoxSessionPushUnsupported) are removed. Use Opts.Logger *slog.Logger instead. Pool Opts.Logger *slog.Logger replaces direct log.Printf calls that were not customizable. By default, logs are
    discarded (silent). See MIGRATION.md for details.
  • Stream struct fields Id and Conn are now unexported, making Stream an opaque handle. Neither the stream identifier nor the underlying connection is reachable from outside the package (#471).

Removed

  • Deprecated NewCall16Request and NewCall17Request constructors. Use NewCallRequest instead (#579).
  • test_helpers.Retry function. Use assert.Eventually from testify instead. test_helpers.WaitUntilReconnected reimplemented without Retry (#485).
  • Logger interface and defaultLogger type — replaced by *slog.Logger (#504).
  • ConnLogKind type and its constants — log messages are now identified by string constants in log.go (#504).

Fixed

  • Fixed the fluctuating behavior of the TestConnectionHandlerOpenUpdateClose test by increasing the waiting time (#502).
  • On Linux, tarantool processes started by test_helpers.StartTarantool are now terminated when the parent test process dies, preventing leaked instances after a panic (#586).
  • test_helpers.StartTarantool now captures the last lines of the spawned tarantool's stdout/stderr and includes them in the returned error when startup fails, so test failures show the underlying tarantool error directly instead of just "exit status 1" or a connection timeout (#587).
  • Reordered tests to defer test_helpers.StopTarantoolWithCleanup only after asserting StartTarantool did not return an error, so a failed start no longer panics with a nil-pointer dereference in the deferred cleanup (#586).

v2.4.2

Choose a tag to compare

@bigbes bigbes released this 17 Feb 10:15

The patch release with fixes from static analyzer.

Fixed

  • Fix similar branches in decimal/bcd.go detected by Svacer static analyzer (#533).

v1.12.3

Choose a tag to compare

@bigbes bigbes released this 17 Feb 10:13

The patch release with fixes from static analyzer.

Fixed

  • Fix similar branches in decimal/bcd.go detected by Svacer static analyzer (#534).

v2.4.1

Choose a tag to compare

@oleg-jukovec oleg-jukovec released this 23 Oct 19:00

This maintenance release marks the end of active development on the v2 branch

v2.4.0

Choose a tag to compare

@bigbes bigbes released this 11 Jul 18:56

This release focuses on adding schema/user/session operations, synchronous transaction flag handling, and fixes watcher panic.

Added

  • Implemented all box.schema.user operations requests and sugar interface (#426).
  • Implemented box.session.su request and sugar interface only for current session granting (#426).
  • Defined ErrConcurrentSchemaUpdate constant for "concurrent schema update" error (#404).
    Now you can check this error with errors.Is(err, tarantool.ErrConcurrentSchemaUpdate).
  • Implemented support for IPROTO_IS_SYNC flag in stream transactions, added IsSync(bool) method for BeginRequest/CommitRequest (#447).

Fixed

  • Fixed panic when calling NewWatcher() during reconnection or after connection is closed (#438).

v2.3.2

Choose a tag to compare

@oleg-jukovec oleg-jukovec released this 14 Apr 16:20

This release improves the logic of Connect and pool.Connect in case of a hung I/O connection.

Changed

  • Previously, pool.Connect attempted to establish a connection one after another instance. It could cause the entire chain to hang if one connection hanged. Now connections are established in parallel. After the first successful connection, the remaining connections wait with a timeout of pool.Opts.CheckTimeout (#444).

Fixed

  • Connect() may not cancel Dial() call on context expiration if network connection hangs (#443).
  • pool.Connect() failed to connect to any instance if a first instance connection hangs (#444).

v2.3.1

Choose a tag to compare

@oleg-jukovec oleg-jukovec released this 03 Apr 11:00

The patch releases fixes expected Connect() behavior and reduces allocations.

Added

  • A usage of sync.Pool of msgpack.Decoder saves 2 object allocations per a response decoding.

Changed

  • Connect() now retry the connection if a failure occurs and opts.Reconnect > 0. The number of attempts is equal to opts.MaxReconnects or unlimited if opts.MaxReconnects == 0. Connect() blocks until a connection is established, the context is cancelled, or the number of attempts is exhausted (#436).

v2.3.0

Choose a tag to compare

@oleg-jukovec oleg-jukovec released this 11 Mar 08:07
252c3b7

The release extends box.info responses and ConnectionPool.GetInfo return data.

Be careful, we have changed the test_helpers package a little since we do not support backward compatibility for it.

Added

  • Extend box with replication information (#427).
  • The Instance info has been added to ConnectionInfo for ConnectionPool.GetInfo response (#429).
  • Added helpers to run Tarantool config storage (#431).

Changed

  • Changed helpers API StartTarantool and StopTarantool, now it uses pointer on TarantoolInstance:
    • StartTarantool() returns *TarantoolInstance;
    • StopTarantool() and StopTarantoolWithCleanup() accepts
      *TarantoolInstance as arguments.
  • Field Cmd in TarantoolInstance struct declared as deprecated. Suggested Wait(), Stop() and Signal() methods as safer to use instead of direct Cmd.Process access (#431).

Fixed

  • Test helpers does not detect a fail to start a Tarantool instance if another Tarantool instance already listens a port (#431).

v2.2.1

Choose a tag to compare

@oleg-jukovec oleg-jukovec released this 27 Dec 10:49

Overview

The release fixes a schema lost after a reconnect.

Fixed

  • unable to use an index name because schema is not loaded error after a reconnect (#424).

v2.2.0

Choose a tag to compare

@oleg-jukovec oleg-jukovec released this 16 Dec 10:25

Overview

The release introduces the IPROTO_INSERT_ARROW request (arrow.InsertRequest) and a request to archive box.info values (box.InfoRequest). Additionally, it includes some improvements to logging.

Added

  • Error logging to ConnectionPool.Add() in case, when unable to establish connection and ctx is not canceled (#389).
  • Error logging for error case of ConnectionPool.tryConnect() calls in ConnectionPool.controller() and ConnectionPool.reconnect() (#389).
  • Methods that are implemented but not included in the pooler interface (#395).
  • Implemented stringer methods for pool.Role (#405).
  • Support the IPROTO_INSERT_ARROW request (#399).
  • A simple implementation of using the box interface (#410).

Changed

  • More informative request canceling: log the probable reason for unexpected request ID and add request ID info to context done error message (#407).