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

Use chunked_fifo to retrieve deltas from controller_backend #11691

Merged
merged 3 commits into from
Jul 10, 2023

Conversation

mmaslankaprv
Copy link
Member

@mmaslankaprv mmaslankaprv commented Jun 26, 2023

Using ss::chunked_fifo to return deltas processed by controller
backend. Previously used std::vector may lead to large allocations as
it allocated large chunks of contiguous memory.

Fixes: #11673

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v23.1.x
  • v22.3.x
  • v22.2.x

Release Notes

  • none

src/v/cluster/types.h Show resolved Hide resolved
src/v/cluster/controller_backend.h Outdated Show resolved Hide resolved
@mmaslankaprv mmaslankaprv force-pushed the fix-11673 branch 3 times, most recently from d1ea71c to 7928552 Compare June 29, 2023 09:31
@bharathv
Copy link
Contributor

bharathv commented Jul 1, 2023

compilation failed.

bharathv
bharathv previously approved these changes Jul 3, 2023
src/v/cluster/controller_backend.cc Show resolved Hide resolved
@@ -2758,9 +2758,14 @@ admin_server::get_reconfigurations_handler(std::unique_ptr<ss::http::request>) {
reconfiguration_states.error()),
ss::http::reply::status_type::service_unavailable);
}
// we are forced to use shared pointer as underlying chunked_fifo is not
Copy link
Contributor

@bharathv bharathv Jul 3, 2023

Choose a reason for hiding this comment

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

I'm wondering what is forcing a copy in the first place, all arguments are moved in the underlying stream function. smells like a missing mutable somewhere and the const ness is forcing a copy. 🤔

Signed-off-by: Michal Maslanka <michal@redpanda.com>
Deltas were previously stored as a vector per `ntp`. Deltas access
pattern (iteration, inserting and popping elements from back and from
the end) makes it perfect candidate for `std::list` usage. The
`std::deque` doesn't use large contiguous allocation so will not account for
the memory fragmentation.

Signed-off-by: Michal Maslanka <michal@redpanda.com>
Using `ss::chunked_fifo` to return deltas processed by controller
backend. Previously used `std::vector` may lead to large allocations as
it allocated large chunks of contiguous memory.

Fixes: redpanda-data#11673

Signed-off-by: Michal Maslanka <michal@redpanda.com>
Copy link
Contributor

@bharathv bharathv left a comment

Choose a reason for hiding this comment

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

looks like a force push with rebase.

@mmaslankaprv
Copy link
Member Author

/ci-repeat 1

@mmaslankaprv
Copy link
Member Author

@mmaslankaprv mmaslankaprv merged commit 3537064 into redpanda-data:dev Jul 10, 2023
@vbotbuildovich
Copy link
Collaborator

/backport v23.1.x

@mmaslankaprv mmaslankaprv deleted the fix-11673 branch July 10, 2023 14:31
@vbotbuildovich
Copy link
Collaborator

Failed to run cherry-pick command. I executed the commands below:

git checkout -b backport-pr-11691-v23.1.x-732 remotes/upstream/v23.1.x
git cherry-pick -x 114daef3d064c27d88e065605610bbaf10c86a23 da0958cb3d9fe9b50d8e5f3e0187b8ffea9c8702 fddcb308fc830b147abf16c1b9453e576e57a68f

Workflow run logs.

BenPope added a commit to BenPope/redpanda that referenced this pull request Oct 2, 2023
Operator added in redpanda-data#11691

Signed-off-by: Ben Pope <ben@redpanda.com>
vbotbuildovich pushed a commit to vbotbuildovich/redpanda that referenced this pull request Oct 3, 2023
Operator added in redpanda-data#11691

Signed-off-by: Ben Pope <ben@redpanda.com>
(cherry picked from commit a2b9966)
BenPope added a commit to BenPope/redpanda that referenced this pull request Oct 3, 2023
Operator added in redpanda-data#11691

Signed-off-by: Ben Pope <ben@redpanda.com>
(cherry picked from commit a2b9966)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Oversized allocation: 262144 bytes in cluster::controller_backend::delta_metadata
4 participants