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

[v22.3.x] Fix cross-shard allocator manipulation #7415

Merged

Conversation

vbotbuildovich
Copy link
Collaborator

Backport of PR #7351
Fixes #7414,

travisdowns and others added 5 commits November 21, 2022 22:26
Const member prevents copy and move assignment, but copy and move
assignment seem to have reasonable semantics (the destination
shard id is replaced by the source) and we need it for allocation_units
oncore tracking.

Issue redpanda-data#5558.

(cherry picked from commit c64fdbb)
(cherry picked from commit 0565bf6)
Even though they ave movable, allocation_units objects must be
destroyed on the same core the *original* allocation was made on,
as they contain an embedded pointer back to the allocation state
which lives on that core, since to do otherwise would be a cross-shard
race-condition.

Enforce this condition in debug mode using oncore checker.

(cherry picked from commit e5dad45)
Return the allocation_units wrapped in a foreign pointer, since they
need to be freed on the same core on which they were allocated.

Fixes redpanda-data#5558.

(cherry picked from commit 413cbe3)
Checks at the top of most functions to ensure that the core
of the caller is the same as the home core of the state, only in
debug builds.

(cherry picked from commit 44c0dc7)
@vbotbuildovich vbotbuildovich added this to the v22.3.x-next milestone Nov 21, 2022
@vbotbuildovich vbotbuildovich added the kind/backport PRs targeting a stable branch label Nov 21, 2022
@graphcareful graphcareful requested review from andrewhsu and travisdowns and removed request for dotnwat and dlex November 21, 2022 22:27
@graphcareful graphcareful marked this pull request as ready for review November 21, 2022 22:27
@andrewhsu andrewhsu modified the milestones: v22.3.x-next, v22.3.4 Nov 21, 2022
@piyushredpanda
Copy link
Contributor

/ci-repeat 1

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.

6 participants