Skip to content

Commit 823b41e

Browse files
committed
api: make Call = Call17
Closes #235
1 parent 44de0ed commit 823b41e

16 files changed

+185
-314
lines changed

.github/workflows/testing.yml

-13
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,6 @@ jobs:
101101
make test
102102
make testrace
103103
104-
- name: Run regression tests with call_17
105-
run: |
106-
make test TAGS="go_tarantool_call_17"
107-
make testrace TAGS="go_tarantool_call_17"
108-
109104
- name: Run fuzzing tests
110105
if: ${{ matrix.fuzzing }}
111106
run: make fuzzing TAGS="go_tarantool_decimal_fuzzing"
@@ -191,14 +186,6 @@ jobs:
191186
env:
192187
TEST_TNT_SSL: ${{matrix.ssl}}
193188

194-
- name: Run regression tests with call_17
195-
run: |
196-
source tarantool-enterprise/env.sh
197-
make test TAGS="go_tarantool_call_17"
198-
make testrace TAGS="go_tarantool_call_17"
199-
env:
200-
TEST_TNT_SSL: ${{matrix.ssl}}
201-
202189
- name: Run fuzzing tests
203190
if: ${{ matrix.fuzzing }}
204191
run: make fuzzing TAGS="go_tarantool_decimal_fuzzing"

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Versioning](http://semver.org/spec/v2.0.0.html) except to the first release.
2020

2121
- connection_pool renamed to pool (#239)
2222
- msgpack/v5 is default at now (#236)
23+
- Call/NewCallRequest = Call17/NewCall17Request (#235)
2324

2425
### Removed
2526

README.md

+9-7
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ faster than other packages according to public benchmarks.
3535
* [multi removed](#multi-subpackage)
3636
* [connection_pool renamed to pool](#pool-subpackage)
3737
* [msgpack.v5 migration](#msgpackv5-migration)
38+
* [Call = Call17](#call--call17)
3839
* [Contributing](#contributing)
3940
* [Alternative connectors](#alternative-connectors)
4041

@@ -71,13 +72,7 @@ This allows us to introduce new features without losing backward compatibility.
7172
```
7273
go_tarantool_ssl_disable
7374
```
74-
2. To change the default `Call` behavior from `Call16` to `Call17`, you can use
75-
the build tag:
76-
```
77-
go_tarantool_call_17
78-
```
79-
**Note:** In future releases, `Call17` may be used as default `Call` behavior.
80-
3. To run fuzz tests with decimals, you can use the build tag:
75+
2. To run fuzz tests with decimals, you can use the build tag:
8176
```
8277
go_tarantool_decimal_fuzzing
8378
```
@@ -190,6 +185,13 @@ There are also changes in the logic that can lead to errors in the old code,
190185
to achieve full compliance of behavior between `msgpack.v5` and `msgpack.v2`. So
191186
we don't go this way. We use standard settings if it possible.
192187

188+
#### Call = Call17
189+
190+
Call requests uses `IPROTO_CALL` instead of `IPROTO_CALL_16`.
191+
192+
So now `Call` = `Call17` and `NewCallRequest` = `NewCall17Request`. A result
193+
of the requests is an array instead of array of arrays.
194+
193195
## Contributing
194196

195197
See [the contributing guide](CONTRIBUTING.md) for detailed instructions on how

call_16_test.go

-54
This file was deleted.

call_17_test.go

-54
This file was deleted.

const.go

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const (
2121
IdRequestCode = 73
2222
WatchRequestCode = 74
2323
UnwatchRequestCode = 75
24+
CallRequestCode = Call17RequestCode
2425

2526
KeyCode = 0x00
2627
KeySync = 0x01

const_call_16.go

-8
This file was deleted.

const_call_17.go

-8
This file was deleted.

pool/call_16_test.go

-69
This file was deleted.

pool/call_17_test.go

-69
This file was deleted.

pool/connection_pool.go

+7-10
Original file line numberDiff line numberDiff line change
@@ -345,10 +345,9 @@ func (connPool *ConnectionPool) Upsert(space interface{}, tuple, ops interface{}
345345
return conn.Upsert(space, tuple, ops)
346346
}
347347

348-
// Call16 calls registered Tarantool function.
349-
// It uses request code for Tarantool >= 1.7 if go-tarantool
350-
// was build with go_tarantool_call_17 tag.
351-
// Otherwise, uses request code for Tarantool 1.6.
348+
// Call calls registered Tarantool function.
349+
// It uses request code for Tarantool >= 1.7, so result is not converted
350+
// (though, keep in mind, result is always array).
352351
func (connPool *ConnectionPool) Call(functionName string, args interface{}, userMode Mode) (resp *tarantool.Response, err error) {
353352
conn, err := connPool.getNextConnection(userMode)
354353
if err != nil {
@@ -466,9 +465,8 @@ func (connPool *ConnectionPool) UpdateTyped(space, index interface{}, key, ops i
466465
}
467466

468467
// CallTyped calls registered function.
469-
// It uses request code for Tarantool >= 1.7 if go-tarantool
470-
// was build with go_tarantool_call_17 tag.
471-
// Otherwise, uses request code for Tarantool 1.6.
468+
// It uses request code for Tarantool >= 1.7, so result is not converted
469+
// (though, keep in mind, result is always array).
472470
func (connPool *ConnectionPool) CallTyped(functionName string, args interface{}, result interface{}, userMode Mode) (err error) {
473471
conn, err := connPool.getNextConnection(userMode)
474472
if err != nil {
@@ -588,9 +586,8 @@ func (connPool *ConnectionPool) UpsertAsync(space interface{}, tuple interface{}
588586
}
589587

590588
// CallAsync sends a call to registered Tarantool function and returns Future.
591-
// It uses request code for Tarantool >= 1.7 if go-tarantool
592-
// was build with go_tarantool_call_17 tag.
593-
// Otherwise, uses request code for Tarantool 1.6.
589+
// It uses request code for Tarantool >= 1.7, so future's result will not be converted
590+
// (though, keep in mind, result is always array).
594591
func (connPool *ConnectionPool) CallAsync(functionName string, args interface{}, userMode Mode) *tarantool.Future {
595592
conn, err := connPool.getNextConnection(userMode)
596593
if err != nil {

0 commit comments

Comments
 (0)