Skip to content

cluster discovery: discard non-list result #196

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

Closed
Totktonada opened this issue May 31, 2019 · 4 comments
Closed

cluster discovery: discard non-list result #196

Totktonada opened this issue May 31, 2019 · 4 comments

Comments

@Totktonada
Copy link
Member

From README:

A discovery function should return a single result of strings (i.e. single string return 'host:3301' or array of strings return {'host1:3301', 'host2:3301'}).

I think there is no reason to support single string result. However if we'll support it here it will push other connectors to support it too (because a user that see correct result with tarantool-java will expect they will be correct with another connector too).

I propose to forbid support of this single string response format and allow only a list of strings result.

Validation rules and to be defined and maybe should be strictier that now and consistent with other connectors. Maybe this should not be handled with the scope of this issue.

@nicktorwald
Copy link

We can only fix docs here, I think.
Because there are no differences between return 'host' and return {'host'} in terms of msgpack. Both results will be deserialized as a single item collection ArrayList = {'host'}.

@Totktonada
Copy link
Member Author

'host' is a4686f7374, {'host'} is 91a4686f7374. If they are really undistinguishable, it is something strange on the connector side.

nicktorwald added a commit that referenced this issue Jun 3, 2019
Instead of discarding the full list of addresses when at least one
address does not match the format like host[:port] a discoverer just
skips this broken address and carries on processing.

Change discovery function requirements description in part of single
value support. This is done to be consistent with other Tarantool
connectors.

Closes: #195, #196
@nicktorwald
Copy link

hm... It seems Lua returns an array in both cases 0x91 0xA4 0x68 0x6F 0x73 0x74 when we use old iproto_call_16 (0x06) instead of iproto_call (0x0a).

@Totktonada
Copy link
Member Author

That is so. We should newer use call_16, tarantool-1.6 is gone a long time ago. It seems we can remove it entirely.

nicktorwald added a commit that referenced this issue Jun 4, 2019
Instead of discarding the full list of addresses when at least one
address does not match the format like host[:port] a discoverer just
skips the broken address and carries on processing.

Discard a single string return type for a cluster discovery function.

Change discovery function requirements in part of single
value support. This is done to be consistent with other Tarantool
connectors.

Closes: #195, #196
nicktorwald added a commit that referenced this issue Jun 11, 2019
Instead of discarding the full list of addresses when at least one
address does not match the format like host[:port] a discoverer just
skips the broken address and carries on processing.

Discard a single string return type for a cluster discovery function.

Change discovery function requirements in part of single
value support. This is done to be consistent with other Tarantool
connectors.

Closes: #195, #196
nicktorwald added a commit that referenced this issue Jun 12, 2019
Instead of discarding the full list of addresses when at least one
address does not match the format like host[:port] a discoverer just
skips the broken address and carries on processing.

Discard a single string return type for a cluster discovery function.

Change discovery function requirements in part of single
value support. This is done to be consistent with other Tarantool
connectors.

Closes: #195, #196
nicktorwald added a commit that referenced this issue Jun 18, 2019
The call_16 became obsolete when tarantool-1.6 was gone. There're
no reasons to continue using the old version by default.

Change discovery function requirements in part of single
value support. This is done to be consistent with other Tarantool
connectors.

Closes: #196
nicktorwald added a commit to nicktorwald/tarantool-java that referenced this issue Jul 1, 2019
The call_16 became obsolete when tarantool-1.6 was gone. There're
no reasons to continue using the old version by default.

Change discovery function requirements in part of single
value support. This is done to be consistent with other Tarantool
connectors.

Closes: tarantool#196
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants