Skip to content
Snippets Groups Projects
user avatar
Vladimir Davydov authored
Now net.box sends IPROTO_ID request on (re)connect to query features
supported by the server and report its own features. The version and
features reported by the server are checked against the new connection
options:

 - required_protocol_version - min version (unsigned)
 - required_protocol_features - required features (array of strings)

If the server version is older than specified or the server lacks
certain features, the connection will fail.

Features supported by the server are stored in the peer_protocol_version
and peer_protocol_features fields of a connection.

Closes #6253

@TarantoolBot document
Title: Document required_protocol_version/features net.box options

Two new options can now be passed to net.box.connect():

 - required_protocol_version: min IPROTO protocol version that must be
   supported by the server. Type: unsigned integer.
 - required_protocol_features: array of IPROTO protocol features that
   must be supported by the server. Type: array of strings.

If the server version is less than the specified or the server lacks
certain features, the connection will fail with the corresponding error.

Querying server features is implemented via the IPROTO_ID command.
Currently, there are two features defined: streams and transactions.

Irrespective of the options used, the actual version and features are
reported via peer_protocol_version and peer_protocol_features fields of
the connection. Example:

```
tarantool> require('net.box').connect(3301, {
         > required_protocol_version = 1,
         > required_protocol_features = {'transactions'},
         > })
---
- peer_protocol_version: 1
  peer_uuid: 7a8cfdbd-6bbc-4d10-99e5-cbbd06a2382f
  opts:
    required_protocol_version: 1
    required_protocol_features:
    - transactions
  peer_protocol_features:
    transactions: true
    streams: true
  schema_version: 80
  protocol: Binary
  state: active
  peer_version_id: 133632
  port: '3301'
...
```
47a85f9e
History
Name Last commit Last update