Skip to content

Unclear error if no leader #331

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
WeCodingNow opened this issue Nov 21, 2022 · 1 comment · Fixed by #336
Closed

Unclear error if no leader #331

WeCodingNow opened this issue Nov 21, 2022 · 1 comment · Fixed by #336
Assignees
Labels

Comments

@WeCodingNow
Copy link

WeCodingNow commented Nov 21, 2022

Problem:
if

  1. failover is disabled
  2. a replicaset master dies
  3. a router is restarted
  4. you then try to execute any crud operation

A cryptic error is returned.

Error:

myapp.router> crud.select('test', nil, {first=1})
---
- null
- line: 183
  class_name: SelectError
  err: '...app/.rocks/share/tarantool/crud/common/sharding/init.lua:183: ...repro/myapp/.rocks/share/tarantool/crud/common/utils.lua:100:
    attempt to index field ''space'' (a nil value)'
  file: '...app/.rocks/share/tarantool/crud/common/sharding/init.lua'
  stack: "stack traceback:\n\t...app/.rocks/share/tarantool/crud/common/sharding/init.lua:183:
    in function <...app/.rocks/share/tarantool/crud/common/sharding/init.lua:168>\n\t[C]:
    in function 'xpcall'\n\t.../LocalCode/repro/myapp/.rocks/share/tarantool/errors.lua:145:
    in function <.../LocalCode/repro/myapp/.rocks/share/tarantool/errors.lua:139>\n\t[C]:
    in function 'pcall'\n\tbuiltin/box/console.lua:402: in function <builtin/box/console.lua:378>\n\t[string
    \"local function func(...) return require('cons...\"]:1: in main chunk\n\t[C]:
    in function 'pcall'\n\tbuiltin/box/console.lua:402: in function 'eval'\n\tbuiltin/box/console.lua:708:
    in function 'repl'\n\tbuiltin/box/console.lua:842: in function <builtin/box/console.lua:828>\n\t[C]:
    in function 'pcall'\n\tbuiltin/socket.lua:1081: in function <builtin/socket.lua:1079>"
  str: 'SelectError: ...app/.rocks/share/tarantool/crud/common/sharding/init.lua:183:
    ...repro/myapp/.rocks/share/tarantool/crud/common/utils.lua:100: attempt to index
    field ''space'' (a nil value)'
...

How to reproduce:

# any cartridge app will do
cd myapp
cartridge build
cartridge start -d
cartridge replicasets setup --bootstrap-vshard
cartridge stop s1-master
cartridge stop router && cartridge start -d router
cartridge enter router

# in console
crud.select('test', nil, {first=1})

Repoducer package:
repro.zip

Line that triggers the error:

local space = replicaset.master.conn.space[space_name]

@DifferentialOrange DifferentialOrange self-assigned this Nov 21, 2022
@GRISHNOV GRISHNOV self-assigned this Dec 26, 2022
GRISHNOV added a commit that referenced this issue Dec 28, 2022
Added validation of the connection to the `utils.get_space`
method before receiving the space through the connection.

Closes #331
GRISHNOV added a commit that referenced this issue Dec 28, 2022
Added validation of the connection to the `utils.get_space`
method before receiving the space through the connection.

Closes #331
@Totktonada
Copy link
Member

It was also reported as #95.

GRISHNOV added a commit that referenced this issue Jan 10, 2023
Added validation of the master availability to the `utils.get_space`
method before receiving the space through the connection.

Closes #95
Closes #331
GRISHNOV added a commit that referenced this issue Jan 16, 2023
Added validation of the master availability to the `utils.get_space`
method before receiving the space through the connection.

Closes #95
Closes #331
GRISHNOV added a commit that referenced this issue Jan 16, 2023
Added validation of the master availability to the `utils.get_space`
method before receiving the space through the connection.

Closes #95
Closes #331
GRISHNOV added a commit that referenced this issue Jan 16, 2023
Added validation of the master availability to the `utils.get_space`
method before receiving the space through the connection.

Closes #95
Closes #331
GRISHNOV added a commit that referenced this issue Jan 17, 2023
Added validation of the master availability to the `utils.get_space`
method before receiving the space through the connection.

Closes #95
Closes #331
GRISHNOV added a commit that referenced this issue Jan 17, 2023
Added validation of the master availability to the `utils.get_space`
method before receiving the space through the connection.

Closes #95
Closes #331
GRISHNOV added a commit that referenced this issue Jan 18, 2023
Added validation of the master connection to the `utils.get_space`
method before receiving the space through the connection.

Closes #331
GRISHNOV added a commit that referenced this issue Jan 18, 2023
Fixed a typo of the fiber status call when
processing `RELOAD_SCHEMA_TIMEOUT` in `call_reload_schema`.
Before that, an error occurred in this 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.
GRISHNOV added a commit that referenced this issue Jan 18, 2023
Added validation of the master connection to the `utils.get_space`
method before receiving the space from the connection.

Closes #331
GRISHNOV added a commit that referenced this issue Jan 18, 2023
Fixed a typo of the fiber status call when
processing `RELOAD_SCHEMA_TIMEOUT` in `call_reload_schema`.
Before that, an error occurred in this 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.
GRISHNOV added a commit that referenced this issue Jan 19, 2023
Added validation of the master connection to the `utils.get_space`
method before receiving the space from the connection.

Closes #331
GRISHNOV added a commit that referenced this issue Jan 19, 2023
Fixed a typo of the fiber status call when
processing `RELOAD_SCHEMA_TIMEOUT` in `call_reload_schema`.
Before that, an error occurred in this 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.
GRISHNOV added a commit that referenced this issue Jan 19, 2023
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
GRISHNOV added a commit that referenced this issue Jan 19, 2023
Fixed a typo of the fiber status call when
processing `RELOAD_SCHEMA_TIMEOUT` in `call_reload_schema`.
Before that, an error occurred in this 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.
GRISHNOV added a commit that referenced this issue Jan 19, 2023
Fixed a bug of the fiber status call when
processing `RELOAD_SCHEMA_TIMEOUT` in `call_reload_schema`.
Before that, an error occurred in this 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.
Now the fibers for schema reloading are correctly canceled
if the timeout on schema reloading is reached.
GRISHNOV added a commit that referenced this issue Jan 19, 2023
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.
GRISHNOV added a commit that referenced this issue Jan 19, 2023
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
GRISHNOV added a commit that referenced this issue Jan 19, 2023
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.
DifferentialOrange pushed a commit that referenced this issue Jan 20, 2023
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
DifferentialOrange pushed a commit that referenced this issue Jan 20, 2023
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.
DifferentialOrange added a commit that referenced this issue Feb 2, 2023
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 #337).
@DifferentialOrange DifferentialOrange mentioned this issue Feb 2, 2023
1 task
DifferentialOrange added a commit that referenced this issue Feb 2, 2023
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).
DifferentialOrange added a commit that referenced this issue Feb 2, 2023
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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants