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

[v24.1.x] Fix some concurrent memory access problems in partition balancer #18406

Conversation

vbotbuildovich
Copy link
Collaborator

Backport of PR #18305

ztlpn added 4 commits May 10, 2024 21:47
Partition balancer relies on _topics_map_revision checks to safely iterate
over topic table collections with partition granularity (i.e. references
to partition data and replica sets are stored and accessed across yield
points). To make this safe, increment _topics_map_revision every time
_topics, _updates_in_progress, _disabled_partitions or nested
collections are modified in a way that invalidates references or
iterators.

(cherry picked from commit 30bbfb1)
It is handy to have a base class for all instances of concurrent
modifications.

(cherry picked from commit 627db4d)
Shard-local allocation_state object is replaced when we are applying
a controller snapshot. After this happens, all live allocated_partition
objects become invalid. Detect this and throw
concurrent_modification_error in case these objects are still used and
make destructors no-op.

(cherry picked from commit a57a575)
@vbotbuildovich vbotbuildovich added this to the v24.1.x-next milestone May 10, 2024
@vbotbuildovich vbotbuildovich added the kind/backport PRs targeting a stable branch label May 10, 2024
@vbotbuildovich vbotbuildovich requested a review from ztlpn May 10, 2024 21:47
@piyushredpanda piyushredpanda merged commit 4cbcf7c into redpanda-data:v24.1.x May 11, 2024
18 checks passed
@piyushredpanda piyushredpanda modified the milestones: v24.1.x-next, v24.1.3 May 23, 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.

None yet

3 participants