-
Notifications
You must be signed in to change notification settings - Fork 589
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] Fix some concurrent memory access problems in partition balancer #18450
Conversation
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)
@ztlpn build is failing, it appears? |
It is handy to have a base class for all instances of concurrent modifications. (cherry picked from commit 627db4d) Conflicts: src/v/cluster/topic_table.h src/v/utils/stable_iterator_adaptor.h
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) Conflicts: src/v/cluster/scheduling/types.cc
Fixed |
Huh, the test has uncovered another problem - that we update |
I removed commit 1c63990 from the backport so as not to block backporting the actual fixes. I will backport it later with another fix. |
Backport of PR #18305