Releases: tarantool/go-tarantool
Release list
v3.0.0
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.MustNewwrapper forbox.Newwithout 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
Futureinterface (#470). - Method
ReleaseforFutureandResponseinterface that allows to free used data directly by calling (#493). - Resources allocated for a
Futureobject created by theConnectiontype could be released with theFuture.Release()call (#493). - Added function String() for type interval (#322).
- New
Allocatorinterface for custom allocation of response buffers (#493). - New
PoolAllocatortype that implementsAllocatorusing sync.Pool for power-of-two sized byte slices (#493). - New
Opts.Allocatoroption to configure a custom allocator for a connection (#493). - Method String() for type decimal.Decimal (#322).
- New
Tinterface compatible with testing.T methods to make testing easier,test_helpersupdated with it (#474). - New
MockDoerinterface for customDoertesting with builder pattern methods:AddResponse,AddResponseRaw,AddResponseError,Requests(#487). - New
MockRequestNamedtype for verifying specific requests in tests (#574). - New
test_helpers.ExecuteOnAllfunction 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 viat.Logfwhen the test failed — intended fordefer test_helpers.DumpLogsIfFailed(t, inst)after a successfulStartTarantool(#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*toNew*for naming consistency across the connector (#584). Affectscrud.Make*Request(nowcrud.New*Request),datetime.MakeDatetime(nowdatetime.NewDatetime),decimal.MakeDecimalanddecimal.MakeDecimalFromString(nowdecimal.NewDecimalanddecimal.NewDecimalFromString),decimal.MustMakeDecimal(nowdecimal.MustNewDecimal),arrow.MakeArrow(nowarrow.NewArrow), andcrud.MakeResult(nowcrud.NewResult). - Removed intermediate
spaceRequest,spaceIndexRequesttypes —spaceandindexfields are now inlined directly into each request struct. The same flattening was applied tocrud.spaceRequest(#584). - Required Go version is
1.24now (#456). - Error types redesigned around
errors.Is/errors.As(#469):tarantool.Errorrenamed totarantool.ServerError; the seven legacy client error code constants are now package-levelerrorsentinels (ErrConnectionClosed,ErrTimeouted, ...) with numeric forms exposed astarantool.Code*;ClientErrorgained aCausefield that wraps the underlying I/O error;ClientError.Temporary()removed in favour oftarantool.IsRetryableError(err)/errors.Is(err, ErrRetryable). See MIGRATION.md. test_helpers.MockDoeris now an interface instead of a struct (#487). TheRequestsfield became a methodRequests(). TheNewMockDoer()constructor now returns the interface and uses a builder pattern. OldNewMockDoer(t, ...interface{})is removed. UseNewMockDoer(t), then chainAddResponseRaw(),AddResponseError(),AddResponse()to configure responses.box.Newreturns an error instead of panic (#448).- Now cases of
<-ctx.Done()returns wrapped error provided byctx.Cause(). Allows you compare it usingerrors.Is/As(#457). - Removed deprecated
poolmethods, 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). LogAppendPushFailedreplaced withLogBoxSessionPushUnsupported(#480).- Removed deprecated
Connectionmethods, 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).
Futuretransform intofuturethat implements interfaceFutureand become private,SetErrorandSetResponsebecome private (#470).ConnectionPool.Close()returns a single error value, combining multiple errors using errors.Join() (#540).test_helpers.CheckPoolStatusesandtest_helpers.ProcessListenOnInstancenow accept typed arguments (CheckStatusesArgsandListenOnInstanceArgsrespectively) instead ofinterface{}(#485).ConnectionPool.ConnectWithOpts(),ConnectionPool.Connect()andConnectionPool.Add()now return an error iftarantool.Opts.Reconnect,tarantool.Opts.MaxReconnectsortarantool.Opts.Notifyoptions are set for an instance connection (#581). These options conflict with the pool's own reconnection logic and produce misleading events. Use
pool.ConnectionHandlerto track connection availability instead oftarantool.Opts.Notify. All validation errors are combined usingerrors.Joinand can be checked witherrors.Is.- Rename
pool.ConnectionPooltopool.Pool,pool.ConnectionHandlertopool.Handler,pool.ConnectionInfotopool.Info,pool.ConnectionInfo.ConnRoletopool.Info.Role(#580). - Rename
pool.Pool.GetInfo()topool.Pool.Info()(#580). - Rename
pool.Pool.DoInstance()topool.Pool.DoOn()(#580). - Rename
pool.Connect()topool.New(),pool.ConnectWithOpts()topool.NewWithOpts()(#580). - Rename
poolenum constants to use prefix:ANY→ModeAny,RW→ModeRW,RO→ModeRO,PreferRW→ModePreferRW,PreferRO→ModePreferRO,UnknownRole→RoleUnknown,MasterRole→RoleMaster,
ReplicaRole→RoleReplica(#580). - Replaced custom
Loggerinterface with*slog.Loggerfrom the standard library (#504). TheLoggerinterface,ConnLogKindtype, and its constants (LogReconnectFailed,LogLastReconnectFailed,LogUnexpectedResultId,
LogWatchEventReadFailed,LogBoxSessionPushUnsupported) are removed. UseOpts.Logger *slog.Loggerinstead. PoolOpts.Logger *slog.Loggerreplaces directlog.Printfcalls that were not customizable. By default, logs are
discarded (silent). See MIGRATION.md for details. Streamstruct fieldsIdandConnare now unexported, makingStreaman opaque handle. Neither the stream identifier nor the underlying connection is reachable from outside the package (#471).
Removed
- Deprecated
NewCall16RequestandNewCall17Requestconstructors. UseNewCallRequestinstead (#579). test_helpers.Retryfunction. Useassert.Eventuallyfrom testify instead.test_helpers.WaitUntilReconnectedreimplemented withoutRetry(#485).Loggerinterface anddefaultLoggertype — replaced by*slog.Logger(#504).ConnLogKindtype and its constants — log messages are now identified by string constants inlog.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.StartTarantoolare now terminated when the parent test process dies, preventing leaked instances after a panic (#586). test_helpers.StartTarantoolnow 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.StopTarantoolWithCleanuponly after assertingStartTarantooldid not return an error, so a failed start no longer panics with a nil-pointer dereference in the deferred cleanup (#586).
v2.4.2
v1.12.3
v2.4.1
This maintenance release marks the end of active development on the v2 branch
v2.4.0
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
ErrConcurrentSchemaUpdateconstant for "concurrent schema update" error (#404).
Now you can check this error witherrors.Is(err, tarantool.ErrConcurrentSchemaUpdate). - Implemented support for
IPROTO_IS_SYNCflag in stream transactions, addedIsSync(bool)method forBeginRequest/CommitRequest(#447).
Fixed
- Fixed panic when calling NewWatcher() during reconnection or after connection is closed (#438).
v2.3.2
This release improves the logic of Connect and pool.Connect in case of a hung I/O connection.
Changed
- Previously,
pool.Connectattempted 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 ofpool.Opts.CheckTimeout(#444).
Fixed
v2.3.1
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
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
StartTarantoolandStopTarantool, now it uses pointer onTarantoolInstance:StartTarantool()returns*TarantoolInstance;StopTarantool()andStopTarantoolWithCleanup()accepts
*TarantoolInstanceas arguments.
- Field
CmdinTarantoolInstancestruct declared as deprecated. SuggestedWait(),Stop()andSignal()methods as safer to use instead of directCmd.Processaccess (#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
Overview
The release fixes a schema lost after a reconnect.
Fixed
unable to use an index name because schema is not loadederror after a reconnect (#424).
v2.2.0
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 inConnectionPool.controller()andConnectionPool.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).