All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning except to the first release.
- 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. - 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. - New
MockRequestNamedtype for verifying specific requests in tests. - New
test_helpers.ExecuteOnAllfunction to execute operations on all instances in parallel with context support.
- Required Go version is
1.24now (#456). test_helpers.MockDoeris now an interface instead of a struct. 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{}.ConnectionPool.ConnectWithOpts(),ConnectionPool.Connect()andConnectionPool.Add()now return an error iftarantool.Opts.Reconnect,tarantool.Opts.MaxReconnectsortarantool.Opts.Notifyoptions are set for an instance connection. These options conflict with the pool's own reconnection logic and produce misleading events. Usepool.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. - Rename
pool.Pool.GetInfo()topool.Pool.Info(). - Rename
pool.Pool.DoInstance()topool.Pool.DoOn(). - Rename
pool.Connect()topool.New(),pool.ConnectWithOpts()topool.NewWithOpts(). - Rename
poolenum constants to use prefix:ANY→ModeAny,RW→ModeRW,RO→ModeRO,PreferRW→ModePreferRW,PreferRO→ModePreferRO,UnknownRole→RoleUnknown,MasterRole→RoleMaster,ReplicaRole→RoleReplica. - 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.
- Deprecated
NewCall16RequestandNewCall17Requestconstructors. UseNewCallRequestinstead. test_helpers.Retryfunction. Useassert.Eventuallyfrom testify instead.test_helpers.WaitUntilReconnectedreimplemented withoutRetry.Loggerinterface anddefaultLoggertype — replaced by*slog.Logger(#504).ConnLogKindtype and its constants — log messages are now identified by string constants inlog.go(#504).
- 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 (#147). - 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 (#147).
This maintenance release marks the end of active development on the v2
branch.
This release focuses on adding schema/user/session operations, synchronous transaction flag handling, and fixes watcher panic.
- 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 panic when calling NewWatcher() during reconnection or after connection is closed (#438).
This release improves the logic of Connect and pool.Connect in case of a
hung I/O connection.
- 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).
- 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).
The patch releases fixes expected Connect() behavior and reduces allocations.
- A usage of sync.Pool of msgpack.Decoder saves 2 object allocations per a response decoding (#440).
- 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).
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.
- 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 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).
- Test helpers does not detect a fail to start a Tarantool instance if another Tarantool instance already listens a port (#431).
The release fixes a schema lost after a reconnect.
unable to use an index name because schema is not loadederror after a reconnect (#424).
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.
- 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).
- More informative request canceling: log the probable reason for unexpected request ID and add request ID info to context done error message (#407).
The small release improves the ConnectionPool. The ConnectionPool now does not
require execute access for box.info from a user for Tarantool >= 3.0.0.
executeaccess forbox.infois no longer required for ConnectionPool for a Tarantool version >= 3.0.0 (#380).
ConnectionPool.Remove()does not notify aConnectionHandlerafter an instance is already removed from the pool (#385).
There are a lot of changes in the new major version. The main ones:
- The
go_tarantool_call_17build tag is no longer needed, since by default theCallRequestisCall17Request. - The
go_tarantool_msgpack_v5build tag is no longer needed, since only themsgpack/v5library is used. - The
go_tarantool_ssl_disablebuild tag is no longer needed, since the connector is no longer depends onOpenSSLby default. You could use the external library go-tlsdialer to create a connection with thessltransport. - Required Go version is
1.20now. - The
Connectfunction became more flexible. It now allows to create a connection with cancellation and a customDialerimplementation. - It is required to use
Requestimplementation types with theConnection.Domethod instead ofConnection.<Request>methods. - The
connection_poolpackage renamed topool.
See the migration guide for more details.
- Type() method to the Request interface (#158).
- Enumeration types for RLimitAction/iterators (#158).
- IsNullable flag for Field (#302).
- More linters on CI (#310).
- Meaningful description for read/write socket errors (#129).
- Support
operation_dataincrud.Error(#330). - Support
fetch_latest_metadataoption for crud requests with metadata (#335). - Support
noreturnoption for data change crud requests (#335). - Support
crud.schemarequest (#336, #351). - Support
IPROTO_WATCH_ONCErequest type for Tarantool version >= 3.0.0-alpha1 (#337). - Support
yield_everyoption for crud select requests (#350). - Support
IPROTO_FEATURE_SPACE_AND_INDEX_NAMESfor Tarantool version >= 3.0.0-alpha1 (#338). It allows to use space and index names in requests instead of their IDs. GetSchemafunction to get the actual schema (#7).- Support connection via an existing socket fd (#321).
Headerstruct for the response header (#237). It can be accessed viaHeader()method of theResponseinterface.Responsemethod added to theRequestinterface (#237).- New
LogAppendPushFailedconnection log constant (#237). It is logged when connection fails to append a push response. ErrorNoconstant that indicates that no error has occurred while getting the response (#237).- Ability to mock connections for tests (#237). Added new types
MockDoer,MockRequesttotest_helpers. AuthDialertype for creating a dialer with authentication (#301).ProtocolDialertype for creating a dialer withProtocolInforeceiving and check (#301).GreetingDialertype for creating a dialer, that fillsGreetingof a connection (#301).- New method
Pool.DoInstanceto execute a request on a target instance in a pool (#376).
- connection_pool renamed to pool (#239).
- Use msgpack/v5 instead of msgpack.v2 (#236).
- Call/NewCallRequest = Call17/NewCall17Request (#235).
- Change encoding of the queue.Identify() UUID argument from binary blob to plain string. Needed for upgrade to Tarantool 3.0, where a binary blob is decoded to a varbinary object (#313).
- Use objects of the Decimal type instead of pointers (#238).
- Use objects of the Datetime type instead of pointers (#238).
connection.Connectno longer return non-working connection objects (#136). This function now does not attempt to reconnect and tries to establish a connection only once. Function might be canceled via context. Context accepted as first argument.pool.Connectandpool.Addnow accept context as the first argument, which user may cancel in process. Ifpool.Connectis canceled in progress, an error will be returned. All created connections will be closed.iproto.Featuretype now used instead ofProtocolFeature(#337).iproto.IPROTO_FEATURE_constants now used instead of localFeatureconstants forprotocol(#337).- Change
crudoperationsTimeoutoption type tocrud.OptFloat64instead ofcrud.OptUint(#342). - Change all
UpsertandUpdaterequests to accept*tarantool.Operationsasopsparameters instead ofinterface{}(#348). - Change
OverrideSchema(*Schema)toSetSchema(Schema)(#7). - Change values, stored by pointers in the
Schema,Space,Indexstructs, to be stored by their values (#7). - Make
Dialermandatory for creation a single connection (#321). - Remove
Connection.RemoteAddr(),Connection.LocalAddr(). AddAddr()function instead (#321). - Remove
Connection.ClientProtocolInfo,Connection.ServerProtocolInfo. AddProtocolInfo()function, which returns the server protocol info (#321). NewWatcherchecks the actual features of the server, rather than relying on the features provided by the user during connection creation (#321).pool.NewWatcherdoes not create watchers for connections that do not support it (#321).- Rename
pool.GetPoolInfotopool.GetInfo. Change return type tomap[string]ConnectionInfo(#321). Responseis now an interface (#237).- All responses are now implementations of the
Responseinterface (#237).SelectResponse,ExecuteResponse,PrepareResponse,PushResponseare part of a public API.Pos(),MetaData(),SQLInfo()methods created for them to get specific info. Special types of responses are used with special requests. IsPush()method is added to the response iterator (#237). It returns the information if the current response is aPushResponse.PushCodeconstant is removed.- Method
GetforFuturenow returns response data (#237). To get the actual response newGetResponsemethod has been added. MethodsAppendPushandSetResponseaccept responseHeaderand data as their arguments. Futureconstructors now acceptRequestas their argument (#237).- Operations
Ping,Select,Insert,Replace,Delete,Update,Upsert,Call,Call16,Call17,Eval,Executeof aConnectorandPoolerreturn response data instead of an actual responses (#237). - Renamed
StrangerResponsetoMockResponse(#237). pool.Connect,pool.ConnetcWithOptsandpool.Adduse a new typepool.Instanceto determinate connection options (#356).pool.Connect,pool.ConnectWithOptsandpool.Addadd connections to the pool even it is unable to connect to it (#372).- Required Go version updated from
1.13to1.20(#378).
- All Connection., Connection.Typed and Connection.Async methods. Instead you should use requests objects + Connection.Do() (#241).
- All ConnectionPool., ConnectionPool.Typed and ConnectionPool.Async methods. Instead you should use requests objects + ConnectionPool.Do() (#241).
- box.session.push() usage: Future.AppendPush() and Future.GetIterator() methods, ResponseIterator and TimeoutResponseIterator types (#324).
- multi subpackage (#240).
- msgpack.v2 support (#236).
- pool/RoundRobinStrategy (#158).
- DeadlineIO (#158).
- UUID_extId (#158).
- IPROTO constants (#158).
- Code() method from the Request interface (#158).
Schemafield from theConnectionstruct (#7).OkCodeandPushCodeconstants (#237).- SSL support (#301).
Future.Err()method (#382).
- Flaky decimal/TestSelect (#300).
- Race condition at roundRobinStrategy.GetNextConnection() (#309).
- Incorrect decoding of an MP_DECIMAL when the
scalevalue is negative (#314). - Incorrect options (
after,batch_sizeandforce_map_call) setup for crud.SelectRequest (#320). - Incorrect options (
vshard_router,fields,bucket_id,mode,prefer_replica,balance) setup for crud.GetRequest (#335). - Tests with crud 1.4.0 (#336).
- Tests with case sensitive SQL (#341).
- Splice update operation accepts 3 arguments instead of 5 (#348).
- Unable to use a slice of custom types as a slice of tuples or objects for
crud.*ManyRequest/crud.*ObjectManyRequest(#365).
The release introduces the ability to gracefully close Connection and ConnectionPool and also provides methods for adding or removing an endpoint from a ConnectionPool.
- Connection.CloseGraceful() unlike Connection.Close() waits for all requests to complete (#257).
- ConnectionPool.CloseGraceful() unlike ConnectionPool.Close() waits for all requests to complete (#257).
- ConnectionPool.Add()/ConnectionPool.Remove() to add/remove endpoints from a pool (#290).
- crud tests with Tarantool 3.0 (#293).
- SQL tests with Tarantool 3.0 (#295).
The release adds pagination support and wrappers for the crud module.
- Support pagination (#246).
- A Makefile target to test with race detector (#218).
- Support CRUD API (#108).
- An ability to replace a base network connection to a Tarantool instance (#265).
- Missed iterator constant (#285).
- queue module version bumped to 1.3.0 (#278).
- Several non-critical data race issues (#218).
- Build on Apple M1 with OpenSSL (#260).
- ConnectionPool does not properly handle disconnection with Opts.Reconnect set (#272).
- Watcher events loss with a small per-request timeout (#284).
- Connect() panics on concurrent schema update (#278).
- Wrong Ttr setup by Queue.Cfg() (#278).
- Flaky queue/Example_connectionPool (#278).
- Flaky queue/Example_simpleQueueCustomMsgPack (#277).
The release improves compatibility with new Tarantool versions.
- Support iproto feature discovery (#120).
- Support errors extended information (#209).
- Support error type in MessagePack (#209).
- Support event subscription (#119).
- Support session settings (#215).
- Support pap-sha256 authorization method (Tarantool EE feature) (#243).
- Support graceful shutdown (#214).
- Decimal package uses a test variable DecimalPrecision instead of a package-level variable decimalPrecision (#233).
- Flaky test TestClientRequestObjectsWithContext (#244).
- Flaky test multi/TestDisconnectAll (#234).
- Build on macOS with Apple M1 (#260).
The release adds support for the latest version of the queue package with master-replica switching.
- Support the queue 1.2.1 (#177).
- ConnectionHandler interface for handling changes of connections in ConnectionPool (#178).
- Execute, ExecuteTyped and ExecuteAsync methods to ConnectionPool (#176).
- ConnectorAdapter type to use ConnectionPool as Connector interface (#176).
- An example how to use queue and connection_pool subpackages together (#176).
- Mode type description in the connection_pool subpackage (#208).
- Missed Role type constants in the connection_pool subpackage (#208).
- ConnectionPool does not close UnknownRole connections (#208).
- Segmentation faults in ConnectionPool requests after disconnect (#208).
- Addresses in ConnectionPool may be changed from an external code (#208).
- ConnectionPool recreates connections too often (#208).
- A connection is still opened after ConnectionPool.Close() (#208).
- Future.GetTyped() after Future.Get() does not decode response correctly (#213).
- Decimal package uses a test function GetNumberLength instead of a package-level function getNumberLength (#219).
- Datetime location after encode + decode is unequal (#217).
- Wrong interval arithmetic with timezones (#221).
- Invalid MsgPack if STREAM_ID > 127 (#224).
- queue.Take() returns an invalid task (#222).
The minor release with time zones and interval support for datetime.
- Optional msgpack.v5 usage (#124).
- TZ support for datetime (#163).
- Interval support for datetime (#165).
- Markdown of documentation for the decimal subpackage (#201).
This release adds a number of features. The extending of the public API has become possible with a new way of creating requests. New types of requests are created via chain calls. Streams, context and prepared statements support are based on this idea.
- SSL support (#155).
- IPROTO_PUSH messages support (#67).
- Public API with request object types (#126).
- Support decimal type in msgpack (#96).
- Support datetime type in msgpack (#118).
- Prepared SQL statements (#117).
- Context support for request objects (#48).
- Streams and interactive transactions support (#101).
Call16method, support build taggo_tarantool_call_17to choose default behavior forCallmethod as Call17 (#125).
IPROTO_*constants that identify requests renamed from<Name>Requestto<Name>RequestCode(#126).
- NewErrorFuture function (#190).
- Add
ExecuteAsyncandExecuteTypedto common connector interface (#62).
This release adds a number of features. Also it significantly improves testing, CI and documentation.
- Coveralls support (#149).
- Reusable testing workflow (integration testing with latest Tarantool) (#112).
- Simple CI based on GitHub actions (#114).
- Support UUID type in msgpack (#90).
- Go modules support (#91).
- queue-utube handling (#85).
- Master discovery (#113).
- SQL support (#62).
- Handle everything with
go test(#115). - Use plain package instead of module for UUID submodule (#134).
- Reset buffer if its average use size smaller than quarter of capacity (#95).
- Update API documentation: comments and examples (#123).
- Fix queue tests (#107).
- Make test case consistent with comments (#105).
First release.
- Fix infinite recursive call of
Upsertmethod forConnectionMulti. - Fix index out of range panic on
dial()to short address. - Fix cast in
defaultLogger.Report(#49). - Fix race condition on extremely small request timeouts (#43).
- Fix notify for
Connectedtransition. - Fix reconnection logic and add
Opts.SkipSchemamethod. - Fix future sending.
- Fix panic on disconnect + timeout.
- Fix block on msgpack error.
- Fix ratelimit.
- Fix
timeoutsmethod forConnection. - Fix possible race condition on extremely small request timeouts.
- Fix race condition on future channel creation.
- Fix block on forever closed connection.
- Fix race condition in
Connection. - Fix extra map fields.
- Fix response header parsing.
- Fix reconnect logic in
Connection.
- Make logger configurable.
- Report user mismatch error immediately.
- Set limit timeout by 0.9 of connection to queue request timeout.
- Update fields could be negative.
- Require
RLimitActionto be specified ifRateLimitis specified. - Use newer typed msgpack interface.
- Do not start timeouts goroutine if no timeout specified.
- Clear buffers on connection close.
- Update
BenchmarkClientParallelMassive. - Remove array requirements for keys and opts.
- Do not allocate
Responseinplace. - Respect timeout on request sending.
- Use
AfterFunc(fut.timeouted)instead oftime.NewTimer(). - Use
_vspace/_vindexfor introspection. - Method
Tuples()always returns table for response.
- Remove
UpsertTyped()method (#23).
- Add methods
Future.WaitChanandFuture.Err(#86). - Get node list from nodes (#81).
- Add method
deleteConnectionFromPool. - Add multiconnections support.
- Add
Addrmethod for the connection (#64). - Add
Deletemethod for the queue. - Implemented typed taking from queue (#55).
- Add
OverrideSchemamethod for the connection. - Add default case to default logger.
- Add license (BSD-2 clause as for Tarantool).
- Add
GetTypedmethod for the connection (#40). - Add
ConfiguredTimeoutmethod for the connection, change queue interface. - Add an example for queue.
- Add
GetQueuemethod for the queue. - Add queue support.
- Add support of Unix socket address.
- Add check for prefix "tcp:".
- Add the ability to work with the Tarantool via Unix socket.
- Add note about magic way to pack tuples.
- Add notification about connection state change.
- Add workaround for tarantool/tarantool#2060 (#32).
- Add
ConnectedNowmethod for the connection. - Add IO deadline and use
net.Conn.Set(Read|Write)Deadline. - Add a couple of benchmarks.
- Add timeout on connection attempt.
- Add
RLimitActionoption. - Add
Call17method for the connection to make a call compatible with Tarantool 1.7. - Add
ClientParallelMassivebenchmark. - Add
runtime.Goschedfor decreasingwriter.flushcount. - Add
Eval,EvalTyped,SelectTyped,InsertTyped,ReplaceTyped,DeleteRequest,UpdateTyped,UpsertTypedmethods. - Add
UpdateTypedmethod. - Add
CallTypedmethod. - Add possibility to pass
SpaceandIndexobjects intoSelectetc. - Add custom MsgPack pack/unpack functions.
- Add support of Tarantool 1.6.8 schema format.
- Add support of Tarantool 1.6.5 schema format.
- Add schema loading.
- Add
LocalAddrandRemoteAddrmethods for the connection. - Add
Upsertmethod for the connection. - Add
EvalandEvalAsyncmethods for the connection. - Add Tarantool error codes.
- Add auth support.
- Add auth during reconnect.
- Add auth request.