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

Fixed large allocation in kafka::wait_for_leaders #16287

Merged

Conversation

mmaslankaprv
Copy link
Member

@mmaslankaprv mmaslankaprv commented Jan 25, 2024

Previously we used a simple std::vector of futures to make
waiting for partition leaders concurrent. Using a vector has a drawback
when dealing with large number of topics and partitions since it may be
required to allocate large contiguous chunk of memory for a future
vector. In this particular case we may not use a fragmented vector or
chunked fifo as the when_all uses a plain vector internally.

To make sure no large chunk of memory is allocated to wait for the
partition leaders changed the logic to use
seastar::max_concurrent_for_each.

Fixes: #15908, #16270
Fixes: #16036

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.3.x
  • v23.2.x
  • v23.1.x

Release Notes

  • none

@mmaslankaprv
Copy link
Member Author

/dt

@mmaslankaprv
Copy link
Member Author

/ci-repeat 10
skip-units
dt-repeat=100
tests/rptest/tests/topic_creation_test.py

@mmaslankaprv
Copy link
Member Author

/ci-repeat 10
skip-units
dt-repeat=20
tests/rptest/tests/topic_creation_test.py

1 similar comment
@mmaslankaprv
Copy link
Member Author

/ci-repeat 10
skip-units
dt-repeat=20
tests/rptest/tests/topic_creation_test.py

@mmaslankaprv
Copy link
Member Author

/ci-repeat 10
skip-units
dt-repeat=20
tests/rptest/tests/topic_creation_test.py

@mmaslankaprv
Copy link
Member Author

/dt

@mmaslankaprv mmaslankaprv changed the title wip Fixed large allocation in kafka::wait_for_leaders Jan 30, 2024
@mmaslankaprv mmaslankaprv marked this pull request as ready for review January 30, 2024 06:55
ztlpn
ztlpn previously approved these changes Jan 31, 2024
src/v/kafka/server/handlers/topics/topic_utils.cc Outdated Show resolved Hide resolved
rockwotj
rockwotj previously approved these changes Jan 31, 2024
Previously we used a simple `std::vector` of futures to make
waiting for partition leaders concurrent. Using a vector has a drawback
when dealing with large number of topics and partitions since it may be
required to allocate large contiguous chunk of memory for a future
vector. In this particular case we may not use a fragmented vector or
chunked fifo as the `when_all` uses a plain vector internally.

To make sure no large chunk of memory is allocated to wait for the
partition leaders changed the logic to use
`seastar::max_concurrent_for_each`.

Fixes: redpanda-data#15908

Signed-off-by: Michal Maslanka <michal@redpanda.com>
Sometimes it may happen that producer swarm is stopped after topic is
recreated leading to a test failure. Added check restarting the producer
if necessary

Signed-off-by: Michal Maslanka <michal@redpanda.com>
@mmaslankaprv mmaslankaprv merged commit ba04490 into redpanda-data:dev Feb 1, 2024
18 checks passed
@mmaslankaprv mmaslankaprv deleted the wait-for-leaders-large-alloc branch February 1, 2024 07:18
@vbotbuildovich
Copy link
Collaborator

/backport v23.3.x

@vbotbuildovich
Copy link
Collaborator

/backport v23.2.x

@vbotbuildovich
Copy link
Collaborator

Oops! Something went wrong.

Workflow run logs.

@vbotbuildovich
Copy link
Collaborator

Oops! Something went wrong.

Workflow run logs.

@gousteris
Copy link
Contributor

/backport v23.3.x

@gousteris
Copy link
Contributor

/backport v23.2.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants