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

[CORE-2461] c/topics: use topic table revision to detect changes in generator #17975

Merged
merged 1 commit into from
Apr 22, 2024

Conversation

mmaslankaprv
Copy link
Member

@mmaslankaprv mmaslankaprv commented Apr 22, 2024

Topic table partition generator is a simple helper to asynchronously iterate over a topic table which may have a lot of elements. The generator validates if topic_table changed while the loop yield for the other tasks. The check was incorrect as it was validating the topic table revision which is updated after the snapshot is applied.

Fixed the issue by validating it _topics_map_revision changed during the scheduling point.

Fixes: #core-internal/1259

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

Release Notes

Bug Fixes

  • fixed a problem leading to UAF error while calculating cloud stage usage

@mmaslankaprv mmaslankaprv changed the title c/topics: use topic table revision to detect changes in generator [CORE-2461] c/topics: use topic table revision to detect changes in generator Apr 22, 2024
ztlpn
ztlpn previously approved these changes Apr 22, 2024
src/v/cluster/topic_table_partition_generator.cc Outdated Show resolved Hide resolved
Topic table partition generator is a simple helper to asynchronously
iterate over a topic table which may have a lot of elements. The
generator validates if `topic_table` changed while the loop yield for
the other tasks. The check was incorrect as it was validating the topic
table revision which is updated after the snapshot is applied.

Fixed the issue by validating it `_topics_map_revision` changed during
the scheduling point.

Fixes: #core-internal/1259

Signed-off-by: Michał Maślanka <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.

nice...

@mmaslankaprv mmaslankaprv merged commit abec88d into redpanda-data:dev Apr 22, 2024
17 checks passed
@mmaslankaprv mmaslankaprv deleted the fix-internal-1259 branch April 22, 2024 16:03
@vbotbuildovich
Copy link
Collaborator

/backport v23.3.x

@vbotbuildovich
Copy link
Collaborator

/backport v23.2.x

@dotnwat
Copy link
Member

dotnwat commented Apr 22, 2024

Feels like something really simple like this might be source of the segfault we've been seeing in the partition balancer, which also has a lot of the safe-iteration-revision logics?

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.

None yet

5 participants