-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change Call
format to 1.7 version
#171
Conversation
771b493
to
2c91f5e
Compare
Quite an unusual way to name our product |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your patch! Everything seems okay except for some minor things I've pointed out in comments.
However, we definitely shouldn't merge it yet. This is a breaking change, not only by its concept, but also by its effect. There are a lot of Go-Tarantool applications that use Calls, including our PRs (for example, your #148). And each of them will be broken after merging this change.
So we should
- implement and collect all of our planned v2-changes (see V2 proposals #65);
- learn how to deal with packages major version tags.
The first task is related to our planning strategy, so I think there is no use to discuss it here. The second task requires some research, and for now I don't see an issue related to this specific task. Maybe we should solve it as a part of this PR or file a separate issue and assign someone.
2c91f5e
to
a82f715
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM after minor fixes. Let's merge it when we will be ready to tag v2.
Btw, we need to rebase this PR onto master since there are calls in connection_pool too. |
71088c2
to
61d9cf4
Compare
I have several comments and thoughts.
The protocol was extended in the backward-compatible way: The change in tarantool (1.7.1-233-gd025d102f) is actually incompatible: net.box's :call() behaviour was changed. But the protocol was changed in the compatible way. Since we speaking here in context of a connector and the binary protocol, I found the cited words confusing. I propose to reword it to something like '<...> the new
There were several 1.7 releases. 1.7.2 was released in 2016, 1.7.4 in 2017. The change of the question lands into 1.7.2. I would say 1.7.2 everywhere instead of just 1.7, because 1.7.* releases are quite different. BTW, the API documentation mentions 1.7.4. It looks like a mistake. The protocol change is 1.7.1-233-gd025d102f, it lands to 1.7.2.
JSON looks irrelevant here. I see, it is from tarantool 1.7.2 release notes, but I found it confusing rather than explanatory. We recently discussed another incompatible change with @oleg-jukovec (msgpack v5 support). Oleg proposed to use build tags to choose between msgpack v2 and msgpack v5. Here we can do the same. I imagine it as follows. Now we have
It is the raw idea and I would like to hear more opinions. |
dcdcb39
to
2f37bff
Compare
connection.go
Outdated
@@ -116,9 +116,9 @@ func (d defaultLogger) Report(event ConnLogKind, conn *Connection, v ...interfac | |||
// | |||
// ATTENTION: result argument for *Typed methods should deserialize from | |||
// msgpack array, cause Tarantool always returns result as an array. | |||
// For all space related methods and Call* (but not Call17*) methods Tarantool | |||
// For all space related methods and Call16* (but not Call*) methods Tarantool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Call
still works as Call16
by default, so the replacement of Call17
to Call
looks premature. I would use explicit Call16
and Call17
in the documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
connection_pool/connection_pool.go
Outdated
@@ -266,8 +268,20 @@ func (connPool *ConnectionPool) Call(functionName string, args interface{}, user | |||
return conn.Call(functionName, args) | |||
} | |||
|
|||
// Call16 calls registered Tarantool function. | |||
// It uses request code for Tarantool 1.6, so result is converted to array of arrays. | |||
// Deprecated since 1.7.4. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mentioned this above, but I'll remember just in case: the new IPROTO command (and the deprecation of the old one) was in 1.7.2, not 1.7.4. See https://github.com/tarantool/tarantool/releases/tag/1.7.2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, it also seems worthful to say 'Deprecated since tarantool 1.7.2', not just 1.7.2, because the latter could be misunderstood as the version of the connector.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
2f37bff
to
3b3ad86
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the pull request! ILGTM after resolving the notes.
3b3ad86
to
f65ac1e
Compare
It would be better to make the commit message wider: Now it stands out a little among others commit messages. |
An incompatible change was introduced in Tarantool 1.7 which was released in 2016. This change is about a new binary protocol command for CALL, which no more restricts a function to returning an array of tuples and allows returning an arbitrary MsgPack/JSON result, including scalars, nil and void (nothing). We should be in-line with tarantool here and provide `Call17` as just `Call`. For backward compatibility in current `go-tarantool` version build tag `go_tarantool_call_17` have been defined. This tag used to change the default `Call` behavior from `Call16` to `Call17`. Closes #125
f65ac1e
to
9818305
Compare
An incompatible change was introduced in
Tarantool 1.7 which was released in 2016.
This change is about a new binary protocol
command for CALL, which no more restricts
a function to returning an array of tuples
and allows returning an arbitrary MsgPack/JSON
result, including scalars, nil and void (nothing).
We should be in-line with tarantool here and
provide
Call17
as justCall
.For backward compatibility in current
go-tarantool
version build tag
go_tarantool_call_17
have beendefined. This tag used to change the default
Call
behavior from
Call16
toCall17
.Closes #125