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

API to get group information and to change file ownership #2314

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

muthu90tech
Copy link
Contributor

The scylladb codebase is bypassing seastar api to make syscalls directly, instead add seastar APIs for those syscall and use it in the transport/controller.cc in scylla
see issue: scylladb/scylladb#17443

src/core/reactor.cc Outdated Show resolved Hide resolved
src/core/reactor.cc Outdated Show resolved Hide resolved
src/core/reactor.cc Outdated Show resolved Hide resolved
src/util/file.cc Outdated Show resolved Hide resolved
src/util/file.cc Outdated Show resolved Hide resolved
include/seastar/core/reactor.hh Outdated Show resolved Hide resolved
include/seastar/core/file.hh Outdated Show resolved Hide resolved
include/seastar/core/seastar.hh Outdated Show resolved Hide resolved
include/seastar/core/seastar.hh Outdated Show resolved Hide resolved
src/core/reactor.cc Outdated Show resolved Hide resolved
src/util/file.cc Outdated Show resolved Hide resolved
src/core/reactor.cc Outdated Show resolved Hide resolved
@muthu90tech muthu90tech force-pushed the helpers-for-scylla-17443 branch 2 times, most recently from 9899bb3 to 25ca367 Compare July 5, 2024 07:41
@muthu90tech muthu90tech requested review from tchaikov, nyh and avikivity July 7, 2024 20:13
src/core/reactor.cc Outdated Show resolved Hide resolved
src/core/reactor.cc Outdated Show resolved Hide resolved
src/core/reactor.cc Outdated Show resolved Hide resolved
@muthu90tech muthu90tech requested a review from tchaikov July 12, 2024 04:29
src/core/reactor.cc Outdated Show resolved Hide resolved
src/core/reactor.cc Outdated Show resolved Hide resolved
src/core/reactor.cc Outdated Show resolved Hide resolved
@muthu90tech muthu90tech force-pushed the helpers-for-scylla-17443 branch 2 times, most recently from bbf24d2 to 5424c1d Compare August 17, 2024 04:59
@muthu90tech
Copy link
Contributor Author

@muthu90tech please resolve the conflicts and repush.

rebased instead of merge commit.

Copy link
Contributor

@tchaikov tchaikov left a comment

Choose a reason for hiding this comment

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

we are closer =)

left a couple comments.

include/seastar/core/seastar.hh Outdated Show resolved Hide resolved
include/seastar/core/seastar.hh Outdated Show resolved Hide resolved
@muthu90tech muthu90tech force-pushed the helpers-for-scylla-17443 branch from 5424c1d to 06e8164 Compare August 23, 2024 03:46
@muthu90tech muthu90tech requested a review from tchaikov August 23, 2024 03:53
Copy link
Contributor

@tchaikov tchaikov left a comment

Choose a reason for hiding this comment

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

lgtm

@tchaikov
Copy link
Contributor

@scylladb/seastar-maint hello maintainers, could you help review this change?

include/seastar/core/seastar.hh Outdated Show resolved Hide resolved
include/seastar/core/seastar.hh Outdated Show resolved Hide resolved
include/seastar/core/seastar.hh Outdated Show resolved Hide resolved
src/core/reactor.cc Outdated Show resolved Hide resolved
src/core/reactor.cc Outdated Show resolved Hide resolved
@muthu90tech muthu90tech force-pushed the helpers-for-scylla-17443 branch from 06e8164 to da2ee2e Compare September 2, 2024 18:30
@muthu90tech muthu90tech requested a review from nyh September 2, 2024 18:33
@nyh
Copy link
Contributor

nyh commented Sep 3, 2024

@muthu90tech when you push a new version and ask for a review, please write a comment saying what you changed from the previous version.

src/core/syscall_result.hh Outdated Show resolved Hide resolved
tests/unit/libc_wrapper_test.cc Outdated Show resolved Hide resolved
tests/unit/libc_wrapper_test.cc Outdated Show resolved Hide resolved
tests/unit/libc_wrapper_test.cc Outdated Show resolved Hide resolved
tests/unit/libc_wrapper_test.cc Outdated Show resolved Hide resolved
tests/unit/libc_wrapper_test.cc Outdated Show resolved Hide resolved
@muthu90tech muthu90tech force-pushed the helpers-for-scylla-17443 branch from da2ee2e to fe2a67c Compare September 4, 2024 13:50
Copy link
Contributor Author

@muthu90tech muthu90tech left a comment

Choose a reason for hiding this comment

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

changes made:

  1. Made the ec() method public in seastar/src/core/syscall_result.hh > syscall_result
  2. Modified the test, to assert on error code as well
  3. the memset on buf not needed as getgrnam only writes to it.
  4. removed unnecessary var to hold buffer length.

Commit Sep 15:
@nyh
After reading comments from @avikivity , I have created a separate seastar specific group struct and named it group_details

@muthu90tech muthu90tech requested a review from nyh September 4, 2024 14:01
@muthu90tech muthu90tech force-pushed the helpers-for-scylla-17443 branch from fe2a67c to 653962d Compare September 5, 2024 02:36
@muthu90tech muthu90tech force-pushed the helpers-for-scylla-17443 branch from 653962d to 02e6796 Compare September 15, 2024 19:48
src/seastar.cc Outdated Show resolved Hide resolved
src/util/file.cc Outdated Show resolved Hide resolved
src/core/reactor.cc Outdated Show resolved Hide resolved
@muthu90tech muthu90tech force-pushed the helpers-for-scylla-17443 branch from 02e6796 to b47563a Compare September 16, 2024 21:20
@@ -61,6 +61,14 @@ struct directory_entry {
std::optional<directory_entry_type> type;
};

Copy link
Member

@avikivity avikivity Sep 17, 2024

Choose a reason for hiding this comment

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

Add APIs to get group details and to change ownership of file.

Please enrich the patch changelog with the details.

Copy link
Contributor Author

@muthu90tech muthu90tech Sep 17, 2024

Choose a reason for hiding this comment

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

Add APIs to get group details and to change ownership of file.

Please enrich the patch changelog with the details.

Thanks @avikivity , I have added details to the commit log

There are a few calls in scylladb that bypass Seastar APIs when making libc
and syscall (getgrnam, chown), see issue scylladb/scylladb#17443.

This commit implements those APIs, which can be used to address the
issue scylladb/scylladb#17443
@muthu90tech muthu90tech force-pushed the helpers-for-scylla-17443 branch from b47563a to 6daa5f3 Compare September 17, 2024 14:17
@avikivity
Copy link
Member

Please drop the artificial merge commit.

@muthu90tech muthu90tech force-pushed the helpers-for-scylla-17443 branch from 96693f5 to 6daa5f3 Compare September 23, 2024 21:01
@muthu90tech
Copy link
Contributor Author

Please drop the artificial merge commit.

@avikivity , apologies, syncing my fork resulted in this, corrected it now.

@avikivity avikivity merged commit cd7f3b8 into scylladb:master Sep 24, 2024
12 of 15 checks passed
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