FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix masked WriteSet shuffle bounds that can reuse stale bookie indexes by void-ptr974 · Pull Request #4819 · apache/bookkeeper · GitHub

Fix masked WriteSet shuffle bounds that can reuse stale bookie indexes - #4819

Open
void-ptr974 wants to merge 1 commit into
apache:masterfrom
void-ptr974:fix-writeset-shuffle-bounds
Open

void-ptr974 wants to merge 1 commit into
apache:masterfrom
void-ptr974:fix-writeset-shuffle-bounds

Conversation

Copy link
Copy Markdown
Contributor

Motivation

shuffleWithMask is used by topology-aware read reordering to shuffle contiguous WriteSet entries with the same mask. When the matched range is at the end of the logical WriteSet, the current loop starts from last + 1, which is outside the active range.

Since WriteSet instances are recycled and may retain a larger backing array than their current logical size, accessing size can reuse stale bookie indexes from a previous use.

Changes

  • Shuffle only within the matched range [first, last].
  • Treat index == size as out of bounds in WriteSetImpl.
  • Add coverage for get(size), set(size, ...), and moveAndShift(..., size).

Verifying this change

mvn -pl bookkeeper-server -Dtest=TestRackawareEnsemblePlacementPolicy#testShuffleWithMask,RoundRobinDistributionScheduleTest test -DskipShade -Dspotbugs.skip -Dlicense.skip

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL