Skip to content
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

KIKIMR-20079: create/alter/drop group #501

Merged
merged 4 commits into from
Dec 18, 2023
Merged

Conversation

VPolka
Copy link
Collaborator

@VPolka VPolka commented Dec 12, 2023

No description provided.

Copy link

github-actions bot commented Dec 12, 2023

Note

This is an automated comment that will be appended during run.

🔴 linux-x86_64-relwithdebinfo: some tests FAILED for commit 21f0971.

Test history

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
57856 48693 0 42 9118 3

🔴 linux-x86_64-release-asan: some tests FAILED for commit 21f0971.

Test history

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
14076 13933 0 47 89 7

return MakeFuture(ResultFromError<TGenericResult>("Couldn't get domain name"));
}

NKikimrSchemeOp::TModifyScheme schemeTx;
Copy link
Collaborator

Choose a reason for hiding this comment

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

With these changes we get a new code that does the same things as in kqp_ic_gateway.cpp. Can we make some library with helpers that fill TModifyScheme proto and is used by both gateways?

Copy link
Collaborator

Choose a reason for hiding this comment

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

It is not a strict requirement. I think we need to see if it will bring us a profit. Maybe in this particular cases protos are very simple. If so, maybe it would be better to leave this code in both gateways.

if (!response.GetIssues().empty()) {
NYql::TIssues issues;
NYql::IssuesFromMessage(response.GetIssues(), issues);
Promise.SetValue(NYql::NCommon::ResultFromIssues<TResult>(NYql::TIssuesIds::SUCCESS, "", issues));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should you put SUCCESS status here or maybe infer it from response.GetIssues()?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Condition in case is already a status of response
This changes in ExecComplete status, so it means that result is success

renameGroup.SetNewName(settings.NewName);

SendSchemeRequest(ev.Release()).Apply(
[renameGroupPromise](const TFuture<TGenericResult>& future) mutable {
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe [&renameGroupPromise]

Copy link
Collaborator

Choose a reason for hiding this comment

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

renameGroupPromise is local variable. So it will be error to capture it by reference. Promises have reference counting, it is safe to copy renameGroupPromise into lambda.

ydb/core/kqp/host/kqp_gateway_proxy.cpp Outdated Show resolved Hide resolved
@@ -111,13 +114,39 @@ class TAlterLogin: public TSubOperationBase {
} else {
db.Table<Schema::LoginSidMembers>().Key(removeGroupMembership.GetGroup(), removeGroupMembership.GetMember()).Delete();
result->SetStatus(NKikimrScheme::StatusSuccess);
if (response.Warning) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

AddGroup has if Notice, RemoveGroup has if Warning. Maybe there should be the same condition?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I just made it like in pg, but yeah, maybe it is better to make it with the same levels

}

if (!settings.Roles.size()) {
return MakeFuture(ResultFromError<TGenericResult>("No roles given for AlterGroup request"));
Copy link
Collaborator

Choose a reason for hiding this comment

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

I can't see the same check for CreateGroup. I think they should be equivalent in this case

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

CreateGroup can be without any users, but before calling AddUsersToGroup I check that settings.Roles.size() is not 0
https://github.com/ydb-platform/ydb/pull/501/files#diff-fb95cf18d73802eec5aabc3807b82c4e98f0b3cfae62523917dab93336b0c5ebR933

@VPolka VPolka merged commit 6c56d36 into ydb-platform:main Dec 18, 2023
2 of 4 checks passed
CyberROFL pushed a commit to CyberROFL/ydb that referenced this pull request Dec 19, 2023
* KIKIMR-20079: create/alter/drop group

* fix test

* fix mistake

* resolve issues
@Enjection Enjection mentioned this pull request Dec 20, 2023
This was referenced Dec 29, 2023
Closed
This was referenced Jan 11, 2024
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.

4 participants