void-ptr974 opened a new pull request, #4819: URL: https://github.com/apache/bookkeeper/pull/4819
### 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 is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
