Skip to content

Commit

Permalink
api: make Call = Call17
Browse files Browse the repository at this point in the history
Closes #235
  • Loading branch information
oleg-jukovec committed Mar 22, 2023
1 parent 26731d0 commit 63161d5
Show file tree
Hide file tree
Showing 16 changed files with 185 additions and 314 deletions.
13 changes: 0 additions & 13 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,6 @@ jobs:
make test
make testrace
- name: Run regression tests with call_17
run: |
make test TAGS="go_tarantool_call_17"
make testrace TAGS="go_tarantool_call_17"
- name: Run fuzzing tests
if: ${{ matrix.fuzzing }}
run: make fuzzing TAGS="go_tarantool_decimal_fuzzing"
Expand Down Expand Up @@ -191,14 +186,6 @@ jobs:
env:
TEST_TNT_SSL: ${{matrix.ssl}}

- name: Run regression tests with call_17
run: |
source tarantool-enterprise/env.sh
make test TAGS="go_tarantool_call_17"
make testrace TAGS="go_tarantool_call_17"
env:
TEST_TNT_SSL: ${{matrix.ssl}}

- name: Run fuzzing tests
if: ${{ matrix.fuzzing }}
run: make fuzzing TAGS="go_tarantool_decimal_fuzzing"
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Versioning](http://semver.org/spec/v2.0.0.html) except to the first release.

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

### Removed

Expand Down
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ faster than other packages according to public benchmarks.
* [multi removed](#multi-subpackage)
* [connection_pool renamed to pool](#pool-subpackage)
* [msgpack.v5 migration](#msgpackv5-migration)
* [Call = Call17](#call--call17)
* [Contributing](#contributing)
* [Alternative connectors](#alternative-connectors)

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

#### Call = Call17

Call requests uses `IPROTO_CALL` instead of `IPROTO_CALL_16`.

So now `Call` = `Call17` and `NewCallRequest` = `NewCall17Request`. A result
of the requests is an array instead of array of arrays.

## Contributing

See [the contributing guide](CONTRIBUTING.md) for detailed instructions on how
Expand Down
54 changes: 0 additions & 54 deletions call_16_test.go

This file was deleted.

54 changes: 0 additions & 54 deletions call_17_test.go

This file was deleted.

1 change: 1 addition & 0 deletions const.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const (
IdRequestCode = 73
WatchRequestCode = 74
UnwatchRequestCode = 75
CallRequestCode = Call17RequestCode

KeyCode = 0x00
KeySync = 0x01
Expand Down
8 changes: 0 additions & 8 deletions const_call_16.go

This file was deleted.

8 changes: 0 additions & 8 deletions const_call_17.go

This file was deleted.

69 changes: 0 additions & 69 deletions pool/call_16_test.go

This file was deleted.

69 changes: 0 additions & 69 deletions pool/call_17_test.go

This file was deleted.

17 changes: 7 additions & 10 deletions pool/connection_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,9 @@ func (connPool *ConnectionPool) Upsert(space interface{}, tuple, ops interface{}
return conn.Upsert(space, tuple, ops)
}

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

// CallTyped calls registered function.
// It uses request code for Tarantool >= 1.7 if go-tarantool
// was build with go_tarantool_call_17 tag.
// Otherwise, uses request code for Tarantool 1.6.
// It uses request code for Tarantool >= 1.7, so result is not converted
// (though, keep in mind, result is always array).
func (connPool *ConnectionPool) CallTyped(functionName string, args interface{}, result interface{}, userMode Mode) (err error) {
conn, err := connPool.getNextConnection(userMode)
if err != nil {
Expand Down Expand Up @@ -584,9 +582,8 @@ func (connPool *ConnectionPool) UpsertAsync(space interface{}, tuple interface{}
}

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

0 comments on commit 63161d5

Please sign in to comment.