Skip to content

Make CRUD select error message more clearer. #297

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

Merged

Conversation

psergee
Copy link
Contributor

@psergee psergee commented May 30, 2022

There is a difference between error description for select and other CRUD calls in case of CRUD storage unavailability.

crud.get('profile', 1)
---
- null
- line: 128
  class_name: GetError
  err: "Failed to call get on storage-side: CallError: Failed for 50b73728-f3e5-4363-bfaa-011beef0d20c:
    Function returned an error: NotInitialized: crud isn't initialized on replicaset:
    \"nil\"\nstack traceback:\n\t...ge_app/myapp/.rocks/share/tarantool/crud/common/call.lua:52:
crud.select('profile')
---
- null
- line: 173
  class_name: SelectError
  err: Procedure '_crud.select_on_storage' is not defined
  file: '...app/.rocks/share/tarantool/crud/common/sharding/init.lua'
  stack: "stack traceback:\n\t...app/.rocks/share/tarantool/crud/common/sharding/init.lua:173:

The select error description does not give any clues what might be the cause of this error.
Here is the updated error text:

crud.get('profile', 1)
---
- null
- line: 128
  class_name: GetError
  err: "Failed to call get on storage-side: CallError: Failed for 50b73728-f3e5-4363-bfaa-011beef0d20c:
    Function returned an error: NotInitialized: crud isn't initialized on replicaset:
    \"50b73728-f3e5-4363-bfaa-011beef0d20c\"\nstack traceback:\n\t...e_app/myapp/.rocks/share/tarantool/crud/common/utils.lua:701:
crud.select('profile')
---
- null
- line: 173
  class_name: SelectError
  err: "NotInitialized: crud isn't initialized on replicaset: \"50b73728-f3e5-4363-bfaa-011beef0d20c\"\nstack
    traceback:\n\t...e_app/myapp/.rocks/share/tarantool/crud/common/utils.lua:701:

The new error description for select also contains information about replicaset id.
Additionally, nil replicaset id is fixed in error messages for single calls: get, delete, etc.

See also #229

Copy link
Member

@DifferentialOrange DifferentialOrange left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be LGTM after fixing some minor things:

  • please, squash commits and make them more informative (see doc 1 and doc 2, repo commit messages as an example);
  • I think it's worth to add a CHANGELOG entry

@psergee psergee force-pushed the psergee/gh-consistent-select-error-description branch from 5388c0c to d20b55b Compare May 31, 2022 09:44
@psergee psergee force-pushed the psergee/gh-consistent-select-error-description branch 3 times, most recently from 0158fcd to 9fbb70b Compare June 3, 2022 07:47
Copy link
Member

@DifferentialOrange DifferentialOrange left a 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 update. Should be LGTM after resolving remaining minor things]

@psergee psergee force-pushed the psergee/gh-consistent-select-error-description branch from 9fbb70b to 1d587f4 Compare June 6, 2022 09:10
@psergee psergee force-pushed the psergee/gh-consistent-select-error-description branch from 1d587f4 to 8f3cea3 Compare June 9, 2022 07:05
Copy link
Member

@DifferentialOrange DifferentialOrange left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM after last fix and rebase onto master

@psergee psergee force-pushed the psergee/gh-consistent-select-error-description branch from 8f3cea3 to 82c5ad2 Compare June 15, 2022 07:52
Report "crud is not initialized" error if storage functions
are not defined.
Before this patch, select error description does not give
any clues about possible causes of undefined storage functions.

Part of #229
@psergee psergee force-pushed the psergee/gh-consistent-select-error-description branch from 82c5ad2 to 6d57151 Compare June 15, 2022 08:24
@DifferentialOrange DifferentialOrange merged commit 182d46b into master Jun 15, 2022
@DifferentialOrange DifferentialOrange deleted the psergee/gh-consistent-select-error-description branch June 15, 2022 08:52
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

Successfully merging this pull request may close these issues.

3 participants