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

[v23.3.x] transform: create smp and scheduling groups #16139

Conversation

rockwotj
Copy link
Contributor

@rockwotj rockwotj commented Jan 17, 2024

Backport of PR #16114

To get a clean backport I also cherry picked #15971 into this backport

Pass RPC requests by value, as we start to write some handlers using
coroutines, it can be a footgun to access have a suspension point, then
the request is destroyed. An example that motivated this:

```c++
ss::future<reply> service::handle(request&& r, rpc::streaming_context&) {
  co_await ss::coroutine::switch_to(get_scheduling_group());
  co_return co_await handle_request(std::move(r));
}
```

In this case `r` is destroyed because the coroutine does not own the
value, and handle request would have a stack-use-after-return issue.

Now that we pass by value, we don't have to remember to move the value
into the current method.

Signed-off-by: Tyler Rockwood <rockwood@redpanda.com>
(cherry picked from commit 5becd89)
Add a scheduling group parameter for all the work executed on the queue.

Signed-off-by: Tyler Rockwood <rockwood@redpanda.com>
(cherry picked from commit 566e2b1)
Signed-off-by: Tyler Rockwood <rockwood@redpanda.com>
(cherry picked from commit 4b3251b)
Signed-off-by: Tyler Rockwood <rockwood@redpanda.com>
(cherry picked from commit 6928acc)
When RPCs come in for transform requests, ensure that they are running
on the transform scheduling groups. Node local service requests are
assumed to be already running on the transform scheduling group, which
is mostly true except for deploys.

Signed-off-by: Tyler Rockwood <rockwood@redpanda.com>
(cherry picked from commit 895af5f)
Signed-off-by: Tyler Rockwood <rockwood@redpanda.com>
(cherry picked from commit d018c59)
The transform/rpc subsystem makes cross shard calls when accessing the
correct partition for a transform, use a `smp_group` to manage this,
like other subsystems.

Signed-off-by: Tyler Rockwood <rockwood@redpanda.com>
(cherry picked from commit cb310c5)
Signed-off-by: Tyler Rockwood <rockwood@redpanda.com>
(cherry picked from commit 99a3ece)
@rockwotj rockwotj added this to the v23.3.x-next milestone Jan 17, 2024
@rockwotj rockwotj added the kind/backport PRs targeting a stable branch label Jan 17, 2024
@rockwotj rockwotj requested a review from oleiman January 17, 2024 21:45
@rockwotj rockwotj marked this pull request as ready for review January 17, 2024 21:46
Copy link
Member

@oleiman oleiman left a comment

Choose a reason for hiding this comment

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

So I'm clear, the cherry pick was otherwise clean, right? As in, you didn't have to change the contents of any commits from #16114?

@rockwotj
Copy link
Contributor Author

So I'm clear, the cherry pick was otherwise clean, right? As in, you didn't have to change the contents of any commits from #16114?

Correct the bot only failed because of conflicts in transform/rpc/service.cc because git incorrectly associated the && removal with the same line as adding the scheduling group switch. I'm glad it did, otherwise there would have been stack use after return, which would be bad. Safer to backport this PR for RPCs anyways.

@rockwotj rockwotj linked an issue Jan 17, 2024 that may be closed by this pull request
Copy link
Member

@BenPope BenPope left a comment

Choose a reason for hiding this comment

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

Backport looks good

@rockwotj
Copy link
Contributor Author

rockwotj commented Jan 18, 2024

CI Failures: #16026, #13498

Also another related to not being able to apply spillover manifest commands, I opened a ticket: #16149

@rockwotj rockwotj merged commit cae88f3 into redpanda-data:v23.3.x Jan 19, 2024
23 checks passed
@rockwotj rockwotj deleted the vbotbuildovich/backport-16114-v23.3.x-600 branch January 19, 2024 14:29
@piyushredpanda piyushredpanda modified the milestones: v23.3.x-next, v23.3.6 Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/redpanda kind/backport PRs targeting a stable branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[v23.3.x] transform: create smp and scheduling groups
4 participants