-
Notifications
You must be signed in to change notification settings - Fork 15
internal: master conn check for get space utils #336
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
internal: master conn check for get space utils #336
Conversation
crud/common/utils.lua
Outdated
if replicaset.master.conn.error ~= nil then | ||
local error_msg = string.format('The connection to the master is not valid: %s', | ||
replicaset.master.conn.error) | ||
error(error_msg) | ||
end |
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.
According to #95 it is also possible that replicaset.master
is nil
. The issue is pretty old, but maybe it worth to re-check it.
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.
Thanks! So far I've implemented a simple check replicaset.master
is not nil
, but it is not entirely clear to me where the timeout for this check is set from
f3ab53a
to
d85e82b
Compare
d85e82b
to
8bfa3b5
Compare
e9fecfe
to
9538e49
Compare
Also, while working on the task, I noticed that this line of the code triggers an error: myapp.router> crud.insert('customer', {1,100,'Mike'})
---
- error: '...epro/myapp/.rocks/share/tarantool/crud/common/schema.lua:40: calling
''status'' on bad self (fiber expected, got table)'
... AFAIU, it should be |
9538e49
to
3789c9d
Compare
It would be nice to fix it in a separate commit, especially if you've got a repro (should be ok even without one, if this is complicated). |
1135bd2
to
b36cf6c
Compare
Thanks for the feedback! Now the PR is prepared for the #331 |
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 updates! There are some older questions that are still unresolved: I've either never got the final answer or have missed it -- please, respond to them here so all of our decisions would be preserved here.
f6f790b
to
8fe5f81
Compare
8fe5f81
to
e437c5a
Compare
e437c5a
to
2faf18c
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 updates! Let's change a couple of cosmetic things and merge it.
Added validation of the master presence in replicaset and the master connection to the `utils.get_space` method before receiving the space from the connection. Closes #331
Fixed fiber cancel on schema reload timeout. Before that, an error occurred in timeout case with description: `calling 'status' on bad self (fiber expected, got table)`. To reproduce the error before this fix, it is enough to checkout to the one commit back and perform the action described in #331.
2faf18c
to
906a2d3
Compare
Overview This release introduces a breaking change with removing a deprecated feature: `crud.len(space_id)`. This release also introduces a Cartridge clusterwide config to setup `crud.cfg`. Breaking changes You cannot use space id as a space identifier in `crud.len` anymore. Use space name instead. New features * Timeout condition for the validation of master presence in replicaset and for the master connection (#95). * Cartridge clusterwide configuration for `crud.cfg` (#332). Changes * Forbid using space id in `crud.len` (#255). Fixes * Add validation of the master presence in replicaset and the master connection to the `utils.get_space` method before receiving the space from the connection (#331). * Fix fiber cancel on schema reload timeout in `call_reload_schema` (PR #336).
Overview This release introduces a breaking change with removing a deprecated feature: `crud.len(space_id)`. This release also introduces a Cartridge clusterwide config to setup `crud.cfg`. Breaking changes You cannot use space id as a space identifier in `crud.len` anymore. Use space name instead. New features * Timeout condition for the validation of master presence in replicaset and for the master connection (#95). * Cartridge clusterwide configuration for `crud.cfg` (#332). Changes * Forbid using space id in `crud.len` (#255). Fixes * Add validation of the master presence in replicaset and the master connection to the `utils.get_space` method before receiving the space from the connection (#331). * Fix fiber cancel on schema reload timeout in `call_reload_schema` (PR #336).
Added validation of the connection to the
utils.get_space
method before receiving the space through the connection.Error before patch:
Now:
Closes #331