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
Create, Drop, or Move access entities between different access storages. #51912
Conversation
This is an automated comment for commit 1a3eac0 with description of existing statuses. It's updated for the latest CI running
|
a9d4e71
to
77e45e5
Compare
role_name AT storage_name STORAGE
syntaxDROP ROLE ... FROM
and CREATE ROLE ... AT
syntax
src/Access/MultipleAccessStorage.cpp
Outdated
auto source_storage = findStorageByName(source_storage_name); | ||
auto destination_storage = findStorageByName(destination_storage_name); | ||
|
||
auto to_move = source_storage->read(ids); | ||
source_storage->remove(ids); |
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.
Shouldn't these lines be in the try
below?
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.
No, I suppose. First, we read entities to move and store them in order to be able to rollback in the future. Then we try to remove entities from source storage, and if we fail, we don't need to rollback anything.
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.
ok
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.
Please add the names of the access entities to the error message. And also if source_storage->remove()
fails it would be nice to see the names of the access entities.
Please change the title and description of this PR as you've changed the syntax. |
DROP ROLE ... FROM
and CREATE ROLE ... AT
syntax
@vitlibar, can you help with stateless flaky tests? It seems to me that the reason why they fail is parallel runs. Should I add a no-parallel-run tag to them, or am I missing something? |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Add new queries, which allow to create/drop of access entities in specified access storage or move access entities from one access storage to another.
Example:
CREATE ROLE test1 IN memory
MOVE ROLE test1 TO local_directory
DROP ROLE test1 FROM local_directory